Page MenuHomeFreeBSD

Override the library search directories for external GCC toolchains.
ClosedPublic

Authored by jhb on Dec 29 2018, 12:55 AM.

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
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

jhb created this revision.Dec 29 2018, 12:55 AM

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.

kan added a comment.Jan 15 2019, 7:14 PM

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

jhb added a comment.Jan 15 2019, 9:05 PM
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.

kan accepted this revision.Jan 16 2019, 12:54 AM

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.