[coreboot-gerrit] New patch to review for coreboot: e24fc9c src/lib/Makefile.inc: Allow rmodules to link under Clang
Edward O'Callaghan (eocallaghan@alterapraxis.com)
gerrit at coreboot.org
Wed Nov 12 01:58:43 CET 2014
Edward O'Callaghan (eocallaghan at alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/7440
-gerrit
commit e24fc9c6fd0230901e6cce4d25f95a689e3952ad
Author: Edward O'Callaghan <eocallaghan at alterapraxis.com>
Date: Wed Nov 12 11:55:19 2014 +1100
src/lib/Makefile.inc: Allow rmodules to link under Clang
rmodules were getting linked with libgcc and not libcompiler-rt.
Unfortunately this is pretty ugly however we do this else where
in the build system so its consistently ugly. The build system
will later need a unification pass between compilers once we are
tree stable on Clang.
Change-Id: I380f7386de2c5adfa9036311323ad9f703b6e712
Signed-off-by: Edward O'Callaghan <eocallaghan at alterapraxis.com>
---
src/lib/Makefile.inc | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/lib/Makefile.inc b/src/lib/Makefile.inc
index c104ce3..98292a8 100644
--- a/src/lib/Makefile.inc
+++ b/src/lib/Makefile.inc
@@ -105,6 +105,7 @@ romstage-$(CONFIG_RELOCATABLE_RAMSTAGE) += rmodule.c
RMODULE_LDSCRIPT := $(src)/lib/rmodule.ld
RMODULE_LDFLAGS := -nostartfiles -Wl,--emit-relocs -Wl,-z,defs -Wl,-Bsymbolic -Wl,-T,$(RMODULE_LDSCRIPT)
+RMODULE_LDFLAGS_CLANG := -nostartfiles --emit-relocs -z defs -Bsymbolic -T$(RMODULE_LDSCRIPT)
# rmodule_link_rules is a function that should be called with:
# (1) the object name to link
@@ -115,7 +116,11 @@ RMODULE_LDFLAGS := -nostartfiles -Wl,--emit-relocs -Wl,-z,defs -Wl,-Bsymbolic -
# rmdoule is named $(1).rmod
define rmodule_link
$(strip $(1)): $(strip $(2)) $$(RMODULE_LDSCRIPT) $$(obj)/ldoptions $$(RMODTOOL)
+ifeq ($(CONFIG_COMPILER_LLVM_CLANG),y)
+ $$(LD_rmodules_$(4)) $$(RMODULE_LDFLAGS_CLANG) --defsym=__heap_size=$(strip $(3)) -o $$@ --start-group $(strip $(2)) $$(LIBCLANG_RT_FILE_NAME_rmodules_$(4)) --end-group
+else
$$(CC_rmodules_$(4)) $$(CFLAGS_rmodules_$(4)) $$(RMODULE_LDFLAGS) -Wl,--defsym=__heap_size=$(strip $(3)) -o $$@ -Wl,--start-group $(strip $(2)) $$(LIBGCC_FILE_NAME_rmodules_$(4)) -Wl,--end-group
+endif
$$(NM_rmodules_$(4)) -n $$@ > $$(basename $$@).map
$(strip $(1)).rmod: $(strip $(1))
More information about the coreboot-gerrit
mailing list