[Bug 227918] [PATCH] remove exists check for CROSS_BINUTILS_PREFIX for external clang builds on secondary arches

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sat May 5 11:20:10 UTC 2018


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227918

--- Comment #3 from Kenneth Salerno <kennethsalerno at yahoo.com> ---
(In reply to Bryan Drewery from comment #2)
Hello,

devel/xtoolchain-llvm* is just a no-build external compiler definition setting
XCC variables etc., not an external /cross-compiler/ being built specifically
for a single target arch like for example devel/powerpc64-gcc is. 

xtoolchain-llvm60 is therefore equivalent to what I am doing already in
make.conf:
MYLLVMSUFFIX = 60
_OSRELEASE != uname -r
OSREL = ${_OSRELEASE:C/-.*//}
XCC = /usr/local/bin/clang${MYLLVMSUFFIX}
XCXX = /usr/local/bin/clang++${MYLLVMSUFFIX}
XCPP = /usr/local/bin/clang-cpp${MYLLVMSUFFIX}
CROSS_BINUTILS_PREFIX = /usr/local/bin/powerpc64-unknown-freebsd${OSREL}-
XCFLAGS += -B/usr/local/bin/powerpc64-unknown-freebsd${OSREL}-
XCXXFLAGS += -B/usr/local/bin/powerpc64-unknown-freebsd${OSREL}-
XLDFLAGS += -B/usr/local/bin/powerpc64-unknown-freebsd${OSREL}-
NO_WERROR =
WERROR =
WITHOUT_GCC = yes
WITHOUT_GCC_BOOTSTRAP = yes
WITHOUT_GNUCXX = yes
WITH_CLANG = yes
WITH_CLANG_BOOTSTRAP = yes
WITH_CLANG_FULL = yes
WITH_CLANG_IS_CC = yes
WITH_LLD = yes

So the problem with all of this is when you use llvm to cross-compile (e.g.
amd64 build host -> ppc64 target), and you don't specify -B, it will try to use
/usr/bin/ld which will default to the host machine arch.

To force the correct arch I am using powerpc64-binutils, which has a funky
prefix (/usr/local/bin/powerpc64-unknown-freebsd11.1- that breaks this directly
exists check in Makefile.inc1 that will always fail and not automatically add
the correct -B from my CROSS_BINUTILS_PREFIX.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list