On 1/1/24 09:48, YunQiang Su wrote:
When building multilib libraries, CC/CXX etc are set with an option
-B*/lib/, instead of -B<something>/lib/<multi-os-directory>.
This will make some trouble in some case, for example building
cross toolchain based on Debian's cross packages:
If we have libc6-dev-i386-amd64-cross packages installed on
a non-x86 machine. This package will have the files in
/usr/x86_4-linux-gnu/lib32. The fellow configure will fail
when build libgcc for i386, with complains the libc is not
i386 ones:
../configure --enable-multilib --enable-multilib \
--target=x86_64-linux-gnu
Let's insert a "-B*/lib/`CC ${flags} --print-multi-os-directory`"
before "-B*/lib/".
This patch is based on the patch used by Debian now.
ChangeLog
* config-ml.in: Insert an -B option with multi-os-dir into
compiler commands used to build libraries.
I would prefer this to wait for gcc-15. I'll go ahead and ACK it for
gcc-15 though.
What would also be valuable would be to extract out the rest of the
multiarch patches from the Debian patches and get those into into GCC
proper.
Jeff