[PATCH] D26764: [compiler-rt] [cmake] Remove i686 target that is duplicate to i386

2018-04-10 Thread Julien Ramseier via Phabricator via cfe-commits
elram added a comment.
Herald added subscribers: llvm-commits, delcypher.

This patch breaks cross-compiling the builtins for i686, with 
COMPILER_RT_DEFAULT_TARGET_ONLY=YES.
CC is set to

  clang -target i686-linux-musl -m32 -march=i686

But no supported target is detected by cmake and nothing gets built.

  -- Builtin supported architectures:


Repository:
  rL LLVM

https://reviews.llvm.org/D26764



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D26764: [compiler-rt] [cmake] Remove i686 target that is duplicate to i386

2017-08-27 Thread Michał Górny via Phabricator via cfe-commits
mgorny updated this revision to Diff 112807.
mgorny added a comment.

I'm going to commit this now to see if it helps with the Android buildbot. 
Updating to the rebased patch that's going to be committed.


https://reviews.llvm.org/D26764

Files:
  cmake/Modules/CompilerRTUtils.cmake
  cmake/base-config-ix.cmake
  cmake/builtin-config-ix.cmake
  cmake/config-ix.cmake
  lib/asan/CMakeLists.txt
  lib/asan/scripts/asan_device_setup
  lib/builtins/CMakeLists.txt
  lib/ubsan/CMakeLists.txt
  test/asan/CMakeLists.txt
  test/asan/lit.cfg
  test/lit.common.cfg
  test/lsan/TestCases/Linux/use_tls_dynamic.cc
  test/sanitizer_common/lit.common.cfg
  test/scudo/random_shuffle.cpp

Index: test/scudo/random_shuffle.cpp
===
--- test/scudo/random_shuffle.cpp
+++ test/scudo/random_shuffle.cpp
@@ -7,7 +7,7 @@
 // RUN: %run %t 1 > %T/random_shuffle_tmp_dir/out2
 // RUN: not diff %T/random_shuffle_tmp_dir/out?
 // RUN: rm -rf %T/random_shuffle_tmp_dir
-// UNSUPPORTED: i386-linux,i686-linux,arm-linux,armhf-linux,aarch64-linux,mips-linux,mipsel-linux,mips64-linux,mips64el-linux
+// UNSUPPORTED: i386-linux,arm-linux,armhf-linux,aarch64-linux,mips-linux,mipsel-linux,mips64-linux,mips64el-linux
 
 // Tests that the allocator shuffles the chunks before returning to the user.
 
Index: test/sanitizer_common/lit.common.cfg
===
--- test/sanitizer_common/lit.common.cfg
+++ test/sanitizer_common/lit.common.cfg
@@ -26,7 +26,7 @@
 if config.target_arch not in ['arm', 'armhf', 'aarch64']:
   config.available_features.add('stable-runtime')
 
-if config.host_os == 'Linux' and config.tool_name == "lsan" and (config.target_arch == 'i386' or config.target_arch == 'i686'):
+if config.host_os == 'Linux' and config.tool_name == "lsan" and config.target_arch == 'i386':
   config.available_features.add("lsan-x86")
 
 if config.host_os == 'Darwin':
Index: test/lsan/TestCases/Linux/use_tls_dynamic.cc
===
--- test/lsan/TestCases/Linux/use_tls_dynamic.cc
+++ test/lsan/TestCases/Linux/use_tls_dynamic.cc
@@ -5,7 +5,7 @@
 // RUN: %env_lsan_opts=$LSAN_BASE:"use_tls=0" not %run %t 2>&1 | FileCheck %s
 // RUN: %env_lsan_opts=$LSAN_BASE:"use_tls=1" %run %t 2>&1
 // RUN: %env_lsan_opts="" %run %t 2>&1
-// UNSUPPORTED: i386-linux,i686-linux,arm
+// UNSUPPORTED: i386-linux,arm
 
 #ifndef BUILD_DSO
 #include 
Index: test/lit.common.cfg
===
--- test/lit.common.cfg
+++ test/lit.common.cfg
@@ -135,7 +135,7 @@
 target_arch = getattr(config, 'target_arch', None)
 if target_arch:
   config.available_features.add(target_arch + '-target-arch')
-  if target_arch in ['x86_64', 'i386', 'i686']:
+  if target_arch in ['x86_64', 'i386']:
 config.available_features.add('x86-target-arch')
   config.available_features.add(target_arch + '-' + config.host_os.lower())
 
Index: test/asan/lit.cfg
===
--- test/asan/lit.cfg
+++ test/asan/lit.cfg
@@ -121,16 +121,11 @@
 def build_invocation(compile_flags):
   return " " + " ".join([config.compile_wrapper, config.clang] + compile_flags) + " "
 
-# Clang driver link 'x86' (i686) architecture to 'i386'.
-target_arch = config.target_arch
-if (target_arch == "i686"):
-  target_arch = "i386"
-
 config.substitutions.append( ("%clang ", build_invocation(target_cflags)) )
 config.substitutions.append( ("%clangxx ", build_invocation(target_cxxflags)) )
 config.substitutions.append( ("%clang_asan ", build_invocation(clang_asan_cflags)) )
 config.substitutions.append( ("%clangxx_asan ", build_invocation(clang_asan_cxxflags)) )
-config.substitutions.append( ("%shared_libasan", "libclang_rt.asan-%s.so" % target_arch))
+config.substitutions.append( ("%shared_libasan", "libclang_rt.asan-%s.so" % config.target_arch))
 if config.asan_dynamic:
   config.substitutions.append( ("%clang_asan_static ", build_invocation(clang_asan_static_cflags)) )
   config.substitutions.append( ("%clangxx_asan_static ", build_invocation(clang_asan_static_cxxflags)) )
Index: test/asan/CMakeLists.txt
===
--- test/asan/CMakeLists.txt
+++ test/asan/CMakeLists.txt
@@ -18,7 +18,7 @@
 endif()
 
 macro(get_bits_for_arch arch bits)
-  if (${arch} MATCHES "i386|i686|arm|mips|mipsel")
+  if (${arch} MATCHES "i386|arm|mips|mipsel")
 set(${bits} 32)
   elseif (${arch} MATCHES "x86_64|powerpc64|powerpc64le|aarch64|mips64|mips64el|s390x")
 set(${bits} 64)
Index: lib/ubsan/CMakeLists.txt
===
--- lib/ubsan/CMakeLists.txt
+++ lib/ubsan/CMakeLists.txt
@@ -178,7 +178,7 @@
 
 if (UNIX)
   set(ARCHS_FOR_SYMBOLS ${UBSAN_SUPPORTED_ARCH})
-  list(REMOVE_ITEM ARCHS_FOR_SYMBOLS i386 i686)
+  list(REMOVE_ITEM ARCHS_FOR_SYMBOLS i386)
 

[PATCH] D26764: [compiler-rt] [cmake] Remove i686 target that is duplicate to i386

2017-08-27 Thread Michał Górny via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL311842: [cmake] Remove i686 target that is duplicate to i386 
(authored by mgorny).

Changed prior to commit:
  https://reviews.llvm.org/D26764?vs=112807&id=112808#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D26764

Files:
  compiler-rt/trunk/cmake/Modules/CompilerRTUtils.cmake
  compiler-rt/trunk/cmake/base-config-ix.cmake
  compiler-rt/trunk/cmake/builtin-config-ix.cmake
  compiler-rt/trunk/cmake/config-ix.cmake
  compiler-rt/trunk/lib/asan/CMakeLists.txt
  compiler-rt/trunk/lib/asan/scripts/asan_device_setup
  compiler-rt/trunk/lib/builtins/CMakeLists.txt
  compiler-rt/trunk/lib/ubsan/CMakeLists.txt
  compiler-rt/trunk/test/asan/CMakeLists.txt
  compiler-rt/trunk/test/asan/lit.cfg
  compiler-rt/trunk/test/lit.common.cfg
  compiler-rt/trunk/test/lsan/TestCases/Linux/use_tls_dynamic.cc
  compiler-rt/trunk/test/sanitizer_common/lit.common.cfg
  compiler-rt/trunk/test/scudo/random_shuffle.cpp

Index: compiler-rt/trunk/lib/builtins/CMakeLists.txt
===
--- compiler-rt/trunk/lib/builtins/CMakeLists.txt
+++ compiler-rt/trunk/lib/builtins/CMakeLists.txt
@@ -271,9 +271,6 @@
 i386/chkstk.S
 i386/chkstk2.S)
   endif()
-
-  set(i686_SOURCES
-  ${i386_SOURCES})
 else () # MSVC
   # Use C versions of functions when building on MSVC
   # MSVC's assembler takes Intel syntax, not AT&T syntax.
@@ -285,7 +282,6 @@
   ${GENERIC_SOURCES})
   set(x86_64h_SOURCES ${x86_64_SOURCES})
   set(i386_SOURCES ${GENERIC_SOURCES})
-  set(i686_SOURCES ${i386_SOURCES})
 endif () # if (NOT MSVC)
 
 set(arm_SOURCES
@@ -493,9 +489,7 @@
   # 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")
-  elseif("${arch}" STREQUAL "armv6m")
+  if("${arch}" STREQUAL "armv6m")
 set(_arch "arm|armv6m")
   elseif("${arch}" MATCHES "^(armhf|armv7|armv7s|armv7k|armv7m|armv7em)$")
 set(_arch "arm")
Index: compiler-rt/trunk/lib/asan/scripts/asan_device_setup
===
--- compiler-rt/trunk/lib/asan/scripts/asan_device_setup
+++ compiler-rt/trunk/lib/asan/scripts/asan_device_setup
@@ -95,7 +95,7 @@
 local _ARCH=
 local _ARCH64=
 if [[ $_ABI == x86* ]]; then
-_ARCH=i686
+_ARCH=i386
 elif [[ $_ABI == armeabi* ]]; then
 _ARCH=arm
 elif [[ $_ABI == arm64-v8a* ]]; then
Index: compiler-rt/trunk/lib/asan/CMakeLists.txt
===
--- compiler-rt/trunk/lib/asan/CMakeLists.txt
+++ compiler-rt/trunk/lib/asan/CMakeLists.txt
@@ -169,7 +169,7 @@
 PARENT_TARGET asan)
 
   foreach(arch ${ASAN_SUPPORTED_ARCH})
-if (UNIX AND NOT ${arch} MATCHES "i386|i686")
+if (UNIX AND NOT ${arch} STREQUAL "i386")
   add_sanitizer_rt_version_list(clang_rt.asan-dynamic-${arch}
 LIBS clang_rt.asan-${arch} clang_rt.asan_cxx-${arch}
 EXTRA asan.syms.extra)
@@ -218,7 +218,7 @@
   DEFS ${ASAN_DYNAMIC_DEFINITIONS}
   PARENT_TARGET asan)
 
-if (UNIX AND NOT ${arch} MATCHES "i386|i686")
+if (UNIX AND NOT ${arch} STREQUAL "i386")
   add_sanitizer_rt_symbols(clang_rt.asan_cxx
 ARCHS ${arch})
   add_dependencies(asan clang_rt.asan_cxx-${arch}-symbols)
Index: compiler-rt/trunk/lib/ubsan/CMakeLists.txt
===
--- compiler-rt/trunk/lib/ubsan/CMakeLists.txt
+++ compiler-rt/trunk/lib/ubsan/CMakeLists.txt
@@ -178,7 +178,7 @@
 
 if (UNIX)
   set(ARCHS_FOR_SYMBOLS ${UBSAN_SUPPORTED_ARCH})
-  list(REMOVE_ITEM ARCHS_FOR_SYMBOLS i386 i686)
+  list(REMOVE_ITEM ARCHS_FOR_SYMBOLS i386)
   add_sanitizer_rt_symbols(clang_rt.ubsan_standalone
 ARCHS ${ARCHS_FOR_SYMBOLS}
 PARENT_TARGET ubsan
Index: compiler-rt/trunk/cmake/config-ix.cmake
===
--- compiler-rt/trunk/cmake/config-ix.cmake
+++ compiler-rt/trunk/cmake/config-ix.cmake
@@ -174,7 +174,7 @@
 
 set(ARM64 aarch64)
 set(ARM32 arm armhf)
-set(X86 i386 i686)
+set(X86 i386)
 set(X86_64 x86_64)
 set(MIPS32 mips mipsel)
 set(MIPS64 mips64 mips64el)
Index: compiler-rt/trunk/cmake/base-config-ix.cmake
===
--- compiler-rt/trunk/cmake/base-config-ix.cmake
+++ compiler-rt/trunk/cmake/base-config-ix.cmake
@@ -139,10 +139,6 @@
 elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "i[2-6]86|x86|amd64")
   if(NOT MSVC)
 test_target_arch(x86_64 "" "-m64")
-# FIXME: We build runtimes for both i686 and i386, as "clang -m32" may
-# target different variant than "$CMAKE_C_COMPILER -m32". This part should
- 

[PATCH] D26764: [compiler-rt] [cmake] Remove i686 target that is duplicate to i386

2017-08-27 Thread Michał Górny via Phabricator via cfe-commits
mgorny reopened this revision.
mgorny added a comment.
This revision is now accepted and ready to land.

I have reverted the changes for now to fix Android.


Repository:
  rL LLVM

https://reviews.llvm.org/D26764



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D26764: [compiler-rt] [cmake] Remove i686 target that is duplicate to i386

2017-08-28 Thread Michał Górny via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL311924: Reland r311842 - [cmake] Remove i686 target that is 
duplicate to i386 (authored by mgorny).

Repository:
  rL LLVM

https://reviews.llvm.org/D26764

Files:
  compiler-rt/trunk/cmake/Modules/CompilerRTUtils.cmake
  compiler-rt/trunk/cmake/base-config-ix.cmake
  compiler-rt/trunk/cmake/builtin-config-ix.cmake
  compiler-rt/trunk/cmake/config-ix.cmake
  compiler-rt/trunk/lib/asan/CMakeLists.txt
  compiler-rt/trunk/lib/asan/scripts/asan_device_setup
  compiler-rt/trunk/lib/builtins/CMakeLists.txt
  compiler-rt/trunk/lib/ubsan/CMakeLists.txt
  compiler-rt/trunk/test/asan/CMakeLists.txt
  compiler-rt/trunk/test/asan/lit.cfg
  compiler-rt/trunk/test/lit.common.cfg
  compiler-rt/trunk/test/lsan/TestCases/Linux/use_tls_dynamic.cc
  compiler-rt/trunk/test/sanitizer_common/lit.common.cfg
  compiler-rt/trunk/test/scudo/random_shuffle.cpp

Index: compiler-rt/trunk/cmake/builtin-config-ix.cmake
===
--- compiler-rt/trunk/cmake/builtin-config-ix.cmake
+++ compiler-rt/trunk/cmake/builtin-config-ix.cmake
@@ -25,7 +25,8 @@
 
 set(ARM64 aarch64)
 set(ARM32 arm armhf armv6m armv7m armv7em armv7 armv7s armv7k)
-set(X86 i386 i686)
+set(ARM32 arm armhf)
+set(X86 i386)
 set(X86_64 x86_64)
 set(MIPS32 mips mipsel)
 set(MIPS64 mips64 mips64el)
Index: compiler-rt/trunk/cmake/config-ix.cmake
===
--- compiler-rt/trunk/cmake/config-ix.cmake
+++ compiler-rt/trunk/cmake/config-ix.cmake
@@ -174,7 +174,7 @@
 
 set(ARM64 aarch64)
 set(ARM32 arm armhf)
-set(X86 i386 i686)
+set(X86 i386)
 set(X86_64 x86_64)
 set(MIPS32 mips mipsel)
 set(MIPS64 mips64 mips64el)
Index: compiler-rt/trunk/cmake/base-config-ix.cmake
===
--- compiler-rt/trunk/cmake/base-config-ix.cmake
+++ compiler-rt/trunk/cmake/base-config-ix.cmake
@@ -139,10 +139,6 @@
 elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "i[2-6]86|x86|amd64")
   if(NOT MSVC)
 test_target_arch(x86_64 "" "-m64")
-# FIXME: We build runtimes for both i686 and i386, as "clang -m32" may
-# target different variant than "$CMAKE_C_COMPILER -m32". This part should
-# be gone after we resolve PR14109.
-test_target_arch(i686 __i686__ "-m32")
 test_target_arch(i386 __i386__ "-m32")
   else()
 if (CMAKE_SIZEOF_VOID_P EQUAL 4)
Index: compiler-rt/trunk/cmake/Modules/CompilerRTUtils.cmake
===
--- compiler-rt/trunk/cmake/Modules/CompilerRTUtils.cmake
+++ compiler-rt/trunk/cmake/Modules/CompilerRTUtils.cmake
@@ -163,7 +163,6 @@
   check_symbol_exists(__arm__ "" __ARM)
   check_symbol_exists(__aarch64__ "" __AARCH64)
   check_symbol_exists(__x86_64__ "" __X86_64)
-  check_symbol_exists(__i686__ "" __I686)
   check_symbol_exists(__i386__ "" __I386)
   check_symbol_exists(__mips__ "" __MIPS)
   check_symbol_exists(__mips64__ "" __MIPS64)
@@ -176,8 +175,6 @@
 add_default_target_arch(aarch64)
   elseif(__X86_64)
 add_default_target_arch(x86_64)
-  elseif(__I686)
-add_default_target_arch(i686)
   elseif(__I386)
 add_default_target_arch(i386)
   elseif(__MIPS64) # must be checked before __MIPS
Index: compiler-rt/trunk/test/asan/CMakeLists.txt
===
--- compiler-rt/trunk/test/asan/CMakeLists.txt
+++ compiler-rt/trunk/test/asan/CMakeLists.txt
@@ -18,7 +18,7 @@
 endif()
 
 macro(get_bits_for_arch arch bits)
-  if (${arch} MATCHES "i386|i686|arm|mips|mipsel")
+  if (${arch} MATCHES "i386|arm|mips|mipsel")
 set(${bits} 32)
   elseif (${arch} MATCHES "x86_64|powerpc64|powerpc64le|aarch64|mips64|mips64el|s390x")
 set(${bits} 64)
Index: compiler-rt/trunk/test/asan/lit.cfg
===
--- compiler-rt/trunk/test/asan/lit.cfg
+++ compiler-rt/trunk/test/asan/lit.cfg
@@ -121,16 +121,11 @@
 def build_invocation(compile_flags):
   return " " + " ".join([config.compile_wrapper, config.clang] + compile_flags) + " "
 
-# Clang driver link 'x86' (i686) architecture to 'i386'.
-target_arch = config.target_arch
-if (target_arch == "i686"):
-  target_arch = "i386"
-
 config.substitutions.append( ("%clang ", build_invocation(target_cflags)) )
 config.substitutions.append( ("%clangxx ", build_invocation(target_cxxflags)) )
 config.substitutions.append( ("%clang_asan ", build_invocation(clang_asan_cflags)) )
 config.substitutions.append( ("%clangxx_asan ", build_invocation(clang_asan_cxxflags)) )
-config.substitutions.append( ("%shared_libasan", "libclang_rt.asan-%s.so" % target_arch))
+config.substitutions.append( ("%shared_libasan", "libclang_rt.asan-%s.so" % config.target_arch))
 if config.asan_dynamic:
   config.substitutions.append( ("%clang_asan_static ", build_invocation(clang_asan_

[PATCH] D26764: [compiler-rt] [cmake] Remove i686 target that is duplicate to i386

2017-08-29 Thread Hans Wennborg via Phabricator via cfe-commits
hans added inline comments.



Comment at: compiler-rt/trunk/lib/asan/scripts/asan_device_setup:98
 if [[ $_ABI == x86* ]]; then
-_ARCH=i686
+_ARCH=i386
 elif [[ $_ABI == armeabi* ]]; then

There are lots of copies of this script in various project that now all need to 
be updated (searching the web for asan_device_setup shows some).

For me personally, this means updating Chromium (also the build system needs an 
update) to handle different names before and after this revision.

Do you have any suggestions for how we should handle this rename? Is there some 
backwards-compatibility fix we could do?

As you noticed this broke some LLVM buildbots. It also broke Chromium 
buildbots, and I suppose other projects which use asan. I'm wondering if the 
fallout is worth the benefits here.


Repository:
  rL LLVM

https://reviews.llvm.org/D26764



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D26764: [compiler-rt] [cmake] Remove i686 target that is duplicate to i386

2017-08-29 Thread Evgenii Stepanov via Phabricator via cfe-commits
eugenis added a comment.

I may have underestimated the number of places that will need to be patched 
because of this change. Perhaps we should restore the special case in the 
android library name?


Repository:
  rL LLVM

https://reviews.llvm.org/D26764



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D26764: [compiler-rt] [cmake] Remove i686 target that is duplicate to i386

2017-08-29 Thread Michał Górny via Phabricator via cfe-commits
mgorny added a comment.

I'm happy to help with whatever needs to be done to keep breakage to the 
minimum, provided that we determine some clear path forward that doesn't 
involve regressing to the half-broken state for non-Android Linux systems and 
it's doable in the free time I can spare. However, I should point out that it 
was a very bad idea to hardcode paths all over the projects in the first place.


Repository:
  rL LLVM

https://reviews.llvm.org/D26764



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D26764: [compiler-rt] [cmake] Remove i686 target that is duplicate to i386

2017-08-29 Thread Evgenii Stepanov via Phabricator via cfe-commits
eugenis added a comment.

IMHO it was a very bad idea to include the "architecture name" (not even a 
target triple!) in the library path in the first place. No one else does that. 
GCC made the right choice and called theirs "libasan.so".

My plan is to tweak the code that sets the library name to use i686 when the 
target is i386 and the os is android, both in compiler-rt and in clang. There 
will be no duplicate targets.


Repository:
  rL LLVM

https://reviews.llvm.org/D26764



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D26764: [compiler-rt] [cmake] Remove i686 target that is duplicate to i386

2017-08-29 Thread Hans Wennborg via Phabricator via cfe-commits
hans added a comment.

In https://reviews.llvm.org/D26764#855791, @eugenis wrote:

> IMHO it was a very bad idea to include the "architecture name" (not even a 
> target triple!) in the library path in the first place. No one else does 
> that. GCC made the right choice and called theirs "libasan.so".
>
> My plan is to tweak the code that sets the library name to use i686 when the 
> target is i386 and the os is android, both in compiler-rt and in clang. There 
> will be no duplicate targets.


Sounds good to me. Let me know if you think this will take a while and we 
should revert to green in the meantime.


Repository:
  rL LLVM

https://reviews.llvm.org/D26764



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D26764: [compiler-rt] [cmake] Remove i686 target that is duplicate to i386

2017-08-29 Thread Evgenii Stepanov via Phabricator via cfe-commits
eugenis added a comment.

I've landed the android special case in r312048


Repository:
  rL LLVM

https://reviews.llvm.org/D26764



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D26764: [compiler-rt] [cmake] Remove i686 target that is duplicate to i386

2017-08-29 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added a comment.

In https://reviews.llvm.org/D26764#855791, @eugenis wrote:

> IMHO it was a very bad idea to include the "architecture name" (not even a 
> target triple!) in the library path in the first place. No one else does 
> that. GCC made the right choice and called theirs "libasan.so".


+1, one day we should untangle the compiler-rt library names.

> My plan is to tweak the code that sets the library name to use i686 when the 
> target is i386 and the os is android, both in compiler-rt and in clang. There 
> will be no duplicate targets.




Repository:
  rL LLVM

https://reviews.llvm.org/D26764



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D26764: [compiler-rt] [cmake] Remove i686 target that is duplicate to i386

2016-12-29 Thread Michał Górny via Phabricator via cfe-commits
mgorny added a comment.

Ping. @eugenis, do you consider it good to go then? Or do you want me to change 
something specifically?


https://reviews.llvm.org/D26764



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D26764: [compiler-rt] [cmake] Remove i686 target that is duplicate to i386

2016-12-29 Thread Evgeniy Stepanov via Phabricator via cfe-commits
eugenis accepted this revision.
eugenis added a comment.
This revision is now accepted and ready to land.

LGTM


https://reviews.llvm.org/D26764



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D26764: [compiler-rt] [cmake] Remove i686 target that is duplicate to i386

2016-11-16 Thread Michał Górny via cfe-commits
mgorny created this revision.
mgorny added reviewers: samsonov, etienneb, beanz.
mgorny added a subscriber: cfe-commits.
Herald added subscribers: dberris, kubabrecka.

Remove the explicit i686 target that is completely duplicate to
the i386 target, with the latter being used more commonly.

1. The runtime built for i686 will be identical to the one built for

i386.

2. Supporting both -i386 and -i686 suffixes causes unnecessary confusion

on the clang end which has to expect either of them.

3. The checks are based on wrong assumption that __i686__ is defined for

all newer x86 CPUs. In fact, it is only declared when -march=i686 is
explicitly used. It is not available when a more specific (or newer)
-march is used.

Curious enough, if CFLAGS contain -march=i686, the runtime will be built
both for i386 and i686. For any other value, only i386 variant will be
built.


https://reviews.llvm.org/D26764

Files:
  cmake/Modules/CompilerRTUtils.cmake
  cmake/base-config-ix.cmake
  cmake/builtin-config-ix.cmake
  cmake/config-ix.cmake
  lib/asan/CMakeLists.txt
  lib/asan/scripts/asan_device_setup
  lib/builtins/CMakeLists.txt
  lib/ubsan/CMakeLists.txt
  test/asan/CMakeLists.txt
  test/asan/lit.cfg
  test/lit.common.cfg

Index: test/lit.common.cfg
===
--- test/lit.common.cfg
+++ test/lit.common.cfg
@@ -105,7 +105,7 @@
 target_arch = getattr(config, 'target_arch', None)
 if target_arch:
   config.available_features.add(target_arch + '-target-arch')
-  if target_arch in ['x86_64', 'i386', 'i686']:
+  if target_arch in ['x86_64', 'i386']:
 config.available_features.add('x86-target-arch')
   config.available_features.add(target_arch + '-' + config.host_os.lower())
 
Index: test/asan/lit.cfg
===
--- test/asan/lit.cfg
+++ test/asan/lit.cfg
@@ -116,16 +116,11 @@
 def build_invocation(compile_flags):
   return " " + " ".join([clang_wrapper, config.clang] + compile_flags) + " "
 
-# Clang driver link 'x86' (i686) architecture to 'i386'.
-target_arch = config.target_arch
-if (target_arch == "i686"):
-  target_arch = "i386"
-
 config.substitutions.append( ("%clang ", build_invocation(target_cflags)) )
 config.substitutions.append( ("%clangxx ", build_invocation(target_cxxflags)) )
 config.substitutions.append( ("%clang_asan ", build_invocation(clang_asan_cflags)) )
 config.substitutions.append( ("%clangxx_asan ", build_invocation(clang_asan_cxxflags)) )
-config.substitutions.append( ("%shared_libasan", "libclang_rt.asan-%s.so" % target_arch))
+config.substitutions.append( ("%shared_libasan", "libclang_rt.asan-%s.so" % config.target_arch))
 if config.asan_dynamic:
   config.substitutions.append( ("%clang_asan_static ", build_invocation(clang_asan_static_cflags)) )
   config.substitutions.append( ("%clangxx_asan_static ", build_invocation(clang_asan_static_cxxflags)) )
Index: test/asan/CMakeLists.txt
===
--- test/asan/CMakeLists.txt
+++ test/asan/CMakeLists.txt
@@ -10,7 +10,7 @@
 endif()
 
 macro(get_bits_for_arch arch bits)
-  if (${arch} MATCHES "i386|i686|arm|mips|mipsel")
+  if (${arch} MATCHES "i386|arm|mips|mipsel")
 set(${bits} 32)
   elseif (${arch} MATCHES "x86_64|powerpc64|powerpc64le|aarch64|mips64|mips64el|s390x")
 set(${bits} 64)
Index: lib/ubsan/CMakeLists.txt
===
--- lib/ubsan/CMakeLists.txt
+++ lib/ubsan/CMakeLists.txt
@@ -112,7 +112,7 @@
 
 if (UNIX)
   set(ARCHS_FOR_SYMBOLS ${UBSAN_SUPPORTED_ARCH})
-  list(REMOVE_ITEM ARCHS_FOR_SYMBOLS i386 i686)
+  list(REMOVE_ITEM ARCHS_FOR_SYMBOLS i386)
   add_sanitizer_rt_symbols(clang_rt.ubsan_standalone
 ARCHS ${ARCHS_FOR_SYMBOLS}
 PARENT_TARGET ubsan
Index: lib/builtins/CMakeLists.txt
===
--- lib/builtins/CMakeLists.txt
+++ lib/builtins/CMakeLists.txt
@@ -251,9 +251,6 @@
 i386/chkstk.S
 i386/chkstk2.S)
   endif()
-
-  set(i686_SOURCES
-  ${i386_SOURCES})
 else () # MSVC
   # Use C versions of functions when building on MSVC
   # MSVC's assembler takes Intel syntax, not AT&T syntax.
@@ -265,7 +262,6 @@
   ${MSVC_SOURCES})
   set(x86_64h_SOURCES ${x86_64_SOURCES})
   set(i386_SOURCES ${MSVC_SOURCES})
-  set(i686_SOURCES ${i386_SOURCES})
 endif () # if (NOT MSVC)
 
 set(arm_SOURCES
Index: lib/asan/scripts/asan_device_setup
===
--- lib/asan/scripts/asan_device_setup
+++ lib/asan/scripts/asan_device_setup
@@ -95,7 +95,7 @@
 local _ARCH=
 local _ARCH64=
 if [[ $_ABI == x86* ]]; then
-_ARCH=i686
+_ARCH=i386
 elif [[ $_ABI == armeabi* ]]; then
 _ARCH=arm
 elif [[ $_ABI == arm64-v8a* ]]; then
Index: lib/asan/CMakeLists.txt
=

[PATCH] D26764: [compiler-rt] [cmake] Remove i686 target that is duplicate to i386

2016-11-28 Thread Michał Górny via Phabricator via cfe-commits
mgorny added a comment.

Ping.


https://reviews.llvm.org/D26764



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D26764: [compiler-rt] [cmake] Remove i686 target that is duplicate to i386

2016-11-28 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a reviewer: eugenis.
beanz added a subscriber: eugenis.
beanz added a comment.

Looping in @eugenis, who added i686 support in r218761.

eugenis, since i686 is identical to i386 generating it as a separate target is 
undesirable. Can you help advise as to how we can better meet your needs and 
not duplicate an effectively identical target?


https://reviews.llvm.org/D26764



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D26764: [compiler-rt] [cmake] Remove i686 target that is duplicate to i386

2016-11-28 Thread Michał Górny via Phabricator via cfe-commits
mgorny added a comment.

In https://reviews.llvm.org/D26764#606638, @beanz wrote:

> Looping in @eugenis, who added i686 support in r218761.
>
> eugenis, since i686 is identical to i386 generating it as a separate target 
> is undesirable. Can you help advise as to how we can better meet your needs 
> and not duplicate an effectively identical target?


I suspect https://reviews.llvm.org/D26796 attempts to solve the same problem.


https://reviews.llvm.org/D26764



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D26764: [compiler-rt] [cmake] Remove i686 target that is duplicate to i386

2016-11-28 Thread Evgeniy Stepanov via Phabricator via cfe-commits
eugenis added a comment.

I think this is the right move together with https://reviews.llvm.org/D26796.
Android build system will need to support both names for some time, depending 
on the toolchain version - looks doable. Technically, it can stick with the old 
name forever.


https://reviews.llvm.org/D26764



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits