summaryrefslogtreecommitdiff
path: root/lib/builtins/CMakeLists.txt
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2017-05-15 19:09:13 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2017-05-15 19:09:13 +0000
commit80a73416a2949684dda1dba5e7a3ffb253e0eabf (patch)
treece4604158ef411dd7573d370392a7187a2b69b42 /lib/builtins/CMakeLists.txt
parent0479fb714d0d780fadf6cdac65f993d2bb876664 (diff)
builtins: fix filtering aliased targets
Some build targets (e.g. i686) have aliased names (e.g. i386). We would get multiple definitions previously and have the linker arbitrarily select a definition on those aliased targets. Make this more deterministic by checking those aliases. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@303103 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/builtins/CMakeLists.txt')
-rw-r--r--lib/builtins/CMakeLists.txt9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/builtins/CMakeLists.txt b/lib/builtins/CMakeLists.txt
index 946b912ae..df80a5044 100644
--- a/lib/builtins/CMakeLists.txt
+++ b/lib/builtins/CMakeLists.txt
@@ -483,11 +483,18 @@ else ()
foreach (arch ${BUILTIN_SUPPORTED_ARCH})
if (CAN_TARGET_${arch})
+ # NOTE: some architectures (e.g. i386) have multiple names. Ensure that
+ # we catch them all.
+ set(_arch ${arch})
+ if("${arch}" STREQUAL "i686")
+ set(_arch "i386|i686")
+ endif()
+
# Filter out generic versions of routines that are re-implemented in
# architecture specific manner. This prevents multiple definitions of the
# same symbols, making the symbol selection non-deterministic.
foreach (_file ${${arch}_SOURCES})
- if (${_file} MATCHES ${arch}/*)
+ if (${_file} MATCHES ${_arch}/*)
get_filename_component(_name ${_file} NAME)
string(REPLACE ".S" ".c" _cname "${_name}")
list(REMOVE_ITEM ${arch}_SOURCES ${_cname})