From: Iain Sandoe Date: Thu, 2 Feb 2023 11:42:46 +0000 (+0000) Subject: Darwin: Search for both shared and convenience libraries in each path. (#761) X-Git-Tag: upstream/3.4.7~82 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7effe99955b228ae828d06fa8d07dc546ef67b1a;p=platform%2Fupstream%2Flibffi.git Darwin: Search for both shared and convenience libraries in each path. (#761) For several Darwin linker versions, the default behaviour is to first traverse the set of library paths, looking for shared libraries, and then a second time looking for archives. This means that if the library is configured --disable-shared the installed system version /usr/lib/libffi.dylib will be found before the archive under test. Using the linker option '-search-paths-first' alters the strategy to search each path for dylib and then archive before moving on to the next. --- diff --git a/testsuite/lib/libffi.exp b/testsuite/lib/libffi.exp index 7457af4..17d1ed5 100644 --- a/testsuite/lib/libffi.exp +++ b/testsuite/lib/libffi.exp @@ -380,6 +380,7 @@ proc libffi_target_compile { source dest type options } { || [istarget "*-*-darwin2*"] } { # lappend options "additional_flags=-Wl,-allow_stack_execute" lappend options "additional_flags=-Wno-unused-command-line-argument" + lappend options "additional_flags=-Wl,-search_paths_first" } # If you're building the compiler with --prefix set to a place