Up to [cvs.NetBSD.org] / src / lib / libc / compiler_rt
Request diff between arbitrary revisions
Keyword substitution: kv
Default branch: MAIN
more lint for clang.
more clang lint appeasing
lib/libc/compiler_rt/Makefile.inc: Sort LINTFLAGS lines. No functional change intended.
libc: Pacify lint on aarch64.
fix clang lint build.
compiler_rt: allow signed bit shifts for __negv Standard C defines '1 << 31' as undefined behavior, but https://gcc.gnu.org/onlinedocs/gcc/Integers-implementation.html allows it for GCC.
Add vax
more annotation for powerpc
fix more alpha
add lint flags for compiler_rt
libc/compiler_rt: Consistently use LIBC_MACHINE_{ARCH,CPU} Instead of MACHINE_{ARCH,CPU}, respectively. With this change, unnecessary comparetf2.c is no longer compiled in for 32-bit compat libc on aarch64.
libc: switch aarch64 to use softfloat functions from compiler_rt The old definitions in qp.c being all grouped together in one file causes problems when static linking with libgcc (i.e. cc --static-libgcc) due to functions like __trunctfdf2 conflicting with libgcc, as seen in PR 57021 We can also add some missing functions like __fixdfti for converting a double to an int128_t, the lack of which is currently preventing webkit from linking on aarch64, as seen in PR 57022 Unclear to me if libc is the right place for these functions, but we can avoid breaking compatibility right now and maintain the status quo while avoiding some obvious immediate problems. nm output for libc shows no functions being removed by this change.
Pull up following revision(s) (requested by skrll in ticket #1328): sys/external/bsd/compiler_rt/dist/lib/builtins/negsf2.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/muldf3.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/truncdfhf2.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/negsf2.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/muldf3.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/floatdidf.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/arm/aeabi_cfcmpeq_check_nan.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/truncdfhf2.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/floatdidf.c: revision 1.4 sys/external/bsd/compiler_rt/dist/lib/builtins/floatdidf.c: revision 1.5 sys/external/bsd/compiler_rt/dist/lib/builtins/divdf3.c: revision 1.2 sys/external/bsd/compiler_rt/abi.mk: revision 1.1 sys/external/bsd/compiler_rt/dist/lib/builtins/divdf3.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/int_lib.h: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/floatunsisf.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/comparesf2.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/int_lib.h: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/floatunsisf.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/comparesf2.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/int_lib.h: revision 1.4 sys/external/bsd/compiler_rt/dist/lib/builtins/ashrdi3.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/ashldi3.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/truncdfsf2.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/subdf3.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/int_lib.h: revision 1.5 sys/external/bsd/compiler_rt/dist/lib/builtins/ashrdi3.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/ashldi3.c: revision 1.3 sys/lib/libkern/Makefile.compiler-rt: revision 1.13 sys/external/bsd/compiler_rt/dist/lib/builtins/truncdfsf2.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/subdf3.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/int_lib.h: revision 1.6 sys/external/bsd/compiler_rt/dist/lib/builtins/lshrdi3.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/floatsisf.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/extendhfsf2.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/lshrdi3.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/floatsisf.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/extendhfsf2.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/floatunsidf.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/floatunsidf.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/fixdfsi.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/fixdfsi.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/arm/aeabi_frsub.c: revision 1.2 lib/libm/compiler_rt/Makefile.inc: revision 1.11 sys/external/bsd/compiler_rt/dist/lib/builtins/fixunsdfsi.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/floatsidf.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/fixunsdfsi.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/divsi3.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/adddf3.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/floatsidf.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/divsi3.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/adddf3.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/arm/aeabi_div0.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/mulsf3.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/mulsf3.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/fixdfdi.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/fixdfdi.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/divsf3.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/negdf2.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/fixunsdfdi.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/divsf3.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/negdf2.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/fixunsdfdi.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/extendsfdf2.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/subsf3.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/extendsfdf2.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/subsf3.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/comparedf2.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/comparedf2.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/floatundisf.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/floatundisf.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/fixsfsi.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/arm/aeabi_drsub.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/fixsfsi.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/muldi3.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/fixunssfsi.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/arm/aeabi_cdcmpeq_check_nan.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/muldi3.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/fixunssfsi.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/floatdisf.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/floatdisf.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/addsf3.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/addsf3.c: revision 1.3 lib/libc/compiler_rt/Makefile.inc: revision 1.40 sys/external/bsd/compiler_rt/dist/lib/builtins/fixunssfdi.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/fixunssfdi.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/udivsi3.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/truncsfhf2.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/floatundidf.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/fixsfdi.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/udivsi3.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/truncsfhf2.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/floatundidf.c: revision 1.4 sys/external/bsd/compiler_rt/dist/lib/builtins/fixsfdi.c: revision 1.3 PR port-arm/55897 Cherry-pick upstream commit llvm-svn: 266891: https://github.com/llvm/llvm-project/commit/28e1b977d4694c6b3a5c4d8107570a969be71e77#diff-549f1733063df365663fe375f336034e33e16d6bf2826cd4f966045aeb136007 ---- [PATCH] builtins: remove use of __attribute__((pcs("aapcs"))) on Windows 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. llvm-svn: 266891 PR port-arm/55897 Cherry-pick upstream commit llvm-svn: 298974 for lib/builtins/int_lib.h. https://github.com/llvm/llvm-project/commit/d8ca74176e25bd4080ee81982819e2ef7a36553f#diff-549f1733063df365663fe375f336034e33e16d6bf2826cd4f966045aeb136007 ---- [Builtin] Unxfail tests for armhf 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 addresshttps://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 PR port-arm/55897 Cherry-pick upstream commit llvm-svn: 303138: https://github.com/llvm/llvm-project/commit/44c45717b9e9f3dc194508d2eeeb8599a9d76949#diff-549f1733063df365663fe375f336034e33e16d6bf2826cd4f966045aeb136007 ---- [PATCH] builtins: use reserved spelling (NFC) llvm-svn: 303138 PR port-arm/55897 Cherry-pick upstream commit llvm-svn: 303188: https://github.com/llvm/llvm-project/commit/36ac5ddff7377586390a71cb3261f0a40d274308#diff-549f1733063df365663fe375f336034e33e16d6bf2826cd4f966045aeb136007 ---- [PATCH] builtins: expand out the AEABI function stubs These actually may change calling conventions. We cannot simply provide function aliases as the aliased function may have a different calling convention. Provide a forwarding function instead to permit the compiler to synthesize the calling convention adjustment thunk. Remove the `ARM_EABI_FNALIAS` macro as that is not safe to use. Resolves PR33030! llvm-svn: 303188 PR port-arm/55897 Cherry-pick upstream commit llvm-svn: 303207: https://github.com/llvm/llvm-project/commit/4a45838d10085defac0f3b3003a5263e34536f3b#diff-549f1733063df365663fe375f336034e33e16d6bf2826cd4f966045aeb136007 ---- [PATCH] builtins: fix guard __AEABI__ -> __ARM_EABI__ llvm-svn: 303207 PR port-arm/55897 Cherry-pick upstream commit llvm-svn: 314851: https://github.com/llvm/llvm-project/commit/0d586d06a756b126a7eb43a21ecc12bd243d7cd8#diff-549f1733063df365663fe375f336034e33e16d6bf2826cd4f966045aeb136007 ---- [PATCH] [compiler-rt] Add back ARM EABI aliases where legal. r303188 removed all the uses of aliases for EABI functions from compiler-rt, because some of them had mismatched calling conventions. Obviously, we can't use aliases for functions which don't have the same calling convention, but that's only an issue for floating-point functions with the hardfloat ABI. In other cases, the stubs increase size and reduce performance for no benefit. This patch adds back the aliases, with appropriate checks to make sure they're only used in cases where the calling convention matches. llvm-svn: 314851 PR port-arm/55897 Fix ABI mismatch for armhf runtime routines for floating-point arithmetics; For hard-float arm variants, provide (1) generic runtime routines with correct calling convention, and (2) EABI runtime routines at the same time. I've confirmed that no binary changes for kernels. LGTM by skrll
PR port-arm/55897 Fix ABI mismatch for armhf runtime routines for floating-point arithmetics; For hard-float arm variants, provide (1) generic runtime routines with correct calling convention, and (2) EABI runtime routines at the same time. I've confirmed that no binary changes for kernels. LGTM by skrll
Treat aarch64eb the same as aarch64
Restrict usage of m68k assembler versions of {,u}divsi3 and {,u}divsi3 to kernel and bootloader for 68010. They requires a special calling convention to udivsi3, and cannot to be mixed up in normal routines provided by libgcc or compiler_rt. Although, there's no problem for using them in a controlled situation, i.e., kernel and standalone programs. Note that this does not affect at all m68k ports other than sun2, since codes generated by gcc do not call these routines. Assembler files are moved from common/lib/libc/arch/m68k/gen to sys/lib/libkern/arch/m68k in order not to be compiled in libc. Revert hack introduced to lib/libc/compiler_rt/Makefile.inc rev 1.37: http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/compiler_rt/Makefile.inc#rev1.37 Proposed on port-sun2@ with no response... (Again, this does not affect m68k ports other than sun2.) http://mail-index.netbsd.org/port-sun2/2020/03/10/msg000102.html
Mostly merge changes from HEAD upto 20200411
Merge changes from current as of 20200406
Fix broken printf(3) %d output for numbers more than two digits, e.g., printf("%d\n", 42) ---> "::" instead of "42" Our __{,u}modsi3 codes assume that __udivsi3 returns remainder to %d1 (volatile register). __udivsi3 in libgcc does not, and therefore mixing them up results in mess.
Always include soft-float compare and order logic in libc when using compiler-rt.
Pull up following revision(s) (requested by martin in ticket #157): lib/libc/compiler_rt/Makefile.inc: revision 1.35 Do not use IEEE 754 specific functions for VAX
Do not use IEEE 754 specific functions for VAX
Implement __clear_cache using __syncicache on PPC
Use MACHINE_ARCH for the sparc check.
Add __clear_cache implementatin for SPARC/SPARC64.
Drop fixxfdi.c for m68k (where double == long double and this isn't needed but causes duplicate symbols with softfloat, if compiling MKSOFTFLOAT=yes)
Make sure to define __SOFT_FP__ when building a SOFTFLOAT userland
Fix buidling with MKPROFILE=no
Sync with changes in the profiling implementation of compiler-rt. Switch to the "Linux" runtime, which is kind of misnamed for the mostly ELF based implementation. Make sure to hook up the runtime source only for the profile library as it uses constructors for the output creation.
Pull up following revision(s) (requested by chs in ticket #492): lib/libc/arch/powerpc64/sys/__vfork14.S: revision 1.2 lib/libc/arch/powerpc64/sys/__syscall.S: revision 1.2 lib/libc/arch/powerpc/sys/__syscall.S: revision 1.3 lib/libc/arch/powerpc64/sys/syscall.S: revision 1.2 lib/libc/arch/powerpc/sys/__clone.S: revision 1.6 lib/libc/arch/powerpc64/gen/__setjmp14.S: revision 1.3 sys/arch/powerpc/include/asm.h: revision 1.47 lib/libc/arch/powerpc64/sys/cerror.S: revision 1.6 lib/libc/arch/powerpc64/sys/getcontext.S: revision 1.5 lib/libc/arch/powerpc64/sys/brk.S: revision 1.5 lib/libc/arch/powerpc64/sys/ptrace.S: revision 1.3 lib/libc/arch/powerpc64/genassym.cf: revision 1.1 lib/libc/arch/powerpc64/gen/__sigsetjmp14.S: revision 1.3 lib/libc/arch/powerpc/sys/getcontext.S: revision 1.6 compat/powerpc64/powerpc/bsd.powerpc.mk: revision 1.3 lib/libc/arch/powerpc64/sys/pipe.S: revision 1.2 lib/libc/arch/powerpc/sys/brk.S: revision 1.14 lib/libc/arch/powerpc64/SYS.h: revision 1.3 lib/libc/arch/powerpc64/sys/fork.S: revision 1.2 lib/libc/arch/powerpc64/sys/__sigtramp2.S: revision 1.4 lib/libc/arch/powerpc64/Makefile.inc: revision 1.3 lib/libc/arch/powerpc/sys/pipe.S: revision 1.9 lib/libc/compiler_rt/Makefile.inc: revision 1.25 lib/libc/arch/powerpc64/sys/sbrk.S: revision 1.4, 1.5 lib/libc/arch/powerpc64/sys/__clone.S: revision 1.2 lib/libc/arch/powerpc/sys/sbrk.S: revision 1.13 lib/libc/arch/powerpc/SYS.h: revision 1.13 powerpc64 uses the same sources as powerpc and needs the long double as double-double sources. - Spell LdAddr consistently - Add LDFLAGS+=-Wl,-m,elf32ppc_nbsd - Fix cmpptr/cmpreq/etc to use right mnemonics - Minimize differences between powerpc and powerpc64 - Fix powerpc64 assembly to use right instructions for 64bit CPUs. - Use hidden for __curbrk and __minbrk to avoid GOT/TOC relocations.
Changes for OR1K
Pullup the following to netbsd-7 (requested by matt in ticket #37): external/gpl3/gcc/dist/gcc/config/vax/builtins.md 1.4 external/gpl3/gcc/dist/gcc/config/vax/vax.c 1.10 Rework so that the ctzsi builtin is supported. lib/libc/compiler_rt/Makefile.inc 1.26 VAX does need __clzsi2 libexec/ld.elf_so/arch/vax/rtld_start.S 1.23 libexec/ld.elf_so/arch/vax/rtld_start.S 1.24 add a missing register prefix. Add proper registers for register counts.
Rebase to HEAD as of a few days ago.
file Makefile.inc was added on branch tls-maxphys on 2014-08-20 00:02:14 +0000
VAX does need __clzsi2
powerpc64 uses the same sources as powerpc and needs the long double as double-double sources.
MKCOMPAT fixes for when compat MACHINE_CPU != normal MACHINE_CPU
Add the not-yet-used IEEE quad support files.
Rebase.
Changes to existing files to enable building AARCH64 userland. evbarm64-el This is clang only. While gcc4.8 supports aarch64, no netbsd support has been written for aarch64 with gcc4.8.
Don't include atomic.c, we have aliases for it in src/common.
sync with head. for a reference, the tree before this commit was tagged as yamt-pagecache-tag8. this commit was splitted into small chunks to avoid a limitation of cvs. ("Protocol error: too many arguments")
file Makefile.inc was added on branch yamt-pagecache on 2014-05-22 11:36:51 +0000
For the moment, don't complain about const casts.
Prepare in case we want to hook up the profile init code later.
Deal with PGO rename.
On sh3 __udivsi3 is gcc "millicode" with special calling convention (less registers clobbered than usual). Each DSO that needs it gets its own hidden copy from libgcc.a. Do not compile udivsi3.c for sh3 here since this C version doesn't conform to what gcc expects and overrides the libgcc.a version. This makes binaries compiled with gcc4.8 work. The issue was not exposed with gcc4.5 since it uses different division strategy by default.
Change remaining "MACHINE_ARCH" to "LIBC_MACHINE_ARCH"
Update compiler-rt glue for the new source layout.
Long double support builds for PPC now.
ARM needs __clear_cache.
Must use LIBC_MACHINE_ARCH for deciding whether 64bit support code is neded. Otherwise e.g. i386 compat libs are broken.
__fixsfdi is required, __fixdfsi already in softfloat.
Use a separate variable for the use of GCC's unwind code.
Don't use aeabi_dcmp.S and aeabi_fcmp.S on ARM yet, softfloat provides the same set of symbols.
Comment out softfloat code until it is decided what to use long term.
__floatunsidf and __floatunsisf are provided by softfloat, but __fixdfdi and __fixdfsi are not. So move them into the corresponding chunks.
Explicitly enumerate platforms that have unwind support to make piecewise migration easier.
Don't build common quad routines if the platform is 64bit since they will not be emitted by the compiler.
Add profiling helper functions to the build.
Don't include bswap for ARM right now, the routines require ARMv6. Separate the soft-float code and don't include it in the libgcc case.
Add ARM (EABI) specific sources. Split off code that requires C11, unwind support in libc or overlaps with soft-float in preparation for using compiler-rt in the non-clang case.
Build glue for including compiler-rt in libc, not hooked up yet.