Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10426
-gerrit
commit 13fc41bc5b0ed5f1b07dd3b437c2c8db60b7fb65
Author: Patrick Georgi <patrick(a)georgi-clan.de>
Date: Thu Jun 4 13:14:54 2015 +0200
arch/x86: No need to specify -Wa,--divide in a Makefile
We test for it in xcompile and add it to CFLAGS.
Change-Id: I041a881b542bc55c1725af384f038da3356e3bb1
Signed-off-by: Patrick Georgi <patrick(a)georgi-clan.de>
---
src/arch/x86/Makefile.inc | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/arch/x86/Makefile.inc b/src/arch/x86/Makefile.inc
index 5da5a4a..9f4589b 100644
--- a/src/arch/x86/Makefile.inc
+++ b/src/arch/x86/Makefile.inc
@@ -27,8 +27,6 @@ subdirs-y += boot
subdirs-y += lib
subdirs-y += smp
-DISASSEMBLY=-Wa,--divide
-
################################################################################
# i386 specific tools
NVRAMTOOL:=$(objutil)/nvramtool/nvramtool
@@ -114,7 +112,7 @@ $(objgenerated)/bootblock_inc.S: $$(bootblock_inc)
$(objgenerated)/bootblock.o: $(objgenerated)/bootblock.s
@printf " CC $(subst $(obj)/,,$(@))\n"
- $(CC_bootblock) $(CFLAGS_x86_32) $(DISASSEMBLY) -c -o $@ $< > $(basename $(a)).disasm
+ $(CC_bootblock) $(CFLAGS_x86_32) -c -o $@ $< > $(basename $(a)).disasm
$(objgenerated)/bootblock.s: $(objgenerated)/bootblock_inc.S $(obj)/config.h $(obj)/build.h
@printf " CC $(subst $(obj)/,,$(@))\n"
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10424
-gerrit
commit 442b9e5741356e7ad7cbd841c85749e8b7f45351
Author: Patrick Georgi <patrick(a)georgi-clan.de>
Date: Thu Jun 4 13:44:41 2015 +0200
xcompile: Detect clang compilers
This uses the availability of CONFIG_* variables in .xcompile and tests for
compilers in xcompile so that the build system doesn't need to probe them.
Change-Id: I359ad6245d2527efa7e848a9b38f5f194744c827
Signed-off-by: Patrick Georgi <patrick(a)georgi-clan.de>
Signed-off-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
---
util/xcompile/xcompile | 34 +++++++++++++++++++++++++++-------
1 file changed, 27 insertions(+), 7 deletions(-)
diff --git a/util/xcompile/xcompile b/util/xcompile/xcompile
index 0a22c34..f96857d 100755
--- a/util/xcompile/xcompile
+++ b/util/xcompile/xcompile
@@ -159,11 +159,15 @@ detect_special_flags() {
report_arch_toolchain() {
cat <<EOF
-# elf${TWIDTH}-${TBFDARCH} toolchain (${GCCPREFIX}gcc)
+# elf${TWIDTH}-${TBFDARCH} toolchain (${GCC})
ARCH_SUPPORTED+=${TARCH}
SUBARCH_SUPPORTED+=${TSUPP-${TARCH}}
-CC_${TARCH}:=${GCCPREFIX}gcc
+ifeq (\$(CONFIG_COMPILER_GCC),y)
+CC_${TARCH}:=${GCC}
CFLAGS_${TARCH}:=${CFLAGS_GCC}
+else
+CC_${TARCH}:=${CLANG}
+endif
CPP_${TARCH}:=${GCCPREFIX}cpp
AS_${TARCH}:=${GCCPREFIX}as ${ASFLAGS}
LD_${TARCH}:=${GCCPREFIX}ld${LINKER_SUFFIX} ${LDFLAGS}
@@ -231,6 +235,7 @@ test_architecture() {
GCCPREFIX="invalid"
unset TABI TARCH TBFDARCH TCLIST TENDIAN TSUPP TWIDTH
+ unset GCC CLANG
if type arch_config_$architecture > /dev/null; then
arch_config_$architecture
else
@@ -257,21 +262,36 @@ test_architecture() {
program_exists "${gccprefix}as" || continue
for endian in $TENDIAN ""; do
testas "$gccprefix" "$TWIDTH" "$TBFDARCH" \
- "" "$endian" && return 0
+ "" "$endian" && break
testas "$gccprefix" "$TWIDTH" "$TBFDARCH" \
- "TRUE" "$endian" && return 0
+ "TRUE" "$endian" && break
done
done
done
+ if [ "invalid" != "$GCCPREFIX" ]; then
+ GCC="${GCCPREFIX}gcc"
+ fi
+
+ for clang_arch in $TCLIST invalid; do
+ testcc "clang" "-target ${clang_arch}-$TABI -c" && break
+ done
- echo "Warning: no suitable GCC for $architecture." >&2
- return 1
+ if [ "invalid" != "$clang_arch" ]; then
+ # FIXME: this may break in a clang && !gcc configuration,
+ # but that's more of a clang limitation. Let's be optimistic
+ # that this will change in the future.
+ CLANG="clang -target ${clang_arch}-${TABI} -ccc-gcc-name ${GCC}"
+ fi
+
+ if [ -z "$GCC" -a -z "$CLANG" ]; then
+ echo "Warning: no suitable compiler for $architecture." >&2
+ return 1
+ fi
}
# This loops over all supported architectures.
for architecture in $SUPPORTED_ARCHITECTURES; do
if test_architecture $architecture; then
- CC="${GCCPREFIX}"gcc
detect_special_flags "$architecture"
report_arch_toolchain
fi
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10422
-gerrit
commit c23ebe8c01f16878378c5d50b1708f6552e639a9
Author: Patrick Georgi <patrick(a)georgi-clan.de>
Date: Thu Jun 4 13:18:11 2015 +0200
build system: Move .xcompile include further down
It's not used until then, but by moving it below including .config,
we can use CONFIG_* in the .xcompile file in the future.
Change-Id: I672f444dd28b5fae1fc339a1e0e78a249c9b7875
Signed-off-by: Patrick Georgi <patrick(a)georgi-clan.de>
---
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 9d174e0..b41057c 100644
--- a/Makefile
+++ b/Makefile
@@ -38,8 +38,6 @@ $(if $(wildcard .xcompile),,$(eval $(shell util/xcompile/xcompile $(XGCCPATH) >
$< $(XGCCPATH) > $@.tmp
\mv -f $@.tmp $@ 2> /dev/null
-include .xcompile
-
export top := $(CURDIR)
export src := src
export srck := $(top)/util/kconfig
@@ -122,6 +120,8 @@ else
include $(HAVE_DOTCONFIG)
+include .xcompile
+
ifeq ($(CONFIG_COMPILER_LLVM_CLANG),y)
# FIXME: armv7/aarch64 won't build right now
# NOTE: clang puts compiler-rt under lib/linux/libclang_rt.builtins-i386.a