diff --git a/src/main/native/BUILD b/src/main/native/BUILD index 3af2db53e3d6d2..e181e16087a829 100644 --- a/src/main/native/BUILD +++ b/src/main/native/BUILD @@ -71,7 +71,10 @@ cc_binary( ], includes = ["."], # For jni headers. linkopts = select({ - "//src/conditions:darwin": ["-framework CoreServices"], + "//src/conditions:darwin": [ + "-Wl,-framework,CoreServices", + "-Wl,-framework,IOKit", + ], "//conditions:default": [], }), linkshared = 1, diff --git a/src/test/shell/bazel/cc_integration_test.sh b/src/test/shell/bazel/cc_integration_test.sh index e4e2ae752d5ab5..c60cfea6fec8ae 100755 --- a/src/test/shell/bazel/cc_integration_test.sh +++ b/src/test/shell/bazel/cc_integration_test.sh @@ -234,54 +234,6 @@ EOF "Second build failed, tree artifact was not invalidated." } -# This test tests that Bazel can produce dynamic libraries that have undefined -# symbols on Mac and Linux. Not sure it is a sane default to allow undefined -# symbols, but it's the default we had historically. This test creates -# an executable (main) that defines bar(), and a shared library (plugin) that -# calls bar(). When linking the libplugin.so, symbol 'bar' is undefined. -# +-----------------------------+ +----------------------------------+ -# | main | | libplugin.so | -# | | | | -# | main() { return foo(); } +---------> foo() { return bar() - 42; } | -# | | | + | -# | | | | | -# | bar() { return 42; } <------------------+ | -# | | | | -# +-----------------------------+ +----------------------------------+ -function test_undefined_dynamic_lookup() { - if is_windows; then - # Windows doesn't allow undefined symbols in shared libraries. - return 0 - fi - mkdir -p "dynamic_lookup" - cat > "dynamic_lookup/BUILD" < "dynamic_lookup/plugin.cc" < "dynamic_lookup/main.cc" < ea/BUILD <