aboutsummaryrefslogtreecommitdiff
path: root/lib/libcompiler_rt
Commit message (Collapse)AuthorAgeFilesLines
* Build compiler-rt against libunwind, not libcxxrtDimitry Andric2022-03-091-1/+1
| | | | | | | | | Parts of compiler-rt are also built for libgcc_eh and libgcc_s, and these were already pointing to the libunwind unwind.h. For the sake of consistency, also build compiler-rt itself against the libunwind unwind.h, not the libcxxrt one. MFC after: 3 days
* Merge llvm-project release/13.x llvmorg-13.0.0-rc1-97-g23ba3732246aDimitry Andric2021-11-131-0/+3
| | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvmorg-13.0.0-rc1-97-g23ba3732246a. PR: 258209 MFC after: 2 weeks
* compiler-rt: add aarch64 init function for LSE atomicsDimitry Andric2021-09-061-2/+3
| | | | | | | | | | | | | | | | | As reported by Ronald, adding the out-of-line LSE atomics helpers for aarch64 to compiler-rt was not sufficient to link programs using these, as they also require a __aarch64_have_lse_atomics global. This is initialized in compiler-rt's lib/builtins/cpu_model.c, roughly similar to the x86 CPU model and feature detection in that file. Since upstream does not yet have a FreeBSD specific implementation for getting the required information, add a simple one that should work for now, while I try to get it sorted with the LLVM people. Reported by: Ronald Klop <ronald-lists@klop.ws> Fixes: cc55ee8009a5 PR: 257392 MFC after: 2 weeks
* compilert-rt: build out-of-line LSE atomics helpers for aarch64Dimitry Andric2021-07-281-0/+20
| | | | | | | | | | | | | | | Both clang >= 12 and gcc >= 10.1 now default to -moutline-atomics for aarch64. This requires a bunch of helper functions in libcompiler_rt.a, to avoid link errors like "undefined symbol: __aarch64_ldadd8_acq_rel". (Note: of course you can use -mno-outline-atomics as a workaround too, but this would negate the potential performance benefit of the faster LSE instructions.) Bump __FreeBSD_version so ports maintainers can easily detect this. PR: 257392 MFC after: 2 weeks
* Rename NO_WERROR -> MK_WERROR=noAlex Richardson2021-01-071-1/+1
| | | | | | | | As suggested in D27598. This also supports MK_WERROR.clang=no and MK_WERROR.gcc=no to support the existing NO_WERROR.<compiler> uses. Reviewed By: brooks Differential Revision: https://reviews.freebsd.org/D27601
* libcompiler_rt: stop building with stack smashing protectionRyan Libby2020-12-281-0/+1
| | | | | | | | | | | | libcompiler_rt implements certain functions that clang and gcc emit calls to as part of their codegen (e.g. for extended width math). Build it without stack smashing protection (SSP, -fstack-protector) in order to support building binaries without SSP, especially the dynamic linker. Besides, SSP is probably not very valuable in this library. Reviewed by: arichardson, dim, kib Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D27786
* Follow-up r364753 by only using arm's stdatomic.c implementation, as itDimitry Andric2020-09-101-1/+2
| | | | | | | | | | | | already covers the functions in compiler-rt's atomic.c, leading to conflicts when linking. PR: 230888 MFC after: 3 days X-MFC-With: r364753 Notes: svn path=/head/; revision=365588
* Follow-up r364753 by enabling compiler-rt's atomic implementation onlyDimitry Andric2020-09-091-1/+6
| | | | | | | | | | | | | for clang, as it uses clang specific builtins, and does not compile correctly with gcc. Note that gcc packages usually come with their own libatomic, providing these primitives. PR: 230888 MFC after: 3 days X-MFC-With: r364753 Notes: svn path=/head/; revision=365509
* After r364753, there should be no need to suppress -Watomic-alignmentDimitry Andric2020-08-251-6/+0
| | | | | | | | | | | | | warnings anymore for compiler-rt's atomic.c. This occurred because the IS_LOCK_FREE_8 macro was not correctly defined to 0 for mips, and this caused the compiler to emit a runtime call to __atomic_is_lock_free(), and that triggers the warning. MFC after: 2 weeks X-MFC-With: r364753 Notes: svn path=/head/; revision=364782
* Add atomic and bswap functions to libcompiler_rtDimitry Andric2020-08-251-14/+9
| | | | | | | | | | | | | | | | | | | | | | There have been several mentions on our mailing lists about missing atomic functions in our system libraries (e.g. __atomic_load_8 and friends), and recently I saw __bswapdi2 and __bswapsi2 mentioned too. To address this, add implementations for the functions from compiler-rt to the system compiler support libraries, e.g. libcompiler_rt.a and and libgcc_s.so. This also needs a small fixup in compiler-rt's atomic.c, to ensure that 32-bit mips can build correctly. Bump __FreeBSD_version to make it easier for port maintainers to detect when these functions were added. MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D26159 Notes: svn path=/head/; revision=364753
* Avoid adding duplicates to SRCS/OBJS/SOBJS/POBJSAlex Richardson2020-08-241-1/+0
| | | | | | | | | | | | | | | | | This is a change in preparation for stopping to use lorder.sh (D26044) and instead assume that we have a linker newer than ~1990. Without lorder.sh duplicates end up being passed to the linker when building .so files and this can result in duplicate symbol definition errors. There is one minor change: libcompiler_rt.a will no longer provide gcc_personality_v0 and instead we now only have it in libgcc_eh.a/libgcc_s.so. This matches GCC's behaviour. Reviewed By: emaste, cem Differential Revision: https://reviews.freebsd.org/D26042 Notes: svn path=/head/; revision=364649
* Merge ^/head r357662 through r357854.Dimitry Andric2020-02-131-2/+1
|\ | | | | | | Notes: svn path=/projects/clang1000-import/; revision=357855
| * Remove sparc64 specific inclusion of bswap32 built-ins.Warner Losh2020-02-121-2/+1
| | | | | | | | Notes: svn path=/head/; revision=357798
* | Add internal floating point environment builtins to libcompiler_rt andDimitry Andric2020-01-281-2/+8
| | | | | | | | | | | | | | libgcc, as these are used in a few other builtin implementations. Notes: svn path=/projects/clang1000-import/; revision=357221
* | Sort libcompiler_rt sources.Dimitry Andric2020-01-271-1/+1
|/ | | | Notes: svn path=/projects/clang1000-import/; revision=357177
* [PowerPC] enable atomic.c in compiler_rt and do not check and forcesJustin Hibbits2019-12-261-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | lock/lock_free decisions in compiled time Summary: Enables atomic.c in compiler_rt and forces clang to not emit a call for runtime decision about lock/lock_free. At compiling time, if clang can't decide if atomic operation can be lock free, it emits calls to external functions like `__atomic_is_lock_free`, `__c11_atomic_is_lock_free` and `__atomic_always_lock_free`, postponing decision to a runtime check. According to LLVM code documentation, the mechanism exists due to differences between x86_64 processors that can't be decided at runtime. On PowerPC and PowerPCSPE (32 bits), we already know in advance it can't be lock free, so we force the decision at compile time and avoid having to implement it in an external library. This patch was made after 32 bit users testing the PowePC32 bit ISO reported llvm could not be compiled with in-base llvm due to `__atomic_load8` not implemented. Submitted by: alfredo.junior_eldorado.org.br Reviewed by: jhibbits, dim Differential Revision: https://reviews.freebsd.org/D22549 Notes: svn path=/head/; revision=356104
* Move all sources from the llvm project into contrib/llvm-project.Dimitry Andric2019-12-201-1/+1
| | | | | | | | | | | | | This uses the new layout of the upstream repository, which was recently migrated to GitHub, and converted into a "monorepo". That is, most of the earlier separate sub-projects with their own branches and tags were consolidated into one top-level directory, and are now branched and tagged together. Updating the vendor area to match this layout is next. Notes: svn path=/head/; revision=355940
* Define __SOFT_FP__ for riscv64sf to avoid infinite recursion.John Baldwin2019-12-041-0/+4
| | | | | | | | | | Submitted by: James Clarke <jrtc27@jrtc27.com> Reviewed by: imp Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D22660 Notes: svn path=/head/; revision=355401
* Fix llvm-libunwind userspace build on ARMConrad Meyer2019-11-051-4/+0
| | | | | | | | | | | | | | | | | | | | GCC's libgcc exports a few ARM-specific symbols for ARM EABI, AEABI, or EHABI or whatever it's called. Export the same ones from LLVM-libunwind's libgcc_s, on ARM. As part of this, convert libgcc_s from a direct Version.map to one constructed from component Symbol.map files. This allows the ARM-specific Symbol.map to be included only on ARM. Fix ARM-only oddities in struct name/aliases in LLVM-libunwind to match non-ARM definitions and ARM-specific expectations in libcxxrt / libcompiler_rt. No functional change intended for non-ARM architectures. This commit does not actually flip the switch for ARM defaults from libgcc to llvm-libunwind, but makes it possible (to compile, anyway). Notes: svn path=/head/; revision=354347
* Update build glue for building compiler-rt.Dimitry Andric2019-08-291-2/+4
| | | | Notes: svn path=/projects/clang900-import/; revision=351612
* compiler-rt: enable __bswapsi2/__bswapdi2 for RISC-VEd Maste2019-08-141-1/+2
| | | | | | | | | | | As with other archs the compiler may emit calls to the byte swap routines under certain conditions. MFC after: 1 week Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=351040
* The routines defined in comparedf2 and comparesf2 are defined in libcWarner Losh2018-02-021-1/+1
| | | | | | | for softfloat mips. No need to include them here. Notes: svn path=/head/; revision=328768
* Support armv7 builds for userlandWarner Losh2017-10-051-1/+1
| | | | | | | | | | | | | | | | | | | Make armv7 as a new MACHINE_ARCH. Copy all the places we do armv6 and add armv7 as basically an alias. clang appears to generate code for armv7 by default. armv7 hard float isn't supported by the the in-tree gcc, so it hasn't been updated to have a new default. Support armv7 as a new valid MACHINE_ARCH (and by extension TARGET_ARCH). Add armv7 to the universe build. Differential Revision: https://reviews.freebsd.org/D12010 Notes: svn path=/head/; revision=324340
* Follow-up to r323001: if the actually selected CPUTYPE is capable ofDimitry Andric2017-08-301-2/+2
| | | | | | | | | | | | SSE2 instructions, we can use them. Suggested by: jkim PR: 221733 MFC after: 1 week X-MFC-With: r323001 Notes: svn path=/head/; revision=323014
* In compiler-rt, a few assembler implementations for i386 floating pointDimitry Andric2017-08-291-6/+17
| | | | | | | | | | | | | | conversion functions use SSE2 instructions, but these are not guarded by #ifdef __SSE2__, and there is no implementation using general purpose registers. For these functions, use the generic C variants instead, otherwise they will cause SIGILL on older processors. Reported by: bsdpr@phoe.frmug.org PR: 221733 MFC after: 1 week Notes: svn path=/head/; revision=323001
* Include {u,}{div,mod}si3() on mips in libcompiler_rt.John Baldwin2017-08-211-7/+4
| | | | | | | | | | | These builtins were listed in the mips-specific Symbol.map for libc but were not implemented. Compiling mips with recent clang requires these symbols. Sponsored by: DARPA / AFRL Notes: svn path=/head/; revision=322766
* There is no MACHINE_CPUARCH == armv6, remove redunant check.Warner Losh2017-08-141-1/+1
| | | | Notes: svn path=/head/; revision=322522
* Merge ^/head r320573 through r320970.Dimitry Andric2017-07-131-3/+2
|\ | | | | | | Notes: svn path=/projects/clang500-import/; revision=320971
| * compiler_rt: provide bswap buildins on sparc64Ed Maste2017-07-061-3/+2
| | | | | | | | | | | | | | | | Attempting to build sparc64 world with GCC 6.3 previously failed with zstd_compress.c:(.text+0x8fc): undefined reference to `__bswapsi2' Notes: svn path=/head/; revision=320735
* | Merge ^/head r318560 through r318657.Dimitry Andric2017-05-221-0/+7
|\| | | | | | | Notes: svn path=/projects/clang500-import/; revision=318658
| * [libcompiler-rt] add bswapdi2/bswapsi2Adrian Chadd2017-05-211-0/+7
| | | | | | | | | | | | | | | | | | | | | | This is required for mips gcc 6.3 userland to build/run. Reviewed by: emaste, dim Approved by: emaste Differential Revision: https://reviews.freebsd.org/D10838 Notes: svn path=/head/; revision=318601
* | Merge compiler-rt trunk r300890, and update build glue.Dimitry Andric2017-04-221-1/+1
|/ | | | Notes: svn path=/projects/clang500-import/; revision=317285
* Add an implementation of __ffssi2() derived from __ffsdi2().John Baldwin2017-04-051-0/+1
| | | | | | | | | | | | | Newer versions of GCC include an __ffssi2() symbol in libgcc and the compiler can emit calls to it in generated code. This is true for at least GCC 6.2 when compiling world for mips and mips64. Reviewed by: jmallett, dim Sponsored by: DARPA / AFRL Differential Revision: https://reviews.freebsd.org/D10086 Notes: svn path=/head/; revision=316511
* Gcc has incompatible internal declarations for __divtc3 and __multc3 asDimitry Andric2017-03-211-0/+4
| | | | | | | | | | | defined in compiler-rt, but it has no option to silence its warning, so make gcc warnings for libcompiler_rt non-fatal. Noticed by: lwhsu MFC after: 3 days Notes: svn path=/head/; revision=315689
* Remove an assembler flag, which is redundant since r309124. The upstreamJung-uk Kim2017-02-231-6/+0
| | | | | | | | | | | took care of it by introducing a macro NO_EXEC_STACK_DIRECTIVE. http://llvm.org/viewvc/llvm-project?rev=273500&view=rev Reviewed by: dim Notes: svn path=/head/; revision=314152
* Update compiler-rt to release_39 branch r288513. Since this contains aDimitry Andric2016-12-021-0/+4
| | | | | | | | | rather unfortunate upstream workaround for an unwind header problem that does not exist on FreeBSD, but which causes an unnecessary warning for us, add some flags to the compiler-rt Makefile to suppress the warning. Notes: svn path=/projects/clang391-import/; revision=309441
* Merge ^/head r308491 through r308841.Dimitry Andric2016-11-191-3/+4
|\ | | | | | | Notes: svn path=/projects/clang390-import/; revision=308842
| * Add full softfloat and hardfloat support for RISC-V.Ruslan Bukin2016-11-161-3/+4
| | | | | | | | | | | | | | | | | | | | | | Hardfloat is now default (use riscv64sf as TARGET_ARCH for softfloat). Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D8529 Notes: svn path=/head/; revision=308731
* | Merge ^/head r308227 through r308490.Dimitry Andric2016-11-101-2/+5
|\| | | | | | | Notes: svn path=/projects/clang390-import/; revision=308491
| * o Add support for long double.Ruslan Bukin2016-11-031-2/+5
| | | | | | | | | | | | | | | | | | | | o Add support for latest RISC-V GNU toolchain. Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Notes: svn path=/head/; revision=308251
* | Merge ^/head r306303 through 306411.Ed Maste2016-09-282-219/+222
|\| | | | | | | Notes: svn path=/projects/clang390-import/; revision=306412
| * libcompiler_rt: move file list to Makefile.inc for reuse elsewhereEd Maste2016-09-272-217/+217
| | | | | | | | | | | | | | | | | | | | | | | | Also switch to the style used in the clang390-import branch to reduce future conflicts. Reviewed by: dim Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D8039 Notes: svn path=/head/; revision=306377
| * libcompiler_rt: use ${SRCTOP} for the top of the FreeBSD treeEd Maste2016-09-231-2/+2
| | | | | | | | Notes: svn path=/head/; revision=306266
* | Fix building some arm-specific primitives for libcompiler_rt. This wasDimitry Andric2016-09-051-16/+16
| | | | | | | | | | | | | | an unfortunate search and replace error. Notes: svn path=/projects/clang390-import/; revision=305428
* | Update compiler-rt to 3.9.0 release, and update the build glue forDimitry Andric2016-09-031-194/+197
|/ | | | | | | libcompiler_rt and libclang_rt. Notes: svn path=/projects/clang390-import/; revision=305364
* Make armv6 hard float abi by default. Kill armv6hf.Warner Losh2016-05-181-2/+3
| | | | | | | | | | Allow CPUTYPE=soft to build the current soft-float abi libraries. Add UPDATING entry to announce this. Approved by: re@ (gjb) Notes: svn path=/head/; revision=300119
* MFHGlen Barber2016-03-061-0/+1
|\ | | | | | | | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=296422
| * Merge compiler-rt release_38 branch r258968.Dimitry Andric2016-02-061-0/+1
| | | | | | | | | | | | | | | | Note that there is still a problem on amd64, causing SIGBUS in the early startup of Address Sanitizer. This is being investigated. Notes: svn path=/projects/clang380-import/; revision=295349
* | First pass through library packaging.Glen Barber2016-02-041-0/+1
|/ | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=295278
* Merge ^/head r288197 through r288456.Dimitry Andric2015-10-011-1/+1
|\ | | | | | | Notes: svn path=/projects/clang370-import/; revision=288457