summaryrefslogtreecommitdiff
path: root/cmake/Modules/CompilerRTDarwinUtils.cmake
AgeCommit message (Collapse)Author
2017-09-01[cmake] Work around -Wunused-driver-argument warningsVedant Kumar
Fix the Darwin logic so that -msse3 is only used on macOS, and -fomit-frame-pointer is not used on armv7/armv7k/armv7s. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312390 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-30[builtins] Prevent duplicate definitions for overridden functionsFrancis Ricci
Summary: Some architecture-specific function overrides (for example, i386/ashrdi3.S) duplicate generic functions (in that case, ashrdi3.c). Prevent duplicate definitions by filtering out the generic files before compiling. Reviewers: compnerd, beanz Subscribers: llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D37166 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312140 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-12Fix the declaration of DARWIN_PREFER_PUBLIC_SDK cmake variable (move before ↵Kuba Mracek
the return). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@307815 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07[cmake] Cache results of find_darwin_sdk_dirKuba Mracek
This improves find_darwin_sdk_dir to cache the results of executing xcodebuild to find the SDK. Should significantly reduce the CMake re-configure time. Differential Revision: https://reviews.llvm.org/D34736 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@307344 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-06[cmake] Add an option to prefer public SDK in find_darwin_sdk_dirKuba Mracek
Adds a CMake option DARWIN_PREFER_PUBLIC_SDK, off by default. When on, this prefers to use the public SDK, even when an internal one is present. With this, it's easy to emulate a build that the public buildbots are doing. Differential Revision: https://reviews.llvm.org/D35071 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@307330 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-21[compiler-rt] respect CMAKE_EXE_LINKER_FLAGS in compiler and library testsBob Haarman
Summary: check_cxx_compiler_flag and check_library_exists could fail because they ignored CMAKE_EXE_LINKER_FLAGS and therefore would always fail to produce executables. Cmake policy CMP0056 fixes this, but was explicitly set to OLD in our CMakeLists because it caused problems with test_target_arch. This change sets the policy to NEW to fix the problem with the compiler and library tests, and temporarily clears CMAKE_EXE_LINKER_FLAGS inside test_target_arch to emulate the old behavior there. This allows, for example, LTO builds that require lld to succeed. Reviewers: davidxl, beanz Reviewed By: beanz Subscribers: fjricci, dberris, mgorny, mehdi_amini, tejohnson, rnk, llvm-commits Differential Revision: https://reviews.llvm.org/D31098 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@298413 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-10Make cmake link flag naming consistentFrancis Ricci
Summary: The build system was inconsistent in its naming conventions for link flags. This patch changes all uses of LINKFLAGS to LINK_FLAGS, for consistency with cmake's LINK_FLAGS property. This patch should make it easier to search the source code for uses of link flags, as well as providing the benefit of improved style and consistency. Reviewers: compnerd, beanz Subscribers: kubabrecka, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D28506 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@291539 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-19[CMake] Support building on OS X without Xcode installationChris Bieneman
This should resolve PR23162. This patch has two parts. First we need to check the error code from xcodebuild when querying for SDKs, second if the OS X SDK is not discovered, we ensure that /usr/include exists and use / as the OS X sysroot. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279336 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-18[CMake] Stop building eprintf library on DarwinChris Bieneman
In r278988 clang stopped using the eprintf library, so we should stop generating it too. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279090 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22[CMake] Converting darwin_test_archs simple source to CChris Bieneman
Using C instead of CXX here removes a configuration-time dependency on libcxx for the sanitizers. This should be NFC. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@273505 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03[CMake] NFC. Add support for testing the compiler without testing the linkerChris Bieneman
Summary: One of the big limitations we have in the compiler-rt build system today is that we cannot bootstrap building the builtins because you need a fully functional toolchain to pass CMake's tests. This change adds support for compile only tests. It is NFC because nothing is using the compile-only tests yet. I believe this is the last separable part of D16653. Reviewers: samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D19692 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@268427 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28[CMake] Adding another missing include. NFC.Chris Bieneman
This also works fine today, but will break with my upcoming refactoring. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267941 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-26[CMake] [PR27403] Fix COMPILER_RT_ENABLE_IOS when using Xcode from the App ↵Chris Bieneman
Store. This change modifies find_darwin_sdk_dir to set a variable if a Darwin "Internal" SDK is present which allows CMake to disable components that require internal-only APIs. This mechanism is then used to disable TSan when an internal SDK is not present. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267575 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-02[asan] Add iOS support.Anna Zaks
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@259451 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-27[compiler-rt] list_union() is actually an intersect operation. Rename it.Daniel Sanders
Summary: Given: set(T1 a b c) set(T2 b c d) message("T1=${T1}") message("T2=${T2}") list_union(T3 T1 T2) message("T3=${T3}") cmake emitted: T1=a;b;c T2=b;c;d T3=b;c Reviewers: beanz Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D16580 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258916 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08[cmake] Indentation fix (NFC)Vedant Kumar
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257118 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-07[cmake] Add InstrProfilingWriter to libclang_rt on DarwinVedant Kumar
llvmBufferWriter and a few related symbols were missing from libclang_rt on Darwin (PR26002). This should fix the problem. Patch by Dan Peebles! git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257110 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-10[CMake] [Darwin] Log architecture test failures to CMakeError.logChris Bieneman
This makes debugging configuration issues way easier. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@255183 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-03[sanitizer] Cache results of darwin_test_archsKuba Brecka
For OS X builds of compiler-rt, we run `darwin_test_archs` to determine which architectures can the toolchain target. This detection takes quite a long time, and the result is always the same (as long as you don't upgrade your OS, system headers or toolchain). Let's cache the result. Differential Revision: http://reviews.llvm.org/D15179 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@254618 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-25[CMake] [Darwin] libclang_rt.eprintf should be built with the same CFLAGS as ↵Chris Bieneman
the other darwin builtin libraries. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@254082 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-20[compiler-rt][cmake] Fix not lipo libclang_rt.cc_kext.a when building on OS XChris Bieneman
Summary: Fix r252525 - cmake configure failed to connect target builtins to target compiler-rt because of early return call. Patch by: Jacky Tsao (cao.zhong1) Reviewers: beanz Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D14747 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@253692 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-13[CMake] [macho_embedded] [builtins] Always use OS X sysroot, even for arm.Chris Bieneman
Turns out that there are some checks in the backend that change code generation for armv7 if you are building against an iOS sys root. For the macho_embedded builtins we really don't want that. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@253064 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12[CMake] [Darwin] Forcing -fPIC on for all darwin builtins except macho_embeddedChris Bieneman
We need to add -fPIC to the flags for the builtins in case PIC was turned off at a higher level. We also want to set ENABLE_PIC to Off when building the macho_embedded builtins so the top-level settings don't impact that build. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@252966 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-11[CMake] [Darwin] [Builtins] Force setting the flags we care about at the end ↵Chris Bieneman
of the compiler command line Setting CMAKE_*_FLAGS isn't sufficient here because CMAKE_*_FLAGS_${CMAKE_BUILD_TYPE} can override the flags, and there is no way to safely clear that because it is a cached variable (<sarcasm> YAY! </sarcasm>). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@252807 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-10[CMake] [macho_embedded] Only set sys root if the variable is set, this ↵Chris Bieneman
prevents passing empty -isysroot arguments This is a minor cleanup to the macho_embedded builtins. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@252619 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-10[CMake] Cleaning up flags for Darwin builtinsChris Bieneman
* Setting CMAKE_*_FLAGS_${BUILD_TYPE} isn't really needed since we're setting the same value everywhere * functions sanitize variables differently from macros, darwin_add_embedded_builtin_libraries should be a macro otherwise it won't alter the variables. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@252618 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-10[CMake] Temporary workaround to support building builtins on darwin with a ↵Chris Bieneman
toolchain that may not support all x86 and arm architectures. This is at least a little better than my first attempt. We still really need a way to do compile checks without linking. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@252572 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-10Revert "[CMake] [macho_embedded] Check to make sure the compiler supports ↵Chris Bieneman
the architectures before generating build targets" This commit reverts r252525. I was not really thinking about this fix properly. This doesn't work because it relys on try_compile checks which do a full compile & link. I'm going to put in a temporary solution as an interm step until we have a way to perform compiler checks without linking. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@252569 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-09[CMake] Don't pass -fPIC when compiling the darwin builtinsChris Bieneman
This change makes CMake match autoconf. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@252547 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-09[CMake] Fixing a typo in variable name ARG_*->LIB_*Chris Bieneman
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@252543 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-09[CMake] Removing extra underscore.Chris Bieneman
Fixing a typo. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@252534 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-09[CMake] [Darwin] Don't generate lipo commands if we don't have libraries to ↵Chris Bieneman
put into the fat archive. Not making sure there are thin libraries results in some difficult to diagnose build failures. This check should make those build failures go away. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@252527 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-09[CMake] [macho_embedded] Check to make sure the compiler supports the ↵Chris Bieneman
architectures before generating build targets If we don't check the compiler's capabilities we end up generating build targets that the compiler might not be able to build. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@252525 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06[CMake] Need to filter ${arch}/*.c builtins as well as ${arch}/*.S builtins.Chris Bieneman
This was broken in r248542 when I refactored this to support builtins where ${arch} didn't match the directory prefix (i.e. armv7s). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@252365 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-09[CMake] Adding support for generating libclang_rt.eprintf.aChris Bieneman
This library provides eprintf for i386 on OS X versions later than 10.4. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@249913 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-09[CMake] [Darwin] [builtins] Need to special case the naming of the OS X ↵Chris Bieneman
cc_kext builtin library. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@249870 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-04[CMake] [darwin] Removing a line of debug code that I accidentally committed.Chris Bieneman
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@249278 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-02[CMake] [darwin] [builtins] Add INSTALL_DIR to darwin_lipo_libsChris Bieneman
The darwin and macho_embedded libraries get installed to different locations, so we need to feed through an INSTALL_PATH. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@249199 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-02[CMake] Workaround for the lipo output directory not being created.Chris Bieneman
This should resolve an issue reported by mclow. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@249158 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-01[CMake] [builtins] [macho_embedded] Separate out the 64-bit thumb builtins ↵Chris Bieneman
so they don't get included on 'm' architectures. NFC. This should help make the compiler-rt build less noisy. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@249084 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-01[CMake] [builtins] [macho_embedded] Don't pass -mfloat-abi=hard flag to x86 ↵Chris Bieneman
because the compiler ignores it and complains. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@249076 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-30[CMake] [Darwin] [macho_embedded] Specify the version min explicitly.Chris Bieneman
We need to set the OS X deployment target on the macho_embedded libraries to match the outputs from the autoconf build system. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@248944 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-30[CMake] [Darwin] [builtins] Change condition for skipping cc_kext to be ↵Chris Bieneman
setting based. This is needed because we need to skip cc_kext generation for more than just the simulator builds. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@248939 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-29[CMake] [macho_embedded] We need to set some extra flags when building the ↵Chris Bieneman
macho_embedded builtins. If we don't specify the arm target the float ABI compiler flags get ignored. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@248853 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-29[CMake] [Darwin] Support building the macho_embedded builtin libraries.Chris Bieneman
Summary: This ports functionality from the clang_macho_embedded.mk platform makefile over to CMake. Reviewers: bogner, samsonov, bob.wilson Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D13226 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@248850 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-28[CMake] [Darwin] [builtins] Apply OS and OS-arch filters to cc_kext builtin ↵Chris Bieneman
libraries. We don't want to filter out the builtins that are present in libSystem like we do for the normal builtins because kexts can't link libSystem, but we should filter out all the builtins that are generally not supported on the OS and architecture. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@248756 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-28[CMake] Accidentally committed code that was using a variable only populated ↵Chris Bieneman
in some earlier code. NFC. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@248752 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-28[CMake] [Darwin] [builtins] Fix building builtins for Darwin simulator ↵Chris Bieneman
platforms. For Darwin simulator platforms we shouldn't build the cc_kext builtins at all because they aren't applicable, and we should includ the simulator builtins as slices inside the main platform builtin library. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@248751 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-28[CMake] [Darwin] Make darwin_filter_builtin_sources support both whitelist ↵Chris Bieneman
and blacklist filtering. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@248720 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-25[CMake] [darwin] [builtins] Make darwin_lipo_libs take OUTPUT_DIR as an ↵Chris Bieneman
option. NFC. This refactoring will allow me to reuse this function when calling lipo with outputs in different directories. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@248639 91177308-0d34-0410-b5e6-96231b3b80d8