Commit Graph

65 Commits

Author SHA1 Message Date
Alexey Samsonov 498f3c3416 [UBSan] Use shared library for UBSan on OS X (Clang part).
Summary:
UBSan is now used in the same way as ASan, and is supported on
OSX and on iOS simulator. At the moment ASan and UBSan can't be used
together due to PR21112, but I hope to resolve it soon by
embedding UBSan into ASan.

Test Plan: regression test suite.

Reviewers: zaks.anna, kubabrecka

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D8471

llvm-svn: 233035
2015-03-23 23:14:05 +00:00
Alexey Samsonov f29e3f0791 Remove support for building sanitizers from Makefile/autoconf build on Linux.
This is a re-application of r229554 restricted to Linux build only.
Apple still uses Makefile/autoconf to build Clang and sanitizers.

llvm-svn: 229755
2015-02-18 22:26:22 +00:00
Matthias Braun 44bf1c9c53 Revert "Remove support for building sanitizers from Makefile/autoconf build."
This reverts commit r229554.

Reverting this commit for now as several apple internal builds still
rely on this functionality.

llvm-svn: 229582
2015-02-17 23:27:37 +00:00
Alexey Samsonov 883a04ade7 Remove support for building sanitizers from Makefile/autoconf build.
They autotools build has a number of missing features, supports less
OS, architectures, build configurations, doesn't have any tests and
is hard to support in sync with CMake build.

llvm-svn: 229554
2015-02-17 21:53:22 +00:00
Alexey Samsonov 021de66be6 [CMake] Add check-asan-dynamic command to external compiler-rt setup.
llvm-svn: 224545
2014-12-18 21:40:39 +00:00
Bob Wilson 95dcc08e82 Remove change to set SDKROOT when building compiler-rt on Darwin.
This reverts the runtime library portion of r194168. As of r221621,
the libclang_rt libraries for Darwin build with explicit SDK options
so there is no need to set SDKROOT here.

llvm-svn: 221625
2014-11-10 20:01:19 +00:00
Bob Wilson 94794d08b9 Only build iOS runtime libraries when the iOS SDKs are available.
This was already set up for the iOS simulator ASan dylib simulator,
and this change extends that to the other iOS runtime libraries.
This is in preparation for building all those iOS libraries against
the real SDKs instead of the fake SDKs in compiler-rt.

llvm-svn: 221614
2014-11-10 17:46:55 +00:00
Kuba Brecka ea0a4dfd27 Use @rpath for ASan dylib in Makefiles
Reviewed at http://reviews.llvm.org/D6176

llvm-svn: 221557
2014-11-07 22:27:43 +00:00
Alexey Samsonov 99ee10d2b8 Unify the name of compiler-rt builtins library on Linux.
Call it "libclang_rt.builtins-<arch>.a" to be consistent
with sanitizers/profile libraries naming. Modify Makefile
and CMake build systems and Clang driver accordingly.

Fixes PR19822.

llvm-svn: 209474
2014-05-22 21:13:30 +00:00
Jonathan Roelofs becce11112 Make verbose clang builds also build compiler_rt verbosely
llvm-svn: 208821
2014-05-14 23:07:16 +00:00
Alexey Samsonov b01f936ffe [ASan] Split static ASan runtime in two parts: asan and asan_cxx.
asan_cxx containts replacements for new/delete operators, and should
only be linked in C++ mode. We plan to start building this part
with exception support to make new more standard-compliant.

See https://code.google.com/p/address-sanitizer/issues/detail?id=295
for more details.

llvm-svn: 208610
2014-05-12 18:39:51 +00:00
Alexey Samsonov 089d130568 [CMake] Propagate top-level targets for compiler-rt runtimes and test-suites
from (external) compiler-rt build tree into LLVM/Clang build tree in
LLVM_BUILD_EXTERNAL_COMPILER_RT mode.

For instance, running
  make asan -j12
in LLVM/Clang build tree will now build Clang, use it to configure
compiler-rt build tree, and invoke "make asan -j12" there. ASan runtime will
be built in the proper location, where Clang driver expects to find it.

Running
  make check-asan
will build Clang, use it to configure compiler-rt build tree, build everything
there, and then run "make check-asan" in compiler-rt build tree using just-built
Clang and ASan runtime.

llvm-svn: 204463
2014-03-21 13:09:25 +00:00
Alexey Samsonov 8a25994c25 [CMake] Teach build system to build/test compiler-rt with a just-built Clang
With this change, one may set LLVM_BUILD_EXTERNAL_COMPILER_RT option
to build compiler-rt libraries with just-built Clang.

  make compiler-rt
in the build tree will build all compiler-rt libraries with just-built Clang
and copy them to the proper location in the Clang resource directory.

  make check-compiler-rt
will run the compiler-rt test suite using just-built Clang and runtime
libraries.

The goal is to make LLVM_BUILD_EXTERNAL_COMPILER_RT the default, so that
we can always build compiler-rt libraries with Clang, not the host compiler,
and for all the platforms Clang can target.

llvm-svn: 202367
2014-02-27 09:09:39 +00:00
Tim Northover 1a9b904b76 Macho-embedded: rename compiler-rt support from Darwin-embedded
There's nothing Darwin-based in the files or target now, so the previous name
is now misleading.

llvm-svn: 199733
2014-01-21 12:38:19 +00:00
Tim Northover 235dff7b63 Only build ARM-specific runtimes if ARM is enabled
The soft-float variants of (embedded) libclang_rt only make sense for ARM, so
there's no point in trying to build them if the compiler is only capable of
targeting x86.

llvm-svn: 197033
2013-12-11 12:01:21 +00:00
Alp Toker f6a24ce40f Fix a tranche of comment, test and doc typos
llvm-svn: 196510
2013-12-05 16:25:25 +00:00
Tim Northover 2622b24a59 Darwin(ish): enable embedded compiler-rt builds on Darwin.
This builds extra versions of compiler-rt targeting various unhosted targets.
Only built on Darwin since even though they're not iOS or OSX, they share some
quirks.

llvm-svn: 194878
2013-11-15 23:12:44 +00:00
Justin Bogner 2e8350b2b9 libc++: Install headers in include/, rather than lib/
When using the configure build system, the libc++ headers were being
installed in lib/, whereas cmake installs them in include/. Since
include/ makes more sense for headers, we'll make both systems install
headers there.

llvm-svn: 194833
2013-11-15 18:07:57 +00:00
Alexander Potapenko 19e7bfdd8d [ASan] If the iOS Simulator SDK is available, build the ASan iossim runtime using configure+make.
llvm-svn: 194816
2013-11-15 14:56:31 +00:00
Daniel Dunbar 184687b9bc [build] Update runtime library and tests to work with relocatable SDKs on OS X 10.9.
llvm-svn: 194168
2013-11-06 21:44:54 +00:00
Alexander Potapenko bcaea0ee0b [libsanitizer] configure+make: install include/sanitizer into Clang
When building Clang with compiler-rt, copy the contents of compiler-rt/include/sanitizer into lib/clang/3.4/include/sanitizer

llvm-svn: 193515
2013-10-28 08:21:35 +00:00
Alexey Samsonov a272b78879 [LSan] Add support for building standalone LSan runtime to Make build (clang part)
llvm-svn: 188805
2013-08-20 14:49:36 +00:00
Peter Collingbourne c377275a4a DataFlowSanitizer; Clang changes.
DataFlowSanitizer is a generalised dynamic data flow analysis.

Unlike other Sanitizer tools, this tool is not designed to detect a
specific class of bugs on its own.  Instead, it provides a generic
dynamic data flow analysis framework to be used by clients to help
detect application-specific issues within their own code.

Differential Revision: http://llvm-reviews.chandlerc.com/D966

llvm-svn: 187925
2013-08-07 22:47:34 +00:00
Chandler Carruth 8907811e4b The makefile build system had two lists of the 32-bit runtime libraries
to build and one had grown out of sync. Put this list in a variable so
this doesn't happen again.

The whole thing here is somewhat suspicious as we don't support 32-bit
environments with a 64-bit bi-arch capable compiler, but none have
complained yet about this so I'm just leaving it alone.

llvm-svn: 184665
2013-06-23 10:10:25 +00:00
Alexey Samsonov 92bbd3e818 Nuke build of static ASan runtime on Mac OS - clang part
llvm-svn: 182278
2013-05-20 14:33:20 +00:00
Richard Smith cff3cde28b Split ubsan runtime into three pieces (clang part):
* libclang_rt-san-* is sanitizer_common, and is linked in only if no other
   sanitizer runtime is present.
 * libclang_rt-ubsan-* is the piece of the runtime which doesn't depend on
   a C++ ABI library, and is always linked in.
 * libclang_rt-ubsan_cxx-* is the piece of the runtime which depends on a
   C++ ABI library, and is only linked in when linking a C++ binary.

This change also switches us to using -whole-archive for the ubsan runtime
(which is made possible by the above split), and switches us to only linking
the sanitizer runtime into the main binary and not into DSOs (which is made
possible by using -whole-archive).

The motivation for this is to only link a single copy of sanitizer_common
into any binary. This is becoming important now because we want to share
more state between multiple sanitizers in the same process (for instance,
we want a single shared output mutex).

The Darwin ubsan runtime is unchanged; because we use a DSO there, we don't
need this complexity.

llvm-svn: 177605
2013-03-20 23:49:07 +00:00
Evgeniy Stepanov 54b54e4772 Add MSan to the list of targets in Makefile-based builds.
llvm-svn: 175738
2013-02-21 13:59:14 +00:00
Alexey Samsonov cc42980335 UBSan: enable proper linking with UBsan runtime on Darwin. Turn on building ubsan on OS X in 'make' build system. Patch by Jean-Daniel Dupas.
llvm-svn: 168168
2012-11-16 12:53:14 +00:00
Alexey Samsonov cc9ffd1f8a [UBSan] Add support for building ubsan runtime library on Linux with 'make'. Clang part.
llvm-svn: 168039
2012-11-15 12:40:37 +00:00
Evgeniy Stepanov 04dbc2d022 Pass LLVM_ANDROID_TOOLCHAIN_DIR if set.
This lets one build ASan runtime for ARM/Android by running
make -C tools/clang/runtime/ \
  LLVM_ANDROID_TOOLCHAIN_DIR=/path/to/ndk/toolchain
in an existing build tree.

llvm-svn: 166560
2012-10-24 14:05:29 +00:00
Daniel Dunbar bd847cc562 Un-revert r164907 and r164902 (+ follow-ups), 10.6 build fix to follow.
llvm-svn: 165988
2012-10-15 22:23:53 +00:00
Nico Weber bec2bf1326 Revert r164907 and r164902 (+ follow-ups). They broke building on 10.6.
See PR14013.

llvm-svn: 165962
2012-10-15 20:37:01 +00:00
Alexey Samsonov be5ae06dec Fixup for r165097: build 32-bit ASan compiler-rt library on 64-bit Linux only if just-built clang can build simple 32-bit executables
llvm-svn: 165503
2012-10-09 16:03:52 +00:00
Alexey Samsonov 0bd3665a5c Make sure 32-bit ASan runtime is available on 64-bit Linux platforms
llvm-svn: 165097
2012-10-03 07:23:03 +00:00
Bob Wilson 2afa011e0b Add Clang support for iOS6.
llvm-svn: 164907
2012-09-29 23:52:58 +00:00
Alexander Potapenko 8bea579738 Run install_name_tool to fix the dynamic library ID after it has been copied.
Fixes http://code.google.com/p/address-sanitizer/issues/detail?id=113

llvm-svn: 164031
2012-09-17 14:18:41 +00:00
Daniel Dunbar 1608097324 compiler-rt/darwin: Install asan_osx_dynamic with the other runtime libraries.
llvm-svn: 163941
2012-09-14 21:30:17 +00:00
Daniel Dunbar 07c43bea93 build/compiler-rt: Companion commit to r159172.
llvm-svn: 159174
2012-06-25 23:02:25 +00:00
Kostya Serebryany 66e8fab1c8 [tsan] add ThreadSanitizer linker flags on Linux and also copy the tsan-rt into the appropriate place at build time
llvm-svn: 156906
2012-05-16 06:36:00 +00:00
Daniel Dunbar e8092cabeb build/compiler-rt: Stop forcing off -integrated-as for compiler-rt builds.
llvm-svn: 152054
2012-03-05 20:19:03 +00:00
Rafael Espindola 1a16f49858 Use -no-integrated-as only on ARM. The X86 and X86-64 integrated as have been
the default for clang for some time now and can handle compiler-rt.

llvm-svn: 151367
2012-02-24 16:22:39 +00:00
Bob Wilson 6d69f1a818 Use the new installheaders makefile target in libcxx.
llvm-svn: 148630
2012-01-21 06:25:34 +00:00
Daniel Dunbar ba45b3faf4 runtime/Linux: Include the profile and ASAN libs on x86.
llvm-svn: 146051
2011-12-07 19:35:10 +00:00
Daniel Dunbar a48d32bc9c runtime/Linux: Initial support for tying compiler-rt build into Clang build on
Linux.
 - Currently just builds a full library, and only on x86, and only for the
   target arch.

llvm-svn: 145672
2011-12-02 02:31:32 +00:00
Daniel Dunbar 1d6469fcb1 Driver/Darwin: Add ASAN runtime library link support.
llvm-svn: 145651
2011-12-01 23:40:18 +00:00
Bob Wilson 800b2b42ed Use libcxx makefile's do-installhdrs target. <rdar://problem/10397739>
llvm-svn: 145168
2011-11-27 06:13:25 +00:00
Daniel Dunbar 4f41440cf9 clang/Darwin: Use the compiler-rt provided profile library.
llvm-svn: 144869
2011-11-17 00:36:57 +00:00
Daniel Dunbar a8c9886dcc build/make/compiler-rt: Don't attempt to build compiler-rt runtime libraries
when cross compiling under the current organization.
 - See verbose comment for explanation, justification, and how to fix.

llvm-svn: 144860
2011-11-16 23:22:07 +00:00
Bob Wilson 1c99b57b59 Install a copy of the libc++ headers with clang. <rdar://problem/10096516>
llvm-svn: 140876
2011-09-30 20:24:28 +00:00
Eric Christopher c235d0c635 Build and use libcompiler_rt whenever possible.
Patch by Jean-Daniel Dupas!

llvm-svn: 133624
2011-06-22 17:41:40 +00:00