summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/builtins/CMakeLists.txt
Commit message (Collapse)AuthorAgeFilesLines
...
* [builtins] Get the builtins tests passing on WindowsReid Kleckner2017-04-071-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Many things were broken: - We stopped building most builtins on Windows in r261432 for reasons that are not at all clear to me. This essentially reverts that patch. - Fix %librt to expand to clang_rt.builtins-$arch.lib on Windows instead of libclang_rt.builtins-$arch.a. - Fix memory protection tests (trampoline, enable executable, clear cache) on Windows. One issue was that the MSVC incremental linker generates ILT thunks for functions with external linkage, so memcpying the functions into the executable stack buffer wasn't working. You can't memcpy an RIP-relative jump without fixing up the offset. - Disable tests that rely on C99 complex library functions when using the MSVC CRT, which isn't compatible with clang's C99 _Complex. In theory, these could all be separate patches, but it would not green the tests, so let's try for it all at once. Hopefully this fixes the clang-x64-ninja-win7 bot. llvm-svn: 299780
* Add __ffssi2 implementation to compiler-rt builtinsDimitry Andric2017-04-061-0/+1
| | | | | | | | | | | | | | | | | | | | Summary: During MIPS implementation work for FreeBSD, John Baldwin (jhb@FreeBSD.org) found that gcc 6.x emits calls to __ffssi2() when compiling libc and some userland programs in the base system. Add it to compiler-rt's builtins, based off of the existing __ffsdi2() implementation. Also update the CMake files and add a test case. Reviewers: howard.hinnant, weimingz, rengolin, compnerd Reviewed By: weimingz Subscribers: dberris, mgorny, llvm-commits, emaste Differential Revision: https://reviews.llvm.org/D31721 llvm-svn: 299675
* [Builtin] Unxfail tests for armhfWeiming Zhao2017-03-291-1/+1
| | | | | | | | | | | | | | | | | | | | | Summary: Originally, a few tests fail for armhf target due to: 1) COMPILER_RT_ARMHF_TARGET was not set when building the lib 2) COMPILER_RT_ABI should not be defined as `__attribute__((pcs("aapcs")))` for armhf when building for both lib and tests This address https://bugs.llvm.org//show_bug.cgi?id=32261 mulsc3_test.c is a newly exposed issue, which will be addressed separately. Reviewers: rengolin, compnerd Reviewed By: compnerd Subscribers: aemerson, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D31448 llvm-svn: 298974
* Reapply r297382: "[compiler-rt][builtins] Add __isOSVersionAtLeast()"Erik Pilkington2017-03-091-0/+1
| | | | | | Looks like the problem was a case-insensitive include of dispatch/dispatch.h. llvm-svn: 297392
* Revert "[compiler-rt][builtins] Add __isOSVersionAtLeast()"Erik Pilkington2017-03-091-1/+0
| | | | | | This reverts r297382, it was causing build failures. llvm-svn: 297388
* [compiler-rt][builtins] Add __isOSVersionAtLeast()Erik Pilkington2017-03-091-0/+1
| | | | | | | | | | | | | | | | | This predicate compares the host's marketing OS version to one passed as argument. Currently, only darwin targets are supported. This is done by parsing the SystemVersion.plist file. Also added in this patch is some lit testing infrastructure for builtins, which previously had none. This part of the patch was written by Alex Lorenz (with some minor modifications). This patch is part of a feature I proposed here: http://lists.llvm.org/pipermail/cfe-dev/2016-July/049851.html Differential revision: https://reviews.llvm.org/D30136 llvm-svn: 297382
* [Builtin][ARM] Implement addsf3/__aeabi_fadd for Thumb1Weiming Zhao2017-02-061-0/+1
| | | | | | | | | | | | | | | | | | | Summary: This patch implements addsf3/__aeabi_fadd in asm for Thumb1. Compared with generic C version (lib/fp_add_impl.inc), it 1. all constants are materialized instead of loading from constant pool 2. no stack spills (C version uses 136 bytes stack space) 3. clz() is called only when necessary. (C version always calls it) Reviewers: compnerd, rengolin, asl Reviewed By: asl Subscribers: efriedma, aemerson, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D29485 llvm-svn: 294172
* [Bultin][ARM] Make aeabi_uldivmod and aeabi_ldivmod be Thumb1 compatibleWeiming Zhao2017-01-301-18/+1
| | | | | | | | | | | | | | | | | | Summary: in aeabi_ldivmod and uldivmod, using r6 instead of r12 as the temp reg due to limitation of Thumb1 ISA. Now, all EABI sources are Thumb1 compatible. Also added test cases by reusing the test cases from divmodsi4_test.c, udivmodsi4_test and udivmoddi4_test.c Reviewers: rengolin, compnerd Reviewed By: rengolin Subscribers: javed.absar, aemerson, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D29226 llvm-svn: 293527
* [Builtin][ARM] Add Thumb1 support for aeabi_c{f,d}cmp.S and dcmp.SWeiming Zhao2017-01-271-0/+3
| | | | | | | | | | | | Reviewers: compnerd, rengolin Reviewed By: rengolin Subscribers: aemerson, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D28985 llvm-svn: 293247
* [Bultin][ARM] Make aeabi_memset be Thumb1 compatible and other asmWeiming Zhao2017-01-211-0/+1
| | | | | | | | | | | | | | | | | | | | | syntax fix Summary: Make the asm of aeabi_memset be assembled for thumb1. Also fix some instructions to conform with the syntax of ARM reference manual. For example, muls requires the form of "Rd, Rn, Rd" and orrs requires the form of "Rd, Rm". Clang-as is benign but it may fail other assembler if not in the exact form. Reviewers: rengolin, compnerd, kubamracek Reviewed By: rengolin, compnerd Subscribers: aemerson, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D28971 llvm-svn: 292727
* [Builtin] [ARM] Update CMake to support the build of armv6mWeiming Zhao2017-01-191-1/+25
| | | | | | | | | | | | | | | | | | Summary: Setting -DCOMPILER_RT_TEST_TARGET_TRIPLE=armv6m-none-eabi will enable the build of builtin functions ARMv6m. Currently, only those asms that support armv6m are added. TODO:All asm sin ARM_EABI_Sources are ported for thumb1 so Thumb1_EABI_Sources will be deprecated. Reviewers: rengolin, compnerd Reviewed By: compnerd Subscribers: aemerson, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D28463 llvm-svn: 292504
* [builtins] Implement __floattitf() & __floatuntitf()Michal Gorny2017-01-061-0/+2
| | | | | | | | | | | | | | | | Implement the missing __floattitf() and __floatuntitf() functions, to convert 128-bit (unsigned) integers to quad-precision floating-point types. This is needed e.g. on AArch64 where 'long double' is a quad-precision type. The code is based on the existing code for __floattixf() and __floatuntixf(), updated to account for different bit field lengths of quad-precision float. The tests are also copied, with the rounding tests adjusted for longer significand. Differential Revision: https://reviews.llvm.org/D27898 llvm-svn: 291259
* build: fix building for Windows after SVN r287465Saleem Abdulrasool2016-12-011-1/+1
| | | | | | | | The previous change for enabling MinGW did not preserve the Win32 check and added the EABI specific routines to a Windows build which does not use the EABI routines. Correct the conditional check for that. llvm-svn: 288422
* builtins: switch to c11 from c99Saleem Abdulrasool2016-11-291-1/+1
| | | | | | | | | | | | | | This fixes an incorrect standard usage of GNU99 when the compiler check was for the ISO standard C99. Furthermore, bump the dependency up to C11. The motivation for this change is ARM EHABI compatibility with clang 3.8. We rely on a type definition redefinition which causes an error with -Werror builds. This is problematic for FreeBSD builds. Switching to C11 allows the compatibility without the unnecessary pedantic warning. The alternative would be to clutter the support header with a `pragma clang diagnostic ignore`. GCC 4.8+ and the supported clang revisions along with MSVC support enough of C11 to allow building the builtins in C11 mode. No functional change intended. llvm-svn: 288099
* builtins: Allow building windows arm functions for mingwMartin Storsjo2016-11-191-1/+25
| | | | | | | | | | | | | | | | | When building with clang/LLVM in MSVC mode, the msvcrt libraries contain these functions. When building in a mingw environment, we need to provide them somehow, e.g. via compiler-rt. The aeabi divmod functions work in the same way as the corresponding __rt_*div* functions for windows, but their parameters are swapped. The functions for converting float to integer and vice versa are the same as their aeabi equivalents, only with different function names. Differential Revision: https://reviews.llvm.org/D26183 llvm-svn: 287465
* builtins: ensure that VISIBILITY_HIDDEN is defined properlySaleem Abdulrasool2016-10-281-0/+6
| | | | | | | | | The CMake build system had missed this macro as part of the build of the builtins. This would result in the builtins exporting symbols which are implemented in assembly with global visibility. Ensure that the assembly optimized routines are given the same visibility as the C routines. llvm-svn: 285477
* [ARM RT] Fix broken clear_cache debug build on ARMRenato Golin2016-10-261-0/+6
| | | | | | | | | clear_cache is using R7 for the SVC call and that's the frame pointer in GCC, which is only disabled on -O2/3, so Release builds finish, Debug don't. Fixes PR30797. llvm-svn: 285204
* [CMake] Add option (defaulted off) to exclude atomic.cChris Bieneman2016-09-011-1/+5
| | | | | | The atomic builtin source is problematic when cross-compiling builtins because it requires a variable and sometimes large set of system headers. This option allows users to optionally prevent it from being built. llvm-svn: 280416
* [builtins] Don't always use -ffreestanding when compiling builtinsFrancis Ricci2016-08-231-1/+0
| | | | | | This can break on some sysroots. Let the user define it if necessary. llvm-svn: 279496
* [compiler-rt] Use flags found when configuring builtins during compilationFrancis Ricci2016-08-221-2/+15
| | | | | | | | | | | | Summary: This fixes the omission of -fPIC when building the builtins. Reviewers: compnerd, beanz Subscribers: dberris, llvm-commits Differential Revision: https://reviews.llvm.org/D23729 llvm-svn: 279469
* [CMake] Renaming test variable to be consistentChris Bieneman2016-08-151-1/+1
| | | | | | Based on post-commit review by compnerd. llvm-svn: 278728
* [CMake] If the compiler supports _Atomic include atomic.c in builtins librariesChris Bieneman2016-08-121-2/+6
| | | | | | This fixes a long-standing TODO by implementing a compiler check for supporting the _Atomic keyword. If the _Atomic keyword is supported by the compiler we should include it in the builtin library sources. llvm-svn: 278454
* builtins: better categorisation of Thumb1 builtinsSaleem Abdulrasool2016-08-051-11/+18
| | | | | | | Adjust the builtins to better annotate the Thumb1 routines and their purpose. Exclude the remaining thumb1 sources on Windows ARM. llvm-svn: 277828
* builtins: split out the EABI and VFP ARM sourcesSaleem Abdulrasool2016-08-041-43/+55
| | | | | | | | These are meant to only be included on certain targets. This only disables it for Windows ARM for now. Ideally these would be conditionally included as appropriate. llvm-svn: 277777
* [CMake] Load LLVMConfig for standalone build of builtinsJonas Hahnfeld2016-08-021-0/+4
| | | | | | | | Therefore move some code into reusable macros. Differential Revision: https://reviews.llvm.org/D22866 llvm-svn: 277418
* Revert "Enable cross-compilation across architectures on android"Chris Bieneman2016-07-251-1/+1
| | | | | | | | | | | | | | This reverts commit r276333. As I commented in the review (https://reviews.llvm.org/D22415), this change isn't needed because CMAKE_C_FLAGS is implicitly added by CMake to the command line for all C source files. With this patch enabled CMAKE_C_FLAGS is duplicated on all C sources, and applied to ASM sources, which is not ideal. I sent an email about this to llvm-commits on the commit thread. I suspect the problem the patch author was actually seeing is that CMAKE_C_FLAGS isn't applied to ASM files, and the builtins library has quite a few of those. The correct solution there is to specify CMAKE_ASM_FLAGS with whatever flags need to be passed to the compiler when compiling ASM files. If there are other problems with flag propagation, please let me know. llvm-svn: 276683
* Enable cross-compilation across architectures on androidFrancis Ricci2016-07-211-1/+1
| | | | | | | | | | | | | | | Summary: This patch fixes cross-architecture compilation, by allowing flags like -target and --sysroot to be set for architecture testing and compilation. Reviewers: tberghammer, srhines, danalbert, beanz, compnerd Subscribers: tberghammer, llvm-commits, danalbert Differential Revision: https://reviews.llvm.org/D22415 llvm-svn: 276333
* Add runtime support for __cpu_model (__builtin_cpu_supports)Alina Sbirlea2016-07-141-1/+2
| | | | | | | | | | | | | | | | | | | | | Summary: This aims to add support for __cpu_model and address Bug 25510. It uses the code from lib/Support/Host.cpp for cpu detection, and creates __cpu_model with that info. Tested on OSX and built on Linux as well (though libgcc is the default). The use of "asm" required -std=gnu99, hence the cmake change. Corrections on better addressing this are welcome. Previously reverted, up for review again to iron out outstanding issues. Reviewers: llvm-commits, joerg, echristo, mehdi_amini Subscribers: mehdi_amini Differential Revision: http://reviews.llvm.org/D22181 llvm-svn: 275484
* [compiler-rt] Fix VisualStudio virtual folders layoutEtienne Bergeron2016-07-111-0/+1
| | | | | | | | | | | | | | | | | | | | Summary: This patch is a refactoring of the way cmake 'targets' are grouped. It won't affect non-UI cmake-generators. Clang/LLVM are using a structured way to group targets which ease navigation through Visual Studio UI. The Compiler-RT projects differ from the way Clang/LLVM are grouping targets. This patch doesn't contain behavior changes. Reviewers: kubabrecka, rnk Subscribers: wang0109, llvm-commits, kubabrecka, chrisha Differential Revision: http://reviews.llvm.org/D21952 llvm-svn: 275111
* Revert "Add runtime support for __cpu_model (__builtin_cpu_supports)"Alina Sbirlea2016-07-081-2/+1
| | | | | | This reverts commit r274873 until additional fixes are resolved. llvm-svn: 274944
* Add runtime support for __cpu_model (__builtin_cpu_supports)Alina Sbirlea2016-07-081-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This aims to add support for __cpu_model and address Bug 25510. It uses the code from lib/Support/Host.cpp for cpu detection, and creates __cpu_model with that info. Tested on OSX, it builts successfully, but the current version does *not* resolve Bug 25510. The __cpu_model symbol is present in the library but it only gets loaded with -all_load. This patch will not land until this issue is clarified. Built on Linux as well (though libgcc is the default). The use of "asm" required -std=gnu99, hence the cmake change. Corrections on better addressing this are welcome. Note: See additional comments on D20988 (committed as r271921). Reviewers: llvm-commits, joerg, echristo, mehdi_amini Subscribers: mehdi_amini Differential revision: http://reviews.llvm.org/D21033 llvm-svn: 274873
* Revert r274865-r274870Alina Sbirlea2016-07-081-2/+1
| | | | llvm-svn: 274872
* Add runtime support for __cpu_model (__builtin_cpu_supports)Alina Sbirlea2016-07-081-1/+2
| | | | | | | | | | | | | | | | | | | Summary: This aims to add support for __cpu_model and address Bug 25510. It uses the code from lib/Support/Host.cpp for cpu detection, and creates __cpu_model with that info. Tested on OSX, it builts successfully, but the current version does *not* resolve Bug 25510. The __cpu_model symbol is present in the library but it only gets loaded with -all_load. This patch will not land until this issue is clarified. Built on Linux as well (though libgcc is the default). The use of "asm" required -std=gnu99, hence the cmake change. Corrections on better addressing this are welcome. Note: See additional comments on D20988 (committed as r271921). Reviewers: llvm-commits, joerg, echristo, mehdi_amini Subscribers: mehdi_amini Differential Revision: http://reviews.llvm.org/D21033 llvm-svn: 274865
* [CMake] Update to requiring CMake 3.4.3Chris Bieneman2016-05-311-1/+1
| | | | | | | | | | | | | | Summary: This is as per the discussions on developer lists: http://lists.llvm.org/pipermail/llvm-dev/2016-April/098780.html http://lists.llvm.org/pipermail/llvm-dev/2016-May/100058.html Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D20824 llvm-svn: 271327
* [CMake] Support platform building builtins without a full toolchainChris Bieneman2016-05-091-1/+19
| | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds support for building lib/builtins without a fully functioning toolchain. It allows you to bootstrap a cross-compiler, which previously couldn't be done with CMake. This patch contains the following specific changes: * Split builtin-specific code out of config-ix.cmake into builtin-config-ix.cmake * Split some common CMake functionality needed by both builtins and sanitizers into base-config-ix.cmake * Made lib/builtins/CMakeLists.txt able to be a top-level CMake configuration I have tested this on Darwin targeting embedded Darwin, and on FreeBSD x86_64 targeting FreeBSD AArch64. This patch depends on http://reviews.llvm.org/D19692, and is the last part of http://reviews.llvm.org/D16653. Reviewers: samsonov, iains, jroelofs Subscribers: compnerd, aemerson, tberghammer, danalbert, srhines, emaste, llvm-commits Differential Revision: http://reviews.llvm.org/D19742 llvm-svn: 268977
* [CMake] Add partial support for MSVC in compiler-rt builtins, by Roman Shirokiy.Andrey Turetskiy2016-02-201-4/+14
| | | | | | | | This enables MSVC build of complex number arithmetic compiler-rt builtins. Differential Revision: http://reviews.llvm.org/D17452 llvm-svn: 261432
* [asan] Add iOS support.Anna Zaks2016-02-021-0/+1
| | | | llvm-svn: 259451
* [WebAssembly] Enable the builtins library for WebAssembly.Dan Gohman2016-01-131-0/+3
| | | | llvm-svn: 257619
* builtins: Build emutls.c on MINGW buildsSumanth Gundapaneni2015-12-011-1/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D15083 llvm-svn: 254470
* Add a generic version of __divtc3.c for long double complex division.Joerg Sonnenberger2015-11-221-0/+1
| | | | | | Mark the unit test as applying to all platforms. llvm-svn: 253831
* Silence "unrecognised -std=c99" warning on MSVC.George Burgess IV2015-11-201-1/+3
| | | | | | | | Thanks to angelsl for the patch! Differential Revision: http://reviews.llvm.org/D13692 llvm-svn: 253646
* [CMake] [builtins] Removing a few non-source files from the arm list.Chris Bieneman2015-11-121-2/+0
| | | | | | I was a little too aggressive about adding sources from the arm subdirectory. llvm-svn: 252929
* [CMake] Actually adding the TODO comment I mentioned in r252927.Chris Bieneman2015-11-121-0/+3
| | | | | | Turns out you need to save before committing. llvm-svn: 252928
* [CMake] [builtins] Adding missing architecture-specific builtins.Chris Bieneman2015-11-121-0/+8
| | | | | | Also added a TODO comment to make the build system throw an error if the CMakeLists gets out of sync again. llvm-svn: 252927
* Fix r251928 build errorMartell Malone2015-11-031-2/+2
| | | | llvm-svn: 251931
* Support for 32-bit mingw-w64 in compiler-rt.Martell Malone2015-11-031-0/+2
| | | | | | | | | | | | Add chkstk/alloca for gcc objects. Replace or instructions with test, the latter should be marginally more efficent, as it does not write to memory. Differential Revision: http://reviews.llvm.org/D14044 Patch by vadimcn llvm-svn: 251928
* builtins: use C implementation on MSVCSaleem Abdulrasool2015-10-151-36/+49
| | | | | | | | | The assembly implementations use GNU syntax which MSVC doesn't handle. Rather than duplicate the code in a second syntax, use the C implementations. Patch by Tee Hao Wei! llvm-svn: 250360
* Revert "builtins: enable builtins build for MSVC"Saleem Abdulrasool2015-10-111-1/+1
| | | | | | | | Revert once more. This seems to fail to build on the buildbots which build with ninja rather than MSBuild/Visual Studio. This requires further build infrastructure changes to deal with the assembly routines. llvm-svn: 250001
* Revert "Revert "builtins: enable builtins build for MSVC""Saleem Abdulrasool2015-10-111-1/+1
| | | | | | | Previous changes should now permit building on MSVC 2013 in addition to MSVC 2015. llvm-svn: 250000
* Revert "builtins: enable builtins build for MSVC"Saleem Abdulrasool2015-10-101-1/+1
| | | | | | | Seems to break on the sanitizer buildbot. Revert until it can be fixed properly. llvm-svn: 249950
OpenPOWER on IntegriCloud