diff options
| author | Saleem Abdulrasool <compnerd@compnerd.org> | 2017-05-15 19:09:13 +0000 |
|---|---|---|
| committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2017-05-15 19:09:13 +0000 |
| commit | 12588d76db3fb291405b42ba49568b76c6602ba0 (patch) | |
| tree | 7a9de86d4f6f2e0116522567dd5823ba895a28a9 /compiler-rt/lib/builtins | |
| parent | 2fecd38ab8c0a39514acdb35a482cb2e7a9eae99 (diff) | |
| download | bcm5719-llvm-12588d76db3fb291405b42ba49568b76c6602ba0.tar.gz bcm5719-llvm-12588d76db3fb291405b42ba49568b76c6602ba0.zip | |
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.
llvm-svn: 303103
Diffstat (limited to 'compiler-rt/lib/builtins')
| -rw-r--r-- | compiler-rt/lib/builtins/CMakeLists.txt | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt index 946b912ae25..df80a50444e 100644 --- a/compiler-rt/lib/builtins/CMakeLists.txt +++ b/compiler-rt/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}) |

