Page MenuHomeFreeBSD

Override the library search directories for external GCC toolchains.
ClosedPublic

Authored by jhb on Dec 29 2018, 12:55 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 18, 10:36 PM
Unknown Object (File)
Mon, Nov 18, 12:09 AM
Unknown Object (File)
Sun, Nov 17, 7:17 PM
Unknown Object (File)
Sun, Nov 17, 7:04 PM
Unknown Object (File)
Sun, Nov 17, 2:13 PM
Unknown Object (File)
Sun, Nov 17, 1:55 PM
Unknown Object (File)
Mar 24 2024, 3:32 PM
Unknown Object (File)
Mar 1 2024, 8:42 AM
Subscribers

Details

Summary

The default library search directories when building a native GCC end
up falling back to /usr/local/lib (for devel/*-gcc) and /usr/lib
(for base/gcc) even when --sysroot is used. For devel/*-gcc, I
previously forced CROSS_DIRECTORY_STRUCTURE on in r466699 to workaround
this. However, this solution could not be used for base/gcc. Instead,
patch the sources to remove several of the library search directories
and override STARTFILE_PREFIX_SPEC to only look in /usr/lib. GCC still
adds tuple-specific subdirs to /usr/lib, but this is ok.

Bump PORTREVISION for both the external GCC toolchains and base/gcc.

Test Plan
  • was able to do a hosted buildworld using base/gcc in a FreeBSD/mips qemu machine across a revision that added a symbol to libnv and was failing when the /usr/lib fallback kicked in since it was trying to link to the wrong (old) libnv
  • still able to use amd64-gcc with the CROSS_DIRECTORY_STRUCTURE hack removed. buildworld doesn't finish due to other breakages that have been present in HEAD for many months

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Adding bdrewery@ and bapt@ in hope of getting some review. Not sure if there is another person who would be qualified to review GCC patches.

I wonder what this does to, say, arm-none-eabi-gcc? It, in somewhat misguided manner, uses powerpc64-gcc as the base.

In D18677#402462, @kan wrote:

I wonder what this does to, say, arm-none-eabi-gcc? It, in somewhat misguided manner, uses powerpc64-gcc as the base.

I believe it should not be applied since arm-none (and the aarch64-none) define GCC_TARGET and I only add this to EXTRA_PATCHES when GCC_TARGET isn't defined.

fair enough, I cannot see any negatives to this at the moment.

This revision is now accepted and ready to land.Jan 16 2019, 12:54 AM
This revision was automatically updated to reflect the committed changes.