External GCC Update

John Baldwin jhb at FreeBSD.org
Thu Feb 28 20:39:16 UTC 2019


On 2/25/19 12:24 PM, Brooks Davis wrote:
> On Mon, Feb 25, 2019 at 10:50:40AM -0800, John Baldwin wrote:
>> Hmm, cross compiling is indeed a bear.  My original version of this was to
>> have base/gcc install a special 'freebsd-gcc.mk' toolchain file to
>> /usr/share/toolchains and modify Makefile.inc1 to use this as the default
>> CROSS_TOOLCHAIN if present.  I mostly didn't like this because it would be
>> a single file that so you can't set separate policy if, for example, some
>> arch or install only wanted base/binutils and not base/gcc.  On the other
>> hand, it had the advantage that setting an explicit CROSS_TOOLCHAIN when you
>> are cross compiling would work correctly.
>>
>> Perhaps I can rework this to use two files in /usr/share/toolchains and have
>> Makefile.inc1 explicitly include any files in that directory if
>> CROSS_TOOLCHAIN isn't set?
> 
> I think I like that option best.
> 
> Another way to deal with the two-files issue would be to have a
> base/toolchain metaport with options that installs the consolidated file
> you want.  That mirrors (somewhat) the setup in devel/*xtoolchain*, but
> I'm not convinced it won't just lead to confusion.

I've rebased and repushed the 'base_gcc' branch again to follow this approach.
Rather than using a glob, it just hardcodes the two possible files.  I did
have to make one change which is that the helper files have to use 'export'
for the WITH/WITHOUT variables or they weren't being honored in child makes.
However, this approach works even for 'make buildenv' in my testing.

-- 
John Baldwin


More information about the freebsd-toolchain mailing list