summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorPatrick Georgi <patrick@georgi-clan.de>2015-06-04 13:31:38 +0200
committerPatrick Georgi <pgeorgi@google.com>2015-06-04 20:01:45 +0200
commit527f3923b0dc4a33b3be368107768792e09dc31e (patch)
tree5074c1fe4f1e639c15dec7d2fa02e6bbf0179f66 /util
parent8b5a051c3efa13da323413c8d913694d04f18c41 (diff)
downloadcoreboot-527f3923b0dc4a33b3be368107768792e09dc31e.tar.xz
build system: move compiler runtime determination to xcompile
Instead of fetching libgcc's location and required compiler flags on every individual build, do it once in xcompile. Change-Id: Ie5832fcb21710c4cf381ba475589d42ce0235f96 Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com> Reviewed-on: http://review.coreboot.org/10425 Tested-by: build bot (Jenkins) Reviewed-by: Edward O'Callaghan <edward.ocallaghan@koparo.com>
Diffstat (limited to 'util')
-rwxr-xr-xutil/xcompile/xcompile12
1 files changed, 12 insertions, 0 deletions
diff --git a/util/xcompile/xcompile b/util/xcompile/xcompile
index 94e0c19547..66b011a685 100755
--- a/util/xcompile/xcompile
+++ b/util/xcompile/xcompile
@@ -157,6 +157,11 @@ detect_special_flags() {
esac
}
+detect_compiler_runtime() {
+ CC_RT_CLANG="`${CLANG} ${CFLAGS} -print-librt-file-name`"
+ CC_RT_GCC="`${GCC} ${CFLAGS} -print-libgcc-file-name`"
+}
+
report_arch_toolchain() {
cat <<EOF
# elf${TWIDTH}-${TBFDARCH} toolchain (${GCC})
@@ -165,8 +170,12 @@ SUBARCH_SUPPORTED+=${TSUPP-${TARCH}}
ifeq (\$(CONFIG_COMPILER_GCC),y)
CC_${TARCH}:=${GCC}
CFLAGS_${TARCH}:=${CFLAGS_GCC}
+COMPILER_RT_${TARCH}:=${CC_RT_GCC}
+COMPILER_RT_FLAGS_${TARCH}:=${CC_RT_EXTRA_GCC}
else
CC_${TARCH}:=${CLANG}
+COMPILER_RT_${TARCH}:=${CC_RT_CLANG}
+COMPILER_RT_FLAGS_${TARCH}:=${CC_RT_EXTRA_CLANG}
endif
CPP_${TARCH}:=${GCCPREFIX}cpp
AS_${TARCH}:=${GCCPREFIX}as ${ASFLAGS}
@@ -217,6 +226,7 @@ arch_config_x86() {
TCLIST="i386 x86_64"
TWIDTH="32"
TABI="elf"
+ CC_RT_EXTRA_GCC="--wrap __divdi3 --wrap __udivdi3 --wrap __moddi3 --wrap __umoddi3"
}
arch_config_mipsel() {
@@ -235,6 +245,7 @@ test_architecture() {
GCCPREFIX="invalid"
unset TABI TARCH TBFDARCH TCLIST TENDIAN TSUPP TWIDTH
+ unset CC_RT_EXTRA_GCC CC_RT_EXTRA_CLANG
unset GCC CLANG
if type arch_config_$architecture > /dev/null; then
arch_config_$architecture
@@ -293,6 +304,7 @@ test_architecture() {
for architecture in $SUPPORTED_ARCHITECTURES; do
if test_architecture $architecture; then
detect_special_flags "$architecture"
+ detect_compiler_runtime "$architecture"
report_arch_toolchain
fi
done