This will still build the compiler for the target but will not build the
bootstrap cross-compiler in the cross-tools phase. Other toolchain
bootstrapping, such as elftoolchan and binutils, currently still occurs.
This will utilize the default CC (cc, /usr/bin/cc) as an external compiler.
This is planned to be on-by-default eventually.
This will utilize the __FreeBSD_cc_version compiler macro defined in the
source tree and compare it to CC's version. If they match then the
cross-compiler is skipped. If [X]CC is an external compiler (absolute
path) or WITHOUT_CROSS_COMPILER is already set, then this logic is skipped.
If the expected bootstrap compiler type no longer matches the found CC
compiler type (clang vs gcc), then the logic is skipped. As an extra
safety check the version number is also compared from the compiler to
the tree version.
Clang:
The macro FREEBSD_CC_VERSION is defined in:
lib/clang/include/clang/Basic/Version.inc
For clang -target will be used if TARGET_ARCH != MACHINE_ARCH. This
is from the current external toolchain logic. There is currently an
assumption that the host compiler can build the TARGET_ARCH. This
will usually be the case since we don't conditionalize target arch
support in clang, but it will break when introducing new
architectures. This problem is mitigated by incrementing the version
when adding new architectures.
GCC:
The macro FBSD_CC_VER is defined in:
gnu/usr.bin/cc/cc_tools/freebsd-native.h
For GCC there is no simple -target support when TARGET_ARCH !=
MACHINE_ARCH. In this case the opportunistic skip is not done. If we
add proper support for this case in external toolchain logic then it
will be fine to enable.
This relies on the macros being incremented whenever any change occurs
to these compilers that warrant rebuilding files. It also should never
repeat earlier values.
Reviewed by: brooks, bapt, imp
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D6357
This is mostly a style change so that other code does not duplicate
it. The problem is when META_MODE needs to be disabled but it has
been overridden by .MAKE.MODE.
Sponsored by: EMC / Isilon Storage Division
architectures. There's no definition for it, nobody uses it
and it is unlikely to ever work. We can put it back when someone
demonstrates it running...
The new default for armv6 is hard float, so extend that default
to the external toolchain support.
side effect of replacing /etc/{master.,}passwd and /etc/group.
Submitted by: O. Hartmann
Pointyhat to: gjb (myself)
Sponsored by: The FreeBSD Foundation
The old (^/stable/9) default was yes, not no ("no" was the new default
introduced recently that broke POLA). Restore it to keep POLA like
glebius intended in r299077
MFC after: 3 days
X-MFC with: r299086
Pointyhat to: ngie (research before assuming and committing next time)
Sponsored by: EMC / Isilon Storage Division
Without this the incremental build was broken since .depend.* are not
generated with .MAKE.MODE=meta and .meta files were not created to
track dependencies. Typically meta mode does not create .meta files
when building with curdir==objdir but the kernel build is special.
Reported by: Nikolai Lifanov <lifanov@mail.lifanov.com>
Sponsored by: EMC / Isilon Storage Division
This also protects them from trying to create .meta files
with WITH_META_MODE.
Reported by: Nikolai Lifanov <lifanov@mail.lifanov.com>
Sponsored by: EMC / Isilon Storage Division
created to avoid creating ${.OBJDIR}.
The duplicate REVISION/BRANCH/VERSION evaluation will be addressed
separately.
Sponsored by: The FreeBSD Foundation
When using meta mode with filemon, the build is reliably incremental
safe. Bmake will use the meta files, along with filemon information,
to rebuild targets when their dependencies change, commands change,
or files they generate are missing.
Sponsored by: EMC / Isilon Storage Division
Some of the clang libraries build in this phase and the cross-tools
phase. Later in the cross-tools phase when they build with a default
TOOLS_PREFIX, they see a changed build command in meta mode due to
the changed DEFAULT_SYSROOT. This is avoided by passing along
TOOLS_PREFIX earlier.
Sponsored by: EMC / Isilon Storage Division
This avoids 'build command changed' due to CFLAGS/CC changes during the
normal build. Without this the build-tools targets end up rebuilding
for the *target* rather than keeping the native versions built in
build-tools.
Sponsored by: EMC / Isilon Storage Division
The change in r284345 moved the creation of openpam_static_modules.o to
lib/libpam/static_modules but never managed to get them into libpam.a.
Move this logic to lib/libpam/static_libpam and have it create a static
library for libpam.a The main lib/libpam/libpam will only create a
shared library. No redundancy in compilation or installation exists
in this solution.
This avoids requiring a pass with -D_NO_LIBPAM_SO_YET.
Sponsored by: EMC / Isilon Storage Division
cause bizarre packaging failures with non-default OBJDIR
and/or MAKEOBJDIRPREFIX and REPODIR set to a location not
within OBJDIR.
Reported by: many
Tested by: sef
Sponsored by: The FreeBSD Foundation
GCC does add <sysroot>/usr/lib to the library search path but it comes after
/usr/local/lib which can find ports libraries such as libedit.so. The
bad path comes in as /usr/local/lib/gcc/x86_64-portbld-freebsd11.0/5.3.0/../../../
which corresponds to <prefix>/lib.
This partially reverts r297271.
Pointyhat to: bdrewery
Sponsored by: EMC / Isilon Storage Division
In r296926 the -P <path> option was added to kbdcontrol, which enables
this change for a simplified compile-time default keymap build process.
PR: 193865
Reviewed by: Oliver Pinter
Tested by: Oliver Pinter
MFC After: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D5708
The use of XCXXFLAGS is to assign it to CXX in CROSSENV.
XCFLAGS is also assigned here so there is no need to have
--syroot and -B flags again.
Sponsored by: EMC / Isilon Storage Division
Without this the default toolchain in /usr/bin/ would not use
WORLDTMP via --sysroot, and would lack --target if cross-building.
PR: 196193
Related: D3970
Sponsored by: EMC / Isilon Storage Division
- The -L WORLDTMP/usr/lib is not needed as GCC is already adding in
-L =/usr/lib internally with --sysroot. It does not do this for
header include paths though, thus passing -isystem =/usr/include is
still needed.
For the forced libc++ usage:
- Use -isystem rather than -I for libc++ headers.
- Use -std=c++11 rather than gnu++11.
- Use -nostdinc++ to ensure GCC's headers don't leak in.
Sponsored by: EMC / Isilon Storage Division
This overrides the cross-compiler's default sysroot to use the WORLD32's
sysroot for building the lib32 libraries. Previously the cross-compiler
would default the sysroot to the 64bit WORLDTMP and -B/-L/-isystem flags
were used to build using the lib32 files. This leads to multiple issues
discussed later. Some extra headers are now needed to be staged since the
64bit WORLDTMP is not referenced at all for headers. The 64bit WORLDTMP
is still used via PATH for build tools. Overriding the default
target/arch is retained in the CC/CXX overrides.
This allows reverting the LDSCRIPT rewriting in installworld from r296921 and
r235122, thus allowing read-only objdirs to work for installing again.
This removes the need for _LDSCRIPTROOT.
This allows progressing the change to always use --sysroot for the build
rather than only relying on the cross-compiler's default sysroot. The
work for that is in D3970 and needed to resolve WITHOUT_CROSS_COMPILER
not using a --sysroot [1].
PR: 196193 [1]
Sponsored by: EMC / Isilon Storage Division
This should fix the 'packages' target when MAKEOBJDIRPREFIX or
DESTDIR is set in the make(1) environment or via command line.
Reported by: kmoore, sef, Marko Turk
Sponsored by: The FreeBSD Foundation