Commit graph

31 commits

Author SHA1 Message Date
Andrew Turner 2228d7c599 Revert "rtld: Add arm64 variant pcs tests"
It's missing an mtree update

This reverts commit 9e48c30e25.
2024-05-17 11:19:24 +00:00
Andrew Turner 9e48c30e25 rtld: Add arm64 variant pcs tests
When marking a function as variant pcs we can use registers not normally
used in procedure calls. Add a test that uses this and stores all
general purpose registers to a buffer and compare this buffer with the
expected value later.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D44870
2024-05-17 09:37:23 +00:00
Kyle Evans c5796f1572 rtld: add some dlopen tests
dlopen_basic just tests that libthr.so can be dlopen()ed, which will
just serve as a sanity check that "libthr.so" is a thing that can be
dlopened in case we get a weird failure in dlopen_recursing.

dlopen_recursing tests a regression reported after the libsys split,
where some dlopen() may cause infinite recursion and a resulting crash.
This case is inspired by bdrewery's description of what seemed to be
causing his issue.

The corresponding fix landed in commit
968a18975a ("rtld: ignore load_filtees() calls if we already [...]")

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D43859
2024-02-13 09:38:02 -06:00
Kyle Evans d9c543b6b0 rtld: add a test for RTLD_DEEPBIND
This tests that with RTLD_DEEPBIND, symbols are looked up in all of the
object's needed objects before the global object.

PR:		275393
Reviewed by:	kib
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D42843
2023-11-30 19:26:09 -06: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 b3e7694832 Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
2023-08-16 11:54:16 -06:00
Warner Losh 4d846d260e spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with:		pfg
MFC After:		3 days
Sponsored by:		Netflix
2023-05-12 10:44:03 -06:00
Alex Richardson e34c713b0e rtld/tests: Avoid function name conflict with libc opendir()
This prevents these tests from being compiled with ASAN since the asan
interceptors also define opendir() but matching the libc function.

Reviewed By:	oshogbo, kib, markj
Differential Revision: https://reviews.freebsd.org/D31038
2021-07-06 10:51:57 +01:00
Mariusz Zaborski f90218886f rtld: introduce PRELOAD_FDS
The new PRELOAD_FDS variable accepts a list of file descriptors
that should be loaded into the process.

This may be used to optimize a loading process - in the case when
we already have a file descriptor to the library; we don't have
to look into multiple PATH to find it.

It may also be used in capability mode to load a single additional
library without the need to open a directory that contains it.

The last use of this functionality t may be a race-free method
of loading libraries.

Reviewed by:	kib, markj
Differential Revision:	https://reviews.freebsd.org/D29334
2021-03-24 23:40:48 +01:00
Kyle Evans 7cc42f6d25 Do a sweep and remove most WARNS=6 settings
Repeating the default WARNS here makes it slightly more difficult to
experiment with default WARNS changes, e.g. if we did something absolutely
bananas and introduced a WARNS=7 and wanted to try lifting the default to
that.

Drop most of them; there is one in the blake2 kernel module, but I suspect
it should be dropped -- the default WARNS in the rest of the build doesn't
currently apply to kernel modules, and I haven't put too much thought into
whether it makes sense to make it so.
2020-10-01 01:10:51 +00:00
Edward Tomasz Napierala 50cf3bac62 Fix regression tests broken by r337067.
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
2018-08-02 11:55:16 +00:00
Bryan Drewery ea825d0274 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	Dell EMC Isilon
2017-10-31 00:07:04 +00:00
Alan Somers 35804720ec Increase WARNS for rtld-elf tests
ATF tests have a default WARNS of 0, unlike other usermode programs.

Reviewed by:  ngie, julian
MFC after:    3 weeks
Sponsored by: Spectra Logic Corporation
Differential Revision:        https://reviews.freebsd.org/D9933
2017-03-11 00:10:40 +00:00
Bryan Drewery 1eb4ec9c62 DIRDEPS_BUILD: Add some missing dirctories to the build.
Sponsored by:	EMC / Isilon Storage Division
2016-08-31 19:30:59 +00:00
Enji Cooper 430f7286a5 Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed
after r298107

Summary of changes:

- Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that
  namespacing is kept with FILES appropriately, and that this shouldn't need
  to be repeated if the namespace changes -- only the definition of PACKAGE
  needs to be changed
- Allow PACKAGE to be overridden by callers instead of forcing it to always be
  `tests`. In the event we get to the point where things can be split up
  enough in the base system, it would make more sense to group the tests
  with the blocks they're a part of, e.g. byacc with byacc-tests, etc
- Remove PACKAGE definitions where possible, i.e. where FILES wasn't used
  previously.
- Remove unnecessary TESTSPACKAGE definitions; this has been elided into
  bsd.tests.mk
- Remove unnecessary BINDIRs used previously with ${PACKAGE}FILES;
  ${PACKAGE}FILESDIR is now automatically defined in bsd.test.mk.
- Fix installation of files under data/ subdirectories in lib/libc/tests/hash
  and lib/libc/tests/net/getaddrinfo
- Remove unnecessary .include <bsd.own.mk>s (some opportunistic cleanup)

Document the proposed changes in share/examples/tests/tests/... via examples
so it's clear that ${PACKAGES}FILES is the suggested way forward in terms of
replacing FILES. share/mk/bsd.README didn't seem like the appropriate method
of communicating that info.

MFC after: never probably
X-MFC with: r298107
PR: 209114
Relnotes: yes
Tested with: buildworld, installworld, checkworld; buildworld, packageworld
Sponsored by: EMC / Isilon Storage Division
2016-05-04 23:20:53 +00:00
Glen Barber 7d536dc855 MFH
Sponsored by:	The FreeBSD Foundation
2016-03-10 21:16:01 +00:00
Bryan Drewery 15c433351f DIRDEPS_BUILD: Connect MK_TESTS.
Sponsored by:	EMC / Isilon Storage Division
2016-03-09 22:46:01 +00:00
Glen Barber 72c3aa02dc MFH
Sponsored by:	The FreeBSD Foundation
2016-02-18 00:37:58 +00:00
Bryan Drewery fb99179af4 Fix build race after r295643.
Sponsored by:	EMC / Isilon Storage Division
2016-02-17 00:30:28 +00:00
Glen Barber 43faedc133 First pass to fix the 'tests' packages.
Sponsored by:	The FreeBSD Foundation
2016-02-02 22:26:49 +00:00
Bryan Drewery eacae6dc66 Fix LDADD/DPADD that should be LIBADD.
Sponsored by:	EMC / Isilon Storage Division
2015-12-04 03:17:47 +00:00
Enji Cooper b2d48be1bc Refactor the test/ Makefiles after recent changes to bsd.test.mk (r289158) and
netbsd-tests.test.mk (r289151)

- Eliminate explicit OBJTOP/SRCTOP setting
- Convert all ad hoc NetBSD test integration over to netbsd-tests.test.mk
- Remove unnecessary TESTSDIR setting
- Use SRCTOP where possible for clarity

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Divison
2015-10-12 08:16:03 +00:00
Enji Cooper 35829c84f1 Fix "make checkdpadd" by "spoofing" DPADD
Approved by: jmmv (mentor)
Phabric: D631
PR: 192769
2014-08-26 09:01:11 +00:00
Enji Cooper fd5c99b51e Similar to r269506, fix LIBDIR to not duplicate TESTSDIR
Phabric: D536
Reviewed by: jmmv
Approved by: jmmv (mentor)
Sponsored by: EMC / Isilon Storage Division
2014-08-05 18:09:39 +00:00
Enji Cooper 522da0b0ad Remove unnecessary .PATH directive
All of the sources for the tests are contained in the
current working directory and the subdirectories

Phabric: D537
Reviewed by: jmmv
Approved by: jmmv (mentor)
Sponsored by: EMC / Isilon Storage Division
2014-08-05 18:05:31 +00:00
Enji Cooper 2db8752cef Fix BINDIR to not duplicate "${TESTSDIR}
This should fix 'make release' with MK_TESTS != no

Phabric: D525 (part of a larger patch)

Reviewed by: jmmv
Approved by: jmmv (co-mentor)
2014-08-04 05:50:21 +00:00
Enji Cooper 07014efe94 Move a -L argument from LDADD to LDFLAGS
Phabric: D525 (part of a larger patch)

Reviewed by: jmmv
Approved by: jmmv (co-mentor)
2014-08-04 05:49:13 +00:00
Enji Cooper 35e8923e7e Fix a -Wsecurity warning with clang
Phabric: D525 (part of a larger patch)

Reviewed by: jmmv
Approved by: jmmv (co-mentor)
2014-08-04 05:46:10 +00:00
Enji Cooper 1a49685c28 Remove hardcoded path to TESTSDIR (Makefile, ld_library_pathfds.c) at
build time by using atf_tc_get_config_var(tc, "srcdir"))

This will allow end-users to move the binaries to different locations
after they've been built without having to rebuild the binaries with
the new paths

Phabric: D525 (part of a larger patch)

Reviewed by: jmmv
Approved by: jmmv (co-mentor)
2014-08-04 05:45:09 +00:00
Julio Merino 2504a6af6b libpythagoras needs libm.
This fixes "make tinderbox" failures on various architectures when
WITH_TESTS=yes is enabled.  Problem introduced in r267679.
2014-07-16 16:42:58 +00:00
Jonathan Anderson 6b22f423cf Test RTLD's new LD_LIBRARY_PATH_FDS variable.
Test LD_LIBRARY_PATH_FDS by linking a binary that requires a shared
library that isn't in any of the usual search paths.  Ensure this fails
when we don't supply LD_LIBRARY_PATH_FDS or we pass invalid information
in it.  Ensure it works when we pass the correct directory in various
places in the variable.

Approved by:	rwatson (mentor)
MFC after:	3 weeks
Sponsored by:	DARPA/AFRL
2014-06-20 17:14:59 +00:00