diff mbox series

[pushed] Darwin, libffi, testsuite: Ensure we pick up the convenience lib.

Message ID 20230122093556.33081-1-iain@sandoe.co.uk
State New
Headers show
Series [pushed] Darwin, libffi, testsuite: Ensure we pick up the convenience lib. | expand

Commit Message

Iain Sandoe Jan. 22, 2023, 9:35 a.m. UTC
Tested on i686, powerpc, x86_64, Arm64 Darwin, x86_64-linux-gnu,
pushed to trunk, thanks,
Iain

--- 8< ---

For several Darwin linker versions, the link paths are first traversed
looking for shared libraries, and then again looking for archives.

We want the paths to be searched for both shared and archives in order
so that we will find the non-shared libffi in the testsuite (otherwise
the installed version in the system will be found instead).

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

libffi/ChangeLog:

	* testsuite/lib/libffi.exp: Search for both shared and archive
	in each path in turn.
---
 libffi/testsuite/lib/libffi.exp | 1 +
 1 file changed, 1 insertion(+)

Comments

Rainer Orth Jan. 22, 2023, 9:44 a.m. UTC | #1
Hi Iain,

> Tested on i686, powerpc, x86_64, Arm64 Darwin, x86_64-linux-gnu,
> pushed to trunk, thanks,
> Iain
>
> --- 8< ---
>
> For several Darwin linker versions, the link paths are first traversed
> looking for shared libraries, and then again looking for archives.
>
> We want the paths to be searched for both shared and archives in order
> so that we will find the non-shared libffi in the testsuite (otherwise
> the installed version in the system will be found instead).
>
> Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
>
> libffi/ChangeLog:
>
> 	* testsuite/lib/libffi.exp: Search for both shared and archive
> 	in each path in turn.

shouldn't this go upstream first?

	Rainer
Iain Sandoe Jan. 22, 2023, 10:04 a.m. UTC | #2
Hi Rainer,

> On 22 Jan 2023, at 09:44, Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> wrote:
> 

>> Tested on i686, powerpc, x86_64, Arm64 Darwin, x86_64-linux-gnu,
>> pushed to trunk, thanks,
>> Iain
>> 
>> --- 8< ---
>> 
>> For several Darwin linker versions, the link paths are first traversed
>> looking for shared libraries, and then again looking for archives.
>> 
>> We want the paths to be searched for both shared and archives in order
>> so that we will find the non-shared libffi in the testsuite (otherwise
>> the installed version in the system will be found instead).
>> 
>> Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
>> 
>> libffi/ChangeLog:
>> 
>> 	* testsuite/lib/libffi.exp: Search for both shared and archive
>> 	in each path in turn.
> 
> shouldn't this go upstream first?

I was regarding this as specific to GCC since we build without the shared library
now  (but I guess upstream could also be configured with —disable-shared).

so I will make a pull request, thanks for the note.

Iain
diff mbox series

Patch

diff --git a/libffi/testsuite/lib/libffi.exp b/libffi/testsuite/lib/libffi.exp
index 7dc7b5d19a3..15d3d5ebd73 100644
--- a/libffi/testsuite/lib/libffi.exp
+++ b/libffi/testsuite/lib/libffi.exp
@@ -384,6 +384,7 @@  proc libffi_target_compile { source dest type options } {
     if { [istarget "*-*-darwin9*"] || [istarget "*-*-darwin1*"]
 	 || [istarget "*-*-darwin2*"] } {
 	lappend options "additional_flags=-Wl,-allow_stack_execute"
+	lappend options "additional_flags=-Wl,-search_paths_first"
     }
 
     # If you're building the compiler with --prefix set to a place