]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libffi: Use correct include path for tests [PR125417]
authorPietro Monteiro <pietro@sociotechnical.xyz>
Tue, 26 May 2026 23:09:23 +0000 (19:09 -0400)
committerPietro Monteiro <pietro@sociotechnical.xyz>
Tue, 26 May 2026 23:09:23 +0000 (19:09 -0400)
Libffi testsuite uses relative directories for include paths.  For
multilibbed targets we run the tests from the the main target build
directory, so using relative paths leads to the wrong fiules being
included by the tests.  Fix by using variables that point into the
build dir for the current multilib variant being tested.

Forwarded upstream: https://github.com/libffi/libffi/pull/965

libffi/ChangeLog:
PR libffi/125417
* testsuite/lib/libffi.exp (libffi_target_compile): Use
${libffi_include} and ${blddirffi} instead of "../include" and
".." for include paths.

Signed-off-by: Pietro Monteiro <pietro@sociotechnical.xyz>
libffi/testsuite/lib/libffi.exp

index 577c4d28183143f1011b529d24e7bcfc64cc5d87..01cc12fa3b4bb7f1505f9bc26631c6de9725dc35 100644 (file)
@@ -398,9 +398,9 @@ proc libffi_target_compile { source dest type options } {
         lappend  options "additional_flags=$TOOL_OPTIONS"
     }
 
-    # search for ffi_mips.h in srcdir, too
-    # lappend options "additional_flags=-I${libffi_include} -I${srcdir}/../include  -I${libffi_include}/.."
-    lappend options "additional_flags=-I ../include -I ${srcdir}/../include  -I .."
+    # Search for include files in build_dir/include, build_dir and source_dir/include.
+    # The .. in the last path is necessary because srcdir points to libffi source/testsuite.
+    lappend options "additional_flags=-I${libffi_include} -I${blddirffi} -I${srcdir}/../include"
     if { [string match $type "executable"] } {
 
         lappend options "additional_flags=${libffi_link_flags}"