[coreboot-gerrit] Patch set updated for coreboot: ec63604 build system: re-enable clang use

Patrick Georgi (patrick@georgi-clan.de) gerrit at coreboot.org
Mon May 19 12:31:42 CEST 2014


Patrick Georgi (patrick at georgi-clan.de) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5747

-gerrit

commit ec636046d78de497fe001e754e9cb00c4087bfa6
Author: Patrick Georgi <patrick at georgi-clan.de>
Date:   Wed May 14 21:05:35 2014 +0200

    build system: re-enable clang use
    
    Change-Id: I6e07fdec449d0b259d77986f65a60aa36d367cc8
    Signed-off-by: Patrick Georgi <patrick at georgi-clan.de>
---
 Makefile                  | 26 +++++++++++++++++++++++---
 Makefile.inc              |  2 +-
 src/arch/x86/Makefile.inc |  2 +-
 3 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index cc2d27c..5006bf6 100644
--- a/Makefile
+++ b/Makefile
@@ -107,13 +107,33 @@ else
 
 include $(HAVE_DOTCONFIG)
 
-include toolchain.inc
-
 ifeq ($(CONFIG_COMPILER_LLVM_CLANG),y)
-CC:=clang -m32 -mno-mmx -mno-sse -no-integrated-as
+# FIXME: armv7/aarch64 won't build right now
+# FIXME: we somehow need to pass --divide to clang's non-integrated as
+#        unfortunately -Wa,--divide isn't enough because that passes
+#        --divide to gcc (which clang uses as "assembler").
+CFLAGS_x86_32 = -no-integrated-as -Qunused-arguments -target i386-elf -m32
+CC_x86_32:=clang
+
+ifneq ($(CONFIG_MMX),y)
+CFLAGS_x86_32 += -mno-mmx
+endif
+
+ifneq ($(CONFIG_SSE),y)
+CFLAGS_x86_32 += -mno-sse
+endif
+
+CFLAGS_armv7 = -no-integrated-as -Qunused-arguments -target armv7-eabi -ccc-gcc-name $(CC_armv7)
+CC_armv7:=clang
+
+CFLAGS_aarch64 = -no-integrated-as -Qunused-arguments -target aarch64-eabi -ccc-gcc-name $(CC_aarch64)
+CC_aarch64:=clang
+
 HOSTCC:=clang
 endif
 
+include toolchain.inc
+
 strip_quotes = $(subst ",,$(subst \",,$(1)))
 
 # The primary target needs to be here before we include the
diff --git a/Makefile.inc b/Makefile.inc
index 529250d..4621bb7 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -218,7 +218,7 @@ CPPFLAGS_common := -Isrc -Isrc/include -I$(obj)
 CPPFLAGS_common += -Isrc/device/oprom/include
 CPPFLAGS_common += -include $(src)/include/kconfig.h
 
-CFLAGS_common = -Os -pipe -g -nostdinc
+CFLAGS_common += -Os -pipe -g -nostdinc
 CFLAGS_common += -nostdlib -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes
 CFLAGS_common += -Wwrite-strings -Wredundant-decls -Wno-trigraphs
 CFLAGS_common += -Wstrict-aliasing -Wshadow
diff --git a/src/arch/x86/Makefile.inc b/src/arch/x86/Makefile.inc
index 6c7008c..02fceba 100644
--- a/src/arch/x86/Makefile.inc
+++ b/src/arch/x86/Makefile.inc
@@ -30,7 +30,7 @@ subdirs-y += smp
 ifeq ($(CONFIG_COMPILER_GCC),y)
 DISASSEMBLY=-Wa,-acdlns $(CFLAGS_x86_32)
 else
-DISASSEMBLY=
+DISASSEMBLY=$(CFLAGS_x86_32)
 endif
 
 OPTION_TABLE_H:=



More information about the coreboot-gerrit mailing list