Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 09 Nov 2017 09:28:23 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-toolchain@FreeBSD.org
Subject:   [Bug 223551] for external toolchain support, X prefix is not setting build utils for make buildworld
Message-ID:  <bug-223551-29464-haLctR7Xey@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-223551-29464@https.bugs.freebsd.org/bugzilla/>
References:  <bug-223551-29464@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D223551

--- Comment #2 from Mark Millard <markmi@dsl-only.net> ---
(In reply to sid from comment #0)

I'll also mention that there is a
port devel/xtoolchain-llvm50 that
installs files to help configure
for using llvm50 as a
cross-compiler.

For example:

# more /usr/local/share/toolchains/llvm50.mk
XCC=3D/usr/local/bin/clang50
XCXX=3D/usr/local/bin/clang++50
XCPP=3D/usr/local/bin/clang-cpp50
XLD=3D/usr/local/llvm50/bin/ld.lld
CROSS_BINUTILS_PREFIX=3D/var/empty
X_COMPILER_TYPE=3Dclang

An example for a gcc compiler is:

# more /usr/local/share/toolchains/aarch64-gcc.mk
XCC=3D/usr/local/bin/aarch64-unknown-freebsd12.0-gcc
XCXX=3D/usr/local/bin/aarch64-unknown-freebsd12.0-g++
XCPP=3D/usr/local/bin/aarch64-unknown-freebsd12.0-cpp
CROSS_BINUTILS_PREFIX=3D/usr/local/aarch64-freebsd/bin/
X_COMPILER_TYPE=3Dgcc

It would take also assigning CC/CXX/CPP/. . . in
order to also use llvm50 materials as the host
compiler/toolchain as well during cross-builds.

(Note that the limiting condition of a cross-build is
a form of native build, where the target happens to
match the host type. But technically the CC/CXX/CPP/. . .
could be assigned but the XCC/XCXX/XCPP/. . . left
unassigned for "self hosted" that avoids the
system compiler.)

One does have to consider what to do with
(showing WITHOUT_ use):

WITHOUT_CROSS_COMPILER=3D
WITHOUT_SYSTEM_COMPILER=3D

WITH_SYSTEM_COMPILER=3D would be directly indicating
to use the system compiler when a cross compiler
does not seem to need to be built.

WITH_CROSS_COMPILE=3D vs. WITHOUT_CROSS_COMPILER=3D
is less obvious and I analyzed source code to see
which way had the properties that I was after in
each case.

In my earlier example it was using WITHOUT_ for
both and I explicitly set lots of things. This
makes the case structurally more similar to the
case of avoiding the system compiler (and potential
cross compiler variant): in part it is just replacing
some paths.

It is not obvious what your host-native vs.
cross-build-target intents are for use of:

/usr/local/bin/llvm-as50
/usr/local/bin/llvm-ar50
/usr/local/bin/lld-link50
/usr/local/bin/llvm-nm50
/usr/local/bin/llvm-objdump50
/usr/local/bin/llvm-ranlib50
/usr/local/bin/llvm-strings50

(I've had examples of the host-native
vs. cross-build-toolchain using different
tools.)

You may have to specify more of your intent
for such things in order to find out what is
needed to configure things.

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-223551-29464-haLctR7Xey>