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)
Wed, Apr 10, 6:22 PM
Unknown Object (File)
Sun, Mar 24, 3:32 PM
Unknown Object (File)
Mar 1 2024, 8:42 AM
Unknown Object (File)
Jan 28 2024, 7:10 PM
Unknown Object (File)
Dec 20 2023, 2:28 AM
Unknown Object (File)
Dec 8 2023, 3:48 PM
Unknown Object (File)
Nov 19 2023, 6:09 PM
Unknown Object (File)
Nov 19 2023, 6:09 PM
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.