Page MenuHomeFreeBSD

native-xtools: GCC and CLANG are exclusive, pick one.
AbandonedPublic

Authored by sbruno on Nov 24 2017, 5:57 PM.

Details

Summary

With CLANG growing mips64 support recently, the native-xtools
target now grinds away building the toolchain but it never gets used. Don't
do that.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 13003
Build 13257: arc lint + arc unit

Event Timeline

sbruno created this revision.Nov 24 2017, 5:57 PM
jhb added a comment.Nov 24 2017, 7:35 PM

I wonder if this shouldn't be conditional on which compiler is used as cc. That way if you do 'make native-stools WITH_CLANG_AS_CC=yes' you would get clang instead of gcc.

In D13230#275661, @jhb wrote:

I wonder if this shouldn't be conditional on which compiler is used as cc. That way if you do 'make native-stools WITH_CLANG_AS_CC=yes' you would get clang instead of gcc.

I like that idea. The toggle isn't whether or not CLANG is being used but if CLANG is the default system compiler on this ARCH.

Default:

sbruno@lab:~/bsd/fbsd_head % make showconfig TARGET=mips TARGET_ARCH=mips64 | grep GCC
MK_GCC           = yes
MK_GCC_BOOTSTRAP = yes
sbruno@lab:~/bsd/fbsd_head % make showconfig TARGET=mips TARGET_ARCH=mips64 | grep CLANG
MK_CLANG         = yes
MK_CLANG_BOOTSTRAP = no
MK_CLANG_EXTRAS  = no
MK_CLANG_FULL    = yes
MK_CLANG_IS_CC   = no

src.conf WITH_CLANG_IS_CC=y:

sbruno@lab:~/bsd/fbsd_head % make showconfig TARGET=mips TARGET_ARCH=mips64 | grep GCC
MK_GCC           = yes
MK_GCC_BOOTSTRAP = yes
sbruno@lab:~/bsd/fbsd_head % make showconfig TARGET=mips TARGET_ARCH=mips64 | grep CLANG
MK_CLANG         = yes
MK_CLANG_BOOTSTRAP = no
MK_CLANG_EXTRAS  = no
MK_CLANG_FULL    = yes
MK_CLANG_IS_CC   = yes

This code block also needs an adjustment to "something" as we have no need to add these to this target's build in the GCC case.

1901 # We need to build tblgen when we're building clang or lld, either as
1902 # bootstrap tools, or as the part of the normal build.
1903 .if ${MK_CLANG_BOOTSTRAP} != "no" || ${MK_CLANG} != "no" || \
1904     ${MK_LLD_BOOTSTRAP} != "no" || ${MK_LLD} != "no"
1905 _clang_tblgen= \
1906         lib/clang/libllvmminimal \
1907         usr.bin/clang/llvm-tblgen \
1908         usr.bin/clang/clang-tblgen
1909 
1910 ${_bt}-usr.bin/clang/clang-tblgen: ${_bt}-lib/clang/libllvmminimal
1911 ${_bt}-usr.bin/clang/llvm-tblgen: ${_bt}-lib/clang/libllvmminimal
1912 .endif
sbruno abandoned this revision.Dec 7 2017, 4:17 PM