diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt --- a/compiler-rt/lib/builtins/CMakeLists.txt +++ b/compiler-rt/lib/builtins/CMakeLists.txt @@ -38,6 +38,10 @@ include(builtin-config-ix) +# Pass an empty list to filter_builtin_sources to disable part of its filtering +# logic. +set(NOTHING_TO_EXCLUDE "") + # TODO: Need to add a mechanism for logging errors when builtin source files are # added to a sub-directory and not this CMakeLists file. set(GENERIC_SOURCES @@ -260,7 +264,9 @@ if (NOT MSVC) set(x86_64_SOURCES + ${GENERIC_SOURCES} ${GENERIC_TF_SOURCES} + ${x86_ARCH_SOURCES} x86_64/floatdidf.c x86_64/floatdisf.c x86_64/floatdixf.c @@ -268,8 +274,10 @@ x86_64/floatundisf.S x86_64/floatundixf.S ) - filter_builtin_sources(x86_64_SOURCES EXCLUDE x86_64_SOURCES "${x86_64_SOURCES};${GENERIC_SOURCES}") + + # Darwin x86_64 Haswell set(x86_64h_SOURCES ${x86_64_SOURCES}) + filter_builtin_sources(x86_64h_SOURCES EXCLUDE NOTHING_TO_EXCLUDE "${x86_64h_SOURCES}") if (WIN32) set(x86_64_SOURCES @@ -280,6 +288,8 @@ endif() set(i386_SOURCES + ${GENERIC_SOURCES} + ${x86_ARCH_SOURCES} i386/ashldi3.S i386/ashrdi3.S i386/divdi3.S @@ -295,7 +305,6 @@ i386/udivdi3.S i386/umoddi3.S ) - filter_builtin_sources(i386_SOURCES EXCLUDE i386_SOURCES "${i386_SOURCES};${GENERIC_SOURCES}") if (WIN32) set(i386_SOURCES @@ -309,19 +318,19 @@ # MSVC's assembler takes Intel syntax, not AT&T syntax. # Also use only MSVC compilable builtin implementations. set(x86_64_SOURCES + ${GENERIC_SOURCES} + ${x86_ARCH_SOURCES} x86_64/floatdidf.c x86_64/floatdisf.c x86_64/floatdixf.c - ${GENERIC_SOURCES} ) - set(x86_64h_SOURCES ${x86_64_SOURCES}) - set(i386_SOURCES ${GENERIC_SOURCES}) + set(i386_SOURCES ${GENERIC_SOURCES} ${x86_ARCH_SOURCES}) endif () # if (NOT MSVC) -set(x86_64h_SOURCES ${x86_64h_SOURCES} ${x86_ARCH_SOURCES}) -set(x86_64_SOURCES ${x86_64_SOURCES} ${x86_ARCH_SOURCES}) -set(i386_SOURCES ${i386_SOURCES} ${x86_ARCH_SOURCES}) -set(i686_SOURCES ${i686_SOURCES} ${x86_ARCH_SOURCES}) +# TODO: These filter_builtin_sources calls seem redundant with the +# generic-vs-arch-specific handling at the end of this file. +filter_builtin_sources(x86_64_SOURCES EXCLUDE NOTHING_TO_EXCLUDE "${x86_64_SOURCES}") +filter_builtin_sources(i386_SOURCES EXCLUDE NOTHING_TO_EXCLUDE "${i386_SOURCES}") set(arm_SOURCES arm/fp_mode.c @@ -356,8 +365,9 @@ arm/udivmodsi4.S arm/udivsi3.S arm/umodsi3.S + ${GENERIC_SOURCES} ) -filter_builtin_sources(arm_SOURCES EXCLUDE arm_SOURCES "${arm_SOURCES};${GENERIC_SOURCES}") +filter_builtin_sources(arm_SOURCES EXCLUDE NOTHING_TO_EXCLUDE "${arm_SOURCES}") set(thumb1_SOURCES arm/divsi3.S @@ -451,8 +461,9 @@ arm/aeabi_uldivmod.S arm/chkstk.S mingw_fixfloat.c + ${GENERIC_SOURCES} ) - filter_builtin_sources(arm_SOURCES EXCLUDE arm_SOURCES "${arm_SOURCES};${GENERIC_SOURCES}") + filter_builtin_sources(arm_SOURCES EXCLUDE NOTHING_TO_EXCLUDE "${arm_SOURCES}") elseif(NOT WIN32) # TODO the EABI sources should only be added to EABI targets set(arm_SOURCES