diff options
author | Nico Weber <nicolasweber@gmx.de> | 2019-07-31 17:08:34 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2019-07-31 17:08:34 +0000 |
commit | e4001bacc2c62e16b03ead066043228fea77a8d7 (patch) | |
tree | 28f8e6a991bd7b74e3d4343c337c7cce6baf7e9c | |
parent | 435cdecdf721e39ec3b732f0affde970eadac525 (diff) | |
download | bcm5719-llvm-e4001bacc2c62e16b03ead066043228fea77a8d7.tar.gz bcm5719-llvm-e4001bacc2c62e16b03ead066043228fea77a8d7.zip |
gn build: Fix redundant object files in builtin lib.
compiler-rt's builtin library has generic implementations of many
functions, and then per-arch optimized implementations of some.
In the CMake build, both filter_builtin_sources() and an explicit loop
at the end of the build file (see D37166) filter out the generic
versions if a per-arch file is present.
The GN build wasn't doing this filtering. Just do the filtering manually
and explicitly, instead of being clever.
While here, also remove files from the mingw/arm build that are
redundantly listed after D39938 / r318139 (both from the CMake and the
GN build).
While here, also fix a target_os -> target_cpu typo.
Differential Revision: https://reviews.llvm.org/D65512
llvm-svn: 367448
-rw-r--r-- | compiler-rt/lib/builtins/CMakeLists.txt | 18 | ||||
-rw-r--r-- | llvm/utils/gn/secondary/compiler-rt/lib/builtins/BUILD.gn | 126 |
2 files changed, 73 insertions, 71 deletions
diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt index 320ff58d3d3..4062efcb359 100644 --- a/compiler-rt/lib/builtins/CMakeLists.txt +++ b/compiler-rt/lib/builtins/CMakeLists.txt @@ -431,25 +431,7 @@ if(MINGW) arm/aeabi_uidivmod.S arm/aeabi_uldivmod.S arm/chkstk.S - divmoddi4.c - divmodsi4.c - divdi3.c - divsi3.c - fixdfdi.c - fixsfdi.c - fixunsdfdi.c - fixunssfdi.c - floatdidf.c - floatdisf.c - floatundidf.c - floatundisf.c mingw_fixfloat.c - moddi3.c - udivmoddi4.c - udivmodsi4.c - udivsi3.c - umoddi3.c - emutls.c ) filter_builtin_sources(arm_SOURCES EXCLUDE arm_SOURCES "${arm_SOURCES};${GENERIC_SOURCES}") elseif(NOT WIN32) diff --git a/llvm/utils/gn/secondary/compiler-rt/lib/builtins/BUILD.gn b/llvm/utils/gn/secondary/compiler-rt/lib/builtins/BUILD.gn index 4772a519540..9af7d6b3845 100644 --- a/llvm/utils/gn/secondary/compiler-rt/lib/builtins/BUILD.gn +++ b/llvm/utils/gn/secondary/compiler-rt/lib/builtins/BUILD.gn @@ -201,7 +201,23 @@ static_library("builtins") { "powixf2.c", ] } - if (target_os == "x86") { + if (target_cpu == "x86") { + sources -= [ + "ashldi3.c", + "ashrdi3.c", + "divdi3.c", + "floatdidf.c", + "floatdisf.c", + "floatdixf.c", + "floatundidf.c", + "floatundisf.c", + "floatundixf.c", + "lshrdi3.c", + "moddi3.c", + "muldi3.c", + "udivdi3.c", + "umoddi3.c", + ] sources += [ "i386/ashldi3.S", "i386/ashrdi3.S", @@ -225,6 +241,14 @@ static_library("builtins") { ] } } else if (target_cpu == "x64") { + sources -= [ + "floatdidf.c", + "floatdisf.c", + "floatdixf.c", + "floatundidf.c", + "floatundisf.c", + "floatundixf.c", + ] sources += [ "x86_64/floatdidf.c", "x86_64/floatdisf.c", @@ -242,65 +266,61 @@ static_library("builtins") { } if (target_cpu == "arm") { - sources += [ - "arm/bswapdi2.S", - "arm/bswapsi2.S", - "arm/clzdi2.S", - "arm/clzsi2.S", - "arm/comparesf2.S", - "arm/divmodsi4.S", - "arm/divsi3.S", - "arm/modsi3.S", - "arm/sync_fetch_and_add_4.S", - "arm/sync_fetch_and_add_8.S", - "arm/sync_fetch_and_and_4.S", - "arm/sync_fetch_and_and_8.S", - "arm/sync_fetch_and_max_4.S", - "arm/sync_fetch_and_max_8.S", - "arm/sync_fetch_and_min_4.S", - "arm/sync_fetch_and_min_8.S", - "arm/sync_fetch_and_nand_4.S", - "arm/sync_fetch_and_nand_8.S", - "arm/sync_fetch_and_or_4.S", - "arm/sync_fetch_and_or_8.S", - "arm/sync_fetch_and_sub_4.S", - "arm/sync_fetch_and_sub_8.S", - "arm/sync_fetch_and_umax_4.S", - "arm/sync_fetch_and_umax_8.S", - "arm/sync_fetch_and_umin_4.S", - "arm/sync_fetch_and_umin_8.S", - "arm/sync_fetch_and_xor_4.S", - "arm/sync_fetch_and_xor_8.S", - "arm/udivmodsi4.S", - "arm/udivsi3.S", - "arm/umodsi3.S", - ] - if (target_os == "mingw") { + if (target_os != "mingw") { + sources -= [ + "bswapdi2.c", + "bswapsi2.c", + "clzdi2.c", + "clzsi2.c", + "comparesf2.c", + "divmodsi4.c", + "divsi3.c", + "modsi3.c", + "udivmodsi4.c", + "udivsi3.c", + "umodsi3.c", + ] + sources += [ + "arm/bswapdi2.S", + "arm/bswapsi2.S", + "arm/clzdi2.S", + "arm/clzsi2.S", + "arm/comparesf2.S", + "arm/divmodsi4.S", + "arm/divsi3.S", + "arm/modsi3.S", + "arm/sync_fetch_and_add_4.S", + "arm/sync_fetch_and_add_8.S", + "arm/sync_fetch_and_and_4.S", + "arm/sync_fetch_and_and_8.S", + "arm/sync_fetch_and_max_4.S", + "arm/sync_fetch_and_max_8.S", + "arm/sync_fetch_and_min_4.S", + "arm/sync_fetch_and_min_8.S", + "arm/sync_fetch_and_nand_4.S", + "arm/sync_fetch_and_nand_8.S", + "arm/sync_fetch_and_or_4.S", + "arm/sync_fetch_and_or_8.S", + "arm/sync_fetch_and_sub_4.S", + "arm/sync_fetch_and_sub_8.S", + "arm/sync_fetch_and_umax_4.S", + "arm/sync_fetch_and_umax_8.S", + "arm/sync_fetch_and_umin_4.S", + "arm/sync_fetch_and_umin_8.S", + "arm/sync_fetch_and_xor_4.S", + "arm/sync_fetch_and_xor_8.S", + "arm/udivmodsi4.S", + "arm/udivsi3.S", + "arm/umodsi3.S", + ] + } else { sources += [ "arm/aeabi_idivmod.S", "arm/aeabi_ldivmod.S", "arm/aeabi_uidivmod.S", "arm/aeabi_uldivmod.S", "arm/chkstk.S", - "divdi3.c", - "divmoddi4.c", - "divmodsi4.c", - "divsi3.c", - "emutls.c", - "fixdfdi.c", - "fixsfdi.c", - "fixunsdfdi.c", - "fixunssfdi.c", - "floatdidf.c", - "floatdisf.c", - "floatundidf.c", - "floatundisf.c", "mingw_fixfloat.c", - "moddi3.c", - "udivmoddi4.c", - "udivmodsi4.c", - "udivsi3.c", - "umoddi3.c", ] } } |