https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109951

            Bug ID: 109951
           Summary: [14 Regression] libgomp, testsuite: non-native
                    multilib c++ tests fail on Darwin.
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: testsuite
          Assignee: unassigned at gcc dot gnu.org
          Reporter: iains at gcc dot gnu.org
  Target Milestone: ---

Tests that include C++ are now failing on Darwin platforms with a non-native
multilib  [both x86_64 and i686 hosts].  The tests pass for native and fail for
the non-native.

The fail is that the linker is rejecting the supplied libstdc++.dylib because
it is the wrong architecture.

>From the debugging I have been able to do, the reason is that we are now using
"GXX_UNDER_TEST" which seems to hardwire all the flags and library paths for
the _native_ multi-lib.  Although we subsequently append paths for the
multilib-under-test, these are coming _after_ the native ones. 

e.g (trying to test x86_64 multilib on i686):

/scratch/10-5-leo/gcc-master/./gcc/xg++ 
-B/scratch/10-5-leo/gcc-master/./gcc/ 
-nostdinc++ 
-nostdinc++ 
-I/scratch/10-5-leo/gcc-master/i686-apple-darwin9/x86_64/libstdc++-v3/include/i686-apple-darwin9
 
-I/scratch/10-5-leo/gcc-master/i686-apple-darwin9/x86_64/libstdc++-v3/include 
-I/src-local/gcc-master/libstdc++-v3/libsupc++
-I/src-local/gcc-master/libstdc++-v3/include/backward
-I/src-local/gcc-master/libstdc++-v3/testsuite/util
-L/scratch/10-5-leo/gcc-master/i686-apple-darwin9/libstdc++-v3/src
-L/scratch/10-5-leo/gcc-master/i686-apple-darwin9/libstdc++-v3/src/.libs
-L/scratch/10-5-leo/gcc-master/i686-apple-darwin9/libstdc++-v3/libsupc++/.libs

^^^^ native includes and libs (embedded in GCC_UNDER_TEST)

-B/opt/iains/i686-apple-darwin9/gcc-14-0-0p/i686-apple-darwin9/bin/
-B/opt/iains/i686-apple-darwin9/gcc-14-0-0p/i686-apple-darwin9/lib/
-isystem /opt/iains/i686-apple-darwin9/gcc-14-0-0p/i686-apple-darwin9/include
-isystem
/opt/iains/i686-apple-darwin9/gcc-14-0-0p/i686-apple-darwin9/sys-include
-fchecking=1 exceptions_enabled2364.cc
-m64
-B/scratch/10-5-leo/gcc-master/i686-apple-darwin9/x86_64/libgomp/
-B/scratch/10-5-leo/gcc-master/i686-apple-darwin9/x86_64/libgomp/.libs 
-I/scratch/10-5-leo/gcc-master/i686-apple-darwin9/x86_64/libgomp

^^^ correct multilib includes and libs (I think these are added by the libgomp
stuff)

-I/src-local/gcc-master/libgomp/testsuite/../../include
-I/src-local/gcc-master/libgomp/testsuite/..
-shared-libgcc 
-fmessage-length=0
-fno-diagnostics-show-caret
-fdiagnostics-color=never
-fopenmp -Wno-complain-wrong-lang -S -o exceptions_enabled2364.s

====

Presumably, this works on Linux because the BFD linker ignores the first
library because it is incompatible and then carries on to find the second. 
Darwin's linker is more picky and does not try to look in other paths once it
finds a correctly-named lib (it presumes pilot error and complains).

** NOTE: ISTM that all platforms are still presented with the wrong include
paths first .. not sure what effect that would have.

I am having some trouble pin-pointing the exact rev because Darwin bootstrap is
broken around the likely commits.

(my guess is r14-853-g982c869ec00c72, but cannot confirm).

Reply via email to