Commit graph

20 commits

Author SHA1 Message Date
Warner Losh a2f733abcf lib: Automated cleanup of cdefs and other formatting
Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by:		Netflix
2023-11-26 22:23:59 -07:00
Warner Losh d0b2dbfa0e Remove $FreeBSD$: one-line sh pattern
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
2023-08-16 11:55:03 -06:00
Warner Losh 1d386b48a5 Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16 11:54:42 -06:00
Alfredo Dal'Ava Junior a12eb9e4ae Revert "csu: test: explicitly add libm as build parameter"
This reverts commit 4f5890a0fb.

9ef1127008 is a proper fix for
the problem we tried to address.

Sponsored by:	Instituto de Pesquisas Eldorado (eldorado.org.br)
2022-07-28 11:23:26 -03:00
Alfredo Dal'Ava Junior 4f5890a0fb csu: test: explicitly add libm as build parameter
CSU tests build fails with '/usr/lib/libgcc_s.so: undefined reference to
fma' when built with LLVM 14 for powerpcspe, so '-lm' is being added
explicitly.

It may be linked to https://reviews.llvm.org/D77558

Reviewed by:	imp (earlier version)
MFC after:	2 days
Sponsored by:	Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision:	https://reviews.freebsd.org/D35691
2022-07-07 20:58:04 -03:00
John Baldwin 9ebe945bd7 Add C startup code tests for PIE binaries.
- Force dynamic to be a non-PIE binary.

- Add a dynamicpie test which uses a PIE binary.

Reviewed by:	andrew
Obtained from:	CheriBSD
MFC after:	2 weeks
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D27127
2020-11-10 19:09:35 +00:00
John Baldwin f9fd7337f6 Fix dso_handle_check for PIE executables.
PIE executables use crtbeginS.o and have a non-NULL dso_handle as a
result.

Reviewed by:	andrew, emaste
MFC after:	2 weeks
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D27126
2020-11-10 19:07:30 +00:00
Kyle Evans 4b50c45172 Revert r353140: Re-add ALLOW_MIPS_SHARED_TEXTREL, sprinkle it around
arichardson has an actual fix for the same issue that this was working
around; given that we don't build with llvm today, go ahead and revert the
workaround in advance.
2020-01-14 17:50:13 +00:00
Kyle Evans 036d2e814b Re-add ALLOW_MIPS_SHARED_TEXTREL, sprinkle it around
Diff partially stolen from CheriBSD; these bits need -Wl,-z,notext in order
to build in an LLVM world. They are needed for all flavors/sizes of MIPS.
This will eventually get fixed in LLVM, but it's unclear when.

Reported by:	arichardson, emaste
Differential Revision:	https://reviews.freebsd.org/D21696
2019-10-06 04:19:49 +00:00
Ed Maste 6871d48825 Add explicit csu test dependency
lib/csu/tests/dynamiclib requires libh_csu.so be built first.  I'm not
sure this is the most correct/best way to address this but it solves
the issue in my testing.

PR:		233734
Sponsored by:	The FreeBSD Foundation
2019-01-04 18:35:25 +00:00
Andrew Turner 266900be14 Re-enable the dynamiclib tests. These should be fixed by r340910. 2018-11-24 18:25:00 +00:00
Andrew Turner ab1e0d2410 Disable the dynamiclib test until a failure can be debugged 2018-11-24 16:05:40 +00:00
Andrew Turner 8522d140a5 Build the csu tests on all architectures.
The tests haven't been run them, but this is enough to build them so I can
get feedback on if the various crt.h headers are correct.

MFC with:	r339738
Sponsored by:	DARPA, AFRL
2018-10-30 14:44:12 +00:00
Andrew Turner ca34591f29 Disable the .preinit_array test in DSOs, ld.bfd fails to link objects with
the section.

MFC with:	r339738
Sponsored by:	DARPA, AFRL
2018-10-30 11:19:47 +00:00
Andrew Turner bb966f87bc Fix the location of the static keyword.
MFC with:	r339738
Sponsored by:	DARPA, AFRL
2018-10-30 10:16:21 +00:00
Andrew Turner 6ec0ee844c Run the csu tests on a DSO. This builds the tests into a shared library,
then runs these from the base test programs. With this we can check
crtbeginS.o and crtendS.o are working as expected.

MFC with:	r339738
Sponsored by:	DARPA, AFRL
2018-10-30 09:43:26 +00:00
Andrew Turner 9e26e65c16 The jcr argument to _Jv_RegisterClasses is used, stop marking it otherwise.
MFC with:	r339738
Sponsored by:	DARPA, AFRL
2018-10-30 09:36:31 +00:00
Andrew Turner 235130433a Check __dso_handle is NULL in non-DSO objects. It should only be non-NULL
when accessed from a shared object.

MFC with:	r339738
Sponsored by:	DARPA, AFRL
2018-10-29 17:03:20 +00:00
Andrew Turner 4b48b463ed Drop the csu tests WARNS to 5 to fix the powerpc64 build.
MFC with:	r339738
Sponsored by:	DARPA, AFRL
2018-10-26 08:12:28 +00:00
Andrew Turner 31d62a73c2 Implement a BSD licensed crtbegin/crtend
These are needed for .ctors/.dtors and .jcr handling. The former needs
all the function pointers to be called in the correct order from the
.init/.fini section. The latter just needs to call a gcj specific function
if it exists with a pointer to the start of the .jcr section.

This is currently disabled until __dso_handle support is added.

Reviewed by:	emaste
MFC after:	1 month
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D17587
2018-10-25 17:39:41 +00:00