[compiler-rt] r208947 - InstrProf: Create a PIC version of the profile runtime

Duncan P. N. Exon Smith dexonsmith at apple.com
Thu May 15 21:07:09 PDT 2014


Author: dexonsmith
Date: Thu May 15 23:07:09 2014
New Revision: 208947

URL: http://llvm.org/viewvc/llvm-project?rev=208947&view=rev
Log:
InstrProf: Create a PIC version of the profile runtime

These tests were XPASS-ing on Linux bots creating Mach-O, which makes
sense, since the real difference is the object format.

I'm hoping a short-term fix to get these tests passing on ELF is to
create two copies of the runtime -- one built with -fPIC, and one
without.  A follow-up patch will change clang's driver to pick between
them depending on whether `-shared` is specified.

Modified:
    compiler-rt/trunk/lib/profile/CMakeLists.txt
    compiler-rt/trunk/test/profile/instrprof-dynamic-one-shared.test
    compiler-rt/trunk/test/profile/instrprof-dynamic-two-shared.test

Modified: compiler-rt/trunk/lib/profile/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/CMakeLists.txt?rev=208947&r1=208946&r2=208947&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/profile/CMakeLists.txt Thu May 15 23:07:09 2014
@@ -19,6 +19,11 @@ else()
     add_compiler_rt_runtime(clang_rt.profile-${arch} ${arch} STATIC
       SOURCES ${PROFILE_SOURCES})
     add_dependencies(profile clang_rt.profile-${arch})
+
+    add_compiler_rt_runtime(clang_rt.profile-pic-${arch} ${arch} STATIC
+      CFLAGS -fPIC
+      SOURCES ${PROFILE_SOURCES})
+    add_dependencies(profile clang_rt.profile-pic-${arch})
   endforeach()
 endif()
 

Modified: compiler-rt/trunk/test/profile/instrprof-dynamic-one-shared.test
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/profile/instrprof-dynamic-one-shared.test?rev=208947&r1=208946&r2=208947&view=diff
==============================================================================
--- compiler-rt/trunk/test/profile/instrprof-dynamic-one-shared.test (original)
+++ compiler-rt/trunk/test/profile/instrprof-dynamic-one-shared.test Thu May 15 23:07:09 2014
@@ -1,5 +1,3 @@
-XFAIL: linux, android
-
 RUN: mkdir -p %t.d
 RUN: %clang_profgen -o %t.d/a.shared -fPIC -shared %S/Inputs/instrprof-dynamic-a.cpp
 RUN: %clang_profgen -o %t-shared -fPIC -rpath %t.d %t.d/a.shared %S/Inputs/instrprof-dynamic-b.cpp %S/Inputs/instrprof-dynamic-main.cpp

Modified: compiler-rt/trunk/test/profile/instrprof-dynamic-two-shared.test
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/profile/instrprof-dynamic-two-shared.test?rev=208947&r1=208946&r2=208947&view=diff
==============================================================================
--- compiler-rt/trunk/test/profile/instrprof-dynamic-two-shared.test (original)
+++ compiler-rt/trunk/test/profile/instrprof-dynamic-two-shared.test Thu May 15 23:07:09 2014
@@ -1,5 +1,3 @@
-XFAIL: linux, android
-
 RUN: mkdir -p %t.d
 RUN: %clang_profgen -o %t.d/a.shared -fPIC -shared %S/Inputs/instrprof-dynamic-a.cpp
 RUN: %clang_profgen -o %t.d/b.shared -fPIC -shared %S/Inputs/instrprof-dynamic-b.cpp





More information about the llvm-commits mailing list