Commit Graph

209 Commits

Author SHA1 Message Date
Kuba Brecka 0f776b0905 [compiler-rt] OS X: Update the CMake and Make builds to explicitely use libc++, mmacosx-version-min and SDKs
In both CMake and Makefiles, we are inconsistent about the use of libstdc++ vs. libc++, SDKs and minimum deployment targets for OS X. Let's fix the detection of SDKs, and let's explicitely set that we link against libc++ and mmacosx-version-min is 10.7.

llvm-svn: 227509
2015-01-29 23:19:26 +00:00
Justin Bogner 91487e80c8 profile: add lib/profile to cc_kext on darwin,arm64
These functions are already present in the cc_kext for arm32 and for x86 and
x86_64.  It was an oversight that they were not included for arm64.

Based on a patch by Lawrence D'Anna. Thanks!

llvm-svn: 227206
2015-01-27 17:10:07 +00:00
Kuba Brecka 9a36b3e147 [compiler-rt] Ensure AsanInitFromRtl is called from a static initializer on OS X by using ASAN_DYNAMIC=1
The idea is to ensure that the ASan runtime gets initialized early (i.e.
before other initializers/constructors) even when DYLD_INSERT_LIBRARIES
is not used. In that case, the interceptors are not installed (on OS X,
DYLD_INSERT_LIBRARIES is required for interceptors to work), and therefore
ASan gets currently initialized quite late -- from the main executable's
module initializer. The following issues are a consequence of this:

  https://code.google.com/p/address-sanitizer/issues/detail?id=363
  https://code.google.com/p/address-sanitizer/issues/detail?id=357

Both of them are fixed with this patch.

Reviewed at http://reviews.llvm.org/D7117

llvm-svn: 226929
2015-01-23 19:29:19 +00:00
Nick Kledzik 83a2d8ec73 Add 64-bit multiply functions to iOS arm64 compiler-rt dylib
llvm-svn: 225226
2015-01-06 00:27:21 +00:00
Alexey Samsonov e585e738d4 Remove darwin_fat.mk.
Summary:
Its seems to be replaced by clang_darwin.mk in the Makefile-based
build, and is only referenced in unittest scripts, which are
broken for a long time now.

Test Plan: n/a

Reviewers: bob.wilson

Subscribers: llvm-commits

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

llvm-svn: 224946
2014-12-29 19:21:59 +00:00
Justin Bogner 42be29f748 profile: Add the relevant parts of lib/profile to cc_kext on darwin
Patch by Lawrence D'Anna. Thanks!

llvm-svn: 224270
2014-12-15 20:44:05 +00:00
Evgeniy Stepanov f34bad98af [asan] Remove the local copy of Android ucontext.h.
This header is present in the r10c release of the NDK.

llvm-svn: 222915
2014-11-28 10:37:44 +00:00
Bob Wilson fc410b6aaf Add a missing parenthesis mistakenly dropped in r221621.
llvm-svn: 221656
2014-11-11 02:05:56 +00:00
Bob Wilson 442e1e05e9 Clean up indentation after previous change.
llvm-svn: 221622
2014-11-10 19:38:18 +00:00
Bob Wilson 8aa9ab104c Build Darwin libclang_rt libraries against real SDKs.
The minimal fake SDK was very useful in allowing us to build for all
Darwin platforms without needing access to the real SDKs, but it did
not support building any of the sanitizer runtimes. It's important to
fix that. As a consequence, if you don't have the iOS SDKs installed,
we will now skip building the iOS-specific libclang_rt libraries.
rdar://problem/18825276

llvm-svn: 221621
2014-11-10 19:38:15 +00:00
Bob Wilson da37021cf3 Do not build a separate x86_64h Haswell slice for the iOS simulator.
r199996 added new x86_64h slices for all the Darwin compiler_rt libraries
that had an x86_64 slice, but that is overkill for the iOS Simulator
platform where the x86_64h slice is never used.

llvm-svn: 221610
2014-11-10 17:05:21 +00:00
Kuba Brecka 98e486e11c Use @rpath for ASan dylib in Makefiles
Reviewed at http://reviews.llvm.org/D6176

llvm-svn: 221556
2014-11-07 22:27:12 +00:00
Bob Wilson ca0a38e0ae Add complex multiply/divide functions to arm64 iOS libclang_rt libraries.
Clang r219557 introduces libcalls to complex multiply/divide functions.
Since these functions are not available in iOS for arm64 devices, add them to
the static libraries.

llvm-svn: 219715
2014-10-14 20:33:36 +00:00
Tim Northover 8897b8d21a AArch64: don't just hack arm64 support into compiler-rt.
We should check whether the compiler & linker support ARM64 before attempting
to build a version of compiler-rt for it. Otherwise things will go badly.

rdar://problem/18575597

llvm-svn: 219332
2014-10-08 18:34:30 +00:00
Tim Northover a5a06ad6fc AArch64: add support for ARM64 iOS versions of compiler-rt.
Just a dummy directory and a few sane choices in the Darwin SDK.

rdar://problem/18575597

llvm-svn: 219323
2014-10-08 17:28:37 +00:00
Alexander Potapenko ff7456dd34 [ASan] Bump the minimum OSX version required to run ASan to 10.7.
llvm-svn: 219302
2014-10-08 12:41:11 +00:00
Alexey Samsonov 84e0223a9d Fix configure+make build of profile runtime library
llvm-svn: 212665
2014-07-10 00:53:20 +00:00
Alexey Samsonov 00997e29e5 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: 209473
2014-05-22 21:12:43 +00:00
Alp Toker 1ee7fc7a1a Fix typos
llvm-svn: 208841
2014-05-15 02:22:34 +00:00
Alexey Samsonov 1866b58885 [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: 208609
2014-05-12 18:39:22 +00:00
Alexey Samsonov 9c1a57b64f [DFSan] Update build rules for Makefile build
llvm-svn: 208268
2014-05-07 23:48:59 +00:00
Duncan P. N. Exon Smith be0a5e176b InstrProf: Reorganize files; no functionality change
Move functions around to prepare for some other changes.

  - Merge InstrProfilingExtras.h with InstrProfiling.h.  There's no
    benefit to having these split.

  - Rename InstrProfilingExtras.c to InstrProfilingFile.c.

  - Split actual buffer writing code out of InstrProfiling.c into
    InstrProfilingBuffer.c.

  - Drive-by corrections of a couple of header comments.

<rdar://problem/15943240>

llvm-svn: 204497
2014-03-21 18:29:15 +00:00
Duncan P. N. Exon Smith 775c178a90 PGO: Add explicit static initialization
Instead of relying on explicit static initialization from translation
units, create a new file, InstrProfilingRuntime.cc, with an
__llvm_pgo_runtime variable.  After this commit (and its pair in clang),
the driver will create a use of this variable.  Unless the user defines
their own version, the new object file will get pulled in, including
that C++ static initialization that calls
__llvm_pgo_register_write_atexit.

The result is that, at least on Darwin, static initialization typically
consists of a single function call, which registers a writeout functino
atexit.  Furthermore, users can skip even this behaviour by defining
their own __llvm_pgo_runtime.

<rdar://problem/15943240>

llvm-svn: 204380
2014-03-20 19:23:53 +00:00
Duncan P. N. Exon Smith 9cee5e0e92 PGO: Moving files for clarity
<rdar://problem/15943240>

llvm-svn: 204373
2014-03-20 18:43:09 +00:00
Duncan P. N. Exon Smith ecf2256dfe PGO: Implement Darwin linker magic for instrumentation
Use Darwin linker magic to find bounds of instrumentation data sections
at link time instead of runtime.

<rdar://problem/15943240>

llvm-svn: 204302
2014-03-20 03:57:33 +00:00
Duncan P. N. Exon Smith da0de8a237 PGO: Split out initialization of section bounds
Currently we register instrumentation data at runtime to determine the
bounds of the sections where the data lives.  Soon we'll implement
platform-specific linker magic to determine this at link time.

Move this logic to a separate file, so that our build system can choose
the correct platform-specific code.

No functionality change intended.

<rdar://problem/15943240>

llvm-svn: 204299
2014-03-20 03:23:10 +00:00
Duncan P. N. Exon Smith fb4447688f PGO: Appease buildbots after r204268
llvm-svn: 204276
2014-03-19 22:28:32 +00:00
Alexey Samsonov a7b8472397 One more attempt to fix Makefile build
llvm-svn: 204241
2014-03-19 15:26:54 +00:00
Alexey Samsonov 725122eca3 [Make] Build sanitizer runtimes with -std=c++11
llvm-svn: 204239
2014-03-19 14:50:10 +00:00
Evgeniy Stepanov 0b5b3295e5 Move Android ucontext.h out of third_party.
Google is re-licensing this code under the standard dual license of
compiler-rt.

llvm-svn: 204128
2014-03-18 08:32:14 +00:00
Tim Northover 1683caab3a ARM: implement __sync_fetch_and_* operations
Since these are primarily useful for deeply embedded targets where code size is
very important, they are each in a separate file making use of infrastructure
in sync-ops.h. This allows a linker to include just the functions that are
actually used.

rdar://problem/14736665

llvm-svn: 202812
2014-03-04 10:10:17 +00:00
Evgeniy Stepanov 2821fb7d18 [asan] Fix Android configure/make build.
Mirror recent cmake changes in the configure/make build system.

llvm-svn: 202793
2014-03-04 07:17:38 +00:00
Tim Northover 23a2fb59b6 Darwin: use the compiler-provided linker
When actually compiling we use clang for the final .dylib creation stage, so we
should ask it what linker it'll use when detecting support for our
architectures.

llvm-svn: 201845
2014-02-21 10:19:22 +00:00
Alexey Samsonov 599290e1ca [compiler-rt] Fix CompilerTargetTriple for non-English locales.
When the locale of a shell is set other than English locales or the C locale,
The word 'Target' may be translated. Thus, with e.g. ja_JP locale, compiler-rt
couldn't be built properly. Forcing LANG=C fixes the problem.

Patch by Ogino Masanori.

llvm-svn: 201506
2014-02-17 09:14:01 +00:00
Alexey Samsonov a6b264b51d Move original compiler-rt functions (libgcc replacement) to lib/builtins directory
llvm-svn: 201393
2014-02-14 09:20:33 +00:00
Evgeniy Stepanov aeefe8c1bb Remove -arm-enable-ehabi from Android build rules. It's enabled by default.
llvm-svn: 200392
2014-01-29 12:36:45 +00:00
Tim Northover 5a8af3e136 Darwin: add x86_64h slice for Haswell.
llvm-svn: 199996
2014-01-24 13:10:55 +00:00
Evgeniy Stepanov 350fe4b1af [asan] Android logging.
This change duplicates all ASan output to system log on Android.

llvm-svn: 199887
2014-01-23 11:34:41 +00:00
Tim Northover bea1cafde8 Macho-embedded: update build script for newer Clang behaviour.
Clang now uses the *-apple-macho triples for embedded targets using MachO. The
environment makes less pretences to be running an actual Mach kernel with all
the support that would imply, so a few changes are needed to the build scripts:
    
+ The Apple way of detecting endianness applies in all cases so drop the
  __MACH__ test.
+ A quick rename since "darwin_embedded" no longer makes any sense. If there's
  no Mach going on, there's certainly no Darwin.
+ Change how we test for support for a platform. The functions we build don't
  need any SDK support (stdio.h, ...) so we don't need to check for it.

llvm-svn: 199731
2014-01-21 12:38:02 +00:00
Evgeniy Stepanov 755fc5c313 [asan] Link runtime library with -lm -Wl,-z,defs to ensure that it declares all its dependencies.
llvm-svn: 199483
2014-01-17 09:38:46 +00:00
Evgeniy Stepanov e259b658e4 [asan] Nuke ASAN_FLEXIBLE_MAPPING_AND_OFFSET.
llvm-svn: 199370
2014-01-16 10:16:19 +00:00
Bob Wilson e38cc76c32 Remove support for armv7f slice. <rdar://problem/12478440>
This was never used for anything so we should just get rid of it.

llvm-svn: 199333
2014-01-15 21:05:20 +00:00
Justin Bogner 65bb804f05 profile: Rudimentary suppport for PGO instrumentation
This is fairly minimal support for instrumentation based PGO. The data
format is inefficient, and the output file name is hardcoded to
pgo-data.

llvm-svn: 198638
2014-01-06 22:27:03 +00:00
Tim Northover 638a424b56 Only build embedded darwin variants if the compiler supports them
We need to filter out architectures that the compiler hasn't been built to
target (most likely the ARM ones) before attemptint to build a version of
libcompiler_rt.

This can result in a completely empty library (e.g. soft-float doesn't have any
x86 variants), in which case we shouldn't even try the build

llvm-svn: 197028
2013-12-11 11:25:53 +00:00
Alexey Samsonov 58e44a3447 Revert r196490 and fix include paths in makefile-based build
llvm-svn: 196492
2013-12-05 10:40:11 +00:00
Duncan P. N. Exon Smith 2f234f4908 Fixing ordering of definition of IOSSIM_SDK_PATH
llvm-svn: 195216
2013-11-20 05:36:52 +00:00
Alexander Potapenko 9ff321d18d [ASan] Don't put asan_iossim_dynamic in the list of configurations to build
if the iOS Simulator SDK is missing on the machine.

llvm-svn: 195125
2013-11-19 13:24:29 +00:00
Tim Northover 3ae5a369d8 Revert premature instructions to build __sync_fetch_*
My commits got a bit twisted when I was working on both embedded support and
__sync stuff on the same branch. Sorry about that.

llvm-svn: 194886
2013-11-15 23:26:29 +00:00
Tim Northover 084647d4c0 Add clang_darwin_embedded platform for embedded projects
This should build a separate set of embedded runtime libraries, supporting the
option product:

    {PIC, static} x { Hard-float, soft-float }

The emphasis is on ARM platforms (Cortex-M4F, Cortex-M3, Cortex-M0) but X86
variants are also built where possible.

rdar://problem/10817205

llvm-svn: 194873
2013-11-15 23:00:42 +00:00
Alexander Potapenko bf50fbfc21 [ASan] Add the configure+make rules for building the ASan runtime for iOS simulator.
llvm-svn: 194813
2013-11-15 13:13:01 +00:00