diff --git a/toolchain.inc b/toolchain.inc index e089f2ee5f..8b7b30abf0 100644 --- a/toolchain.inc +++ b/toolchain.inc @@ -104,15 +104,8 @@ STRIP_$(1) := $(STRIP_$(2)) READELF_$(1) := $(READELF_$(2)) CFLAGS_$(1) = $$(CFLAGS_common) $$(CFLAGS_$(2)) CPPFLAGS_$(1) = $$(CPPFLAGS_common) $$(CPPFLAGS_$(2)) -COMPILER_RT_FLAGS_$(1) := -ifeq ($(CONFIG_COMPILER_LLVM_CLANG),y) -COMPILER_RT_$(1) := $(shell $(CC_$(2)) $(CFLAGS_$(2)) -print-librt-file-name 2>/dev/null) -else -COMPILER_RT_$(1) := $(wildcard $(shell $(CC_$(2)) $(CFLAGS_$(2)) -print-libgcc-file-name)) -ifeq ($(2),x86_32) -COMPILER_RT_FLAGS_$(1) := --wrap __divdi3 --wrap __udivdi3 --wrap __moddi3 --wrap __umoddi3 -endif -endif +COMPILER_RT_$(1) := $$(COMPILER_RT_$(2)) +COMPILER_RT_FLAGS_$(1) := $$(COMPILER_RT_FLAGS_$(2)) endef # define_class: Allows defining any program as dynamic class and compiler tool 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 < /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