summaryrefslogtreecommitdiff
path: root/lib/builtins
AgeCommit message (Collapse)Author
2016-09-27builtins: use thumb-2 if possible on comparesf2Saleem Abdulrasool
This code can be built with thumb-2 like many of the other builtin routines. Enable that here as well. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@282530 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-07builtins: make sure that flags is setup properly for __clear_cacheSaleem Abdulrasool
On Linux ARM, the syscall will take 3 arguments (start, end, flags). Ensure that we do not pass garbage to the flags, which can cause the cacheflush call to fail, and therefore cause an abort at runtime. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@280877 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01[CMake] Add option (defaulted off) to exclude atomic.cChris Bieneman
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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@280416 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-23Delete remaining compiler-rt makefilesChris Bieneman
Summary: Since we can now build the builtins without a full toolchain these files should no longer be needed. This is the last vestige of autoconf! Reviewers: compnerd, iains, jroelofs Subscribers: dberris, llvm-commits Differential Revision: https://reviews.llvm.org/D23777 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279539 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-23[builtins] Don't always use -ffreestanding when compiling builtinsFrancis Ricci
This can break on some sysroots. Let the user define it if necessary. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279496 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-22[compiler-rt] Use flags found when configuring builtins during compilationFrancis Ricci
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279469 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-15[CMake] Renaming test variable to be consistentChris Bieneman
Based on post-commit review by compnerd. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@278728 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-12[CMake] If the compiler supports _Atomic include atomic.c in builtins librariesChris Bieneman
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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@278454 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-05builtins: better categorisation of Thumb1 builtinsSaleem Abdulrasool
Adjust the builtins to better annotate the Thumb1 routines and their purpose. Exclude the remaining thumb1 sources on Windows ARM. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@277828 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-04builtins: split out the EABI and VFP ARM sourcesSaleem Abdulrasool
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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@277777 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-02[CMake] Load LLVMConfig for standalone build of builtinsJonas Hahnfeld
Therefore move some code into reusable macros. Differential Revision: https://reviews.llvm.org/D22866 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@277418 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-01Use 'unsigned long' to match the APIs of the MS bitscan intrinsicsReid Kleckner
We were getting warnings about how 'uint32_t*' is different from 'unsigned long*' even though they are effectively the same on Windows. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@277363 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-25Revert "Enable cross-compilation across architectures on android"Chris Bieneman
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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@276683 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21Enable cross-compilation across architectures on androidFrancis Ricci
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@276333 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-17[compiler-rt] Change all asm directives to __asm__ in cpu_model.Alina Sbirlea
Summary: Aiming to resolve failure in sanitizer bot by changning all asm directives to __asm__. Also, consistency. Reviewers: llvm-commits, echristo, vitalybuka Subscribers: mehdi_amini Differential Revision: https://reviews.llvm.org/D22446 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@275740 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14Add runtime support for __cpu_model (__builtin_cpu_supports)Alina Sbirlea
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@275484 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-13[RT-ARM] Syntax unified for aeabi_mem* functionsRenato Golin
Use unified syntax for builtins/arm/aeabi_mem*.S. This makes these files consistent with the others. This fixes a problem on the linker, which can fail with the message "relocation truncated to fit: R_ARM_THM_JUMP11 against symbol" Patch by Kor Nielsen. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@275264 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-11[compiler-rt] Fix VisualStudio virtual folders layoutEtienne Bergeron
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@275111 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-08Revert "Add runtime support for __cpu_model (__builtin_cpu_supports)"Alina Sbirlea
This reverts commit r274873 until additional fixes are resolved. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274944 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-08Add runtime support for __cpu_model (__builtin_cpu_supports)Alina Sbirlea
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274873 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-08Revert r274865-r274870Alina Sbirlea
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274872 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-08Added comments identifing code sourceAlina Sbirlea
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274870 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-08Check cpuid supported for i386.Alina Sbirlea
Summary: Reviewers: Subscribers: git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274868 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-08Add default initialization. Add unit test.Alina Sbirlea
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274867 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-08clang-format itAlina Sbirlea
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274866 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-08Add runtime support for __cpu_model (__builtin_cpu_supports)Alina Sbirlea
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274865 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22builtins: tag with noexecstackSaleem Abdulrasool
These routines do not require executable stacks. However, by default ELFish linkers may assume an executable stack on GNUish environments (and some non-GNU ones too!). The GNU extension to add a note to indicate a non-executable stack is honoured by these environments to mark the stack as non-executable (the compiler normally emits this directive on appropriate targets whenever possible). This allows normal builds from getting executable stacks due to linking to the compiler rt builtins. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@273500 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-13[builtins] Make SOFT_FP versions of floatdidf and floatundidf compileJeroen Ketema
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@272551 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-13[builtins] replace tabs by spaces and remove whitespace at end of line NFCJeroen Ketema
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@272550 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-31[CMake] Update to requiring CMake 3.4.3Chris Bieneman
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@271327 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09[CMake] Support platform building builtins without a full toolchainChris Bieneman
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@268977 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-20builtins: fix -Werror,-Wunused-variable warningSaleem Abdulrasool
This removes the unused variable `flags`. NFC git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@266892 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-20builtins: remove use of __attribute__((pcs("aapcs"))) on WindowsSaleem Abdulrasool
Windows does not honour the __attribute__((pcs)) on ARM. Although this will result in ABI mismatches, compiler-rt should largely be unneeded for resolving dependencies as we generate MS ABI compliant library calls now for the most part. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@266891 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-14Fix StaticAnalyzer complaints. NFC.George Burgess IV
Clang's StaticAnalyzer seems to (correctly) complain about code like: T *p = calloc(sizeof(U), N); ...Where T and U are different types. This patch removes some instances of this pattern from compiler-rt. Patch by Apelete Seketeli. Differential Revision: http://reviews.llvm.org/D19085 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@266388 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-29[Darwin] [Builtins] Cleaning up OS X exclude lists. NFC.Chris Bieneman
This just gets rid of a bunch of empty object file warnings. It doesn't impact the generated archives. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264751 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-29[Darwin] [Builtins] Remove multi3 from the exclude list.Chris Bieneman
This addresses PR27077. For some historical reason Darwin wasn't shipping multi3 in the compiler builtin library or in the OS builtin library. This caused building ffmpeg to fail because Polly was generating calls to multi3. It is easy enough to just add the builtin. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264750 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-29[Darwin] [Builtins] Cleaning up 10.4 exclude lists NFCChris Bieneman
This just gets rid of a bunch of empty object file warnings. It doesn't impact the generated archives. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264749 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-18builtins: make __clear_cache work on Linux-ARMSaleem Abdulrasool
__clear_cache on Android is identical to the version on Linux. Use __linux__ instead of __ANDROID__ as __linux__ is defined for Linux and Android. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@263833 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-18builtins: port __clear_cache to Windows ARMSaleem Abdulrasool
Support __clear_cache on Windows on ARM using the `FlushInstructionCache` library call. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@263832 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-09Add ARM EHABI support to gcc_personality_v0.Logan Chien
Until now the only exception APIs supported by gcc_personality_v0 are DWARF EH and SJLJ. This adds support for ARM EHABI as well. This is achieved by a) changing the function signature on ARM EHABI, b) unwinding the stack before returning _URC_CONTINUE_UNWIND. See "Exception Handling ABI for the ARM Architecture" for details (http://infocenter.arm.com/help/topic/com.arm.doc.ihi0038b/IHI0038B_ehabi.pdf). Patch by Timon Van Overveldt. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@263010 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-25builtins: adjust the clobbers list for android __clear_cacheSaleem Abdulrasool
Adjust the clobbers list. This use to work with older versions of gcc, but now will error on newer versions (tested against 5.3) (as well as clang). Patch by Tee Hao Wei! git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@261821 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20[CMake] Add partial support for MSVC in compiler-rt builtins, by Roman Shirokiy.Andrey Turetskiy
This enables MSVC build of complex number arithmetic compiler-rt builtins. Differential Revision: http://reviews.llvm.org/D17452 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@261432 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04builtins: Fix struct __emutls_control to match GCCChih-Hung Hsieh
The type of size and align in struct __emutls_control must be typedef unsigned int gcc_word __attribute__((mode(word))); to match GCC. When gcc_word is larger than size_t, which is the case for x32, the upper extra bits are all zeros. We can use variables of size_t to operate on size and align. Fix one trivial C99 warning about mixed declaration and code. Differential Revision: http://reviews.llvm.org/D16886 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@259824 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-13[WebAssembly] Enable the builtins library for WebAssembly.Dan Gohman
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257619 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13[WebAssembly] clang supports int128_t on wasm32 in addition to wasm64.Dan Gohman
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257618 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-22fix a gcc warningNico Weber
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256256 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01builtins: Fix the sysroot's reference to si_int in int_types.hSumanth Gundapaneni
si_int is already defined in sysroot's siginfo.h emutls.c includes pthread.h which includes asm/siginfo.h which in turn includes asm-generic/siginfo.h and that defines si_int. si_int is also defined in builtin's int_types.h and this leads to errors. This patch fixes the issue by undefining the si_int in int_types.h Differential Revision: http://reviews.llvm.org/D15086 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@254472 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01builtins: Build emutls.c on MINGW buildsSumanth Gundapaneni
Differential Revision: http://reviews.llvm.org/D15083 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@254470 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-22Add a generic version of __divtc3.c for long double complex division.Joerg Sonnenberger
Mark the unit test as applying to all platforms. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@253831 91177308-0d34-0410-b5e6-96231b3b80d8