diff options
author | Joseph Myers <joseph@codesourcery.com> | 2021-09-17 13:12:10 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2021-09-17 13:12:10 +0000 |
commit | f3eef963902d0f54f68cffc74f79b97f4d6154b7 (patch) | |
tree | cc4009b60c4a14634345588a8778402b2197cc6a /conform/Makefile | |
parent | 63a788f48a713f2081f200dd054df3e728b0e7c2 (diff) | |
download | glibc-f3eef963902d0f54f68cffc74f79b97f4d6154b7.tar.gz glibc-f3eef963902d0f54f68cffc74f79b97f4d6154b7.tar.xz glibc-f3eef963902d0f54f68cffc74f79b97f4d6154b7.zip |
Run conform/ tests using newly built libc
Although the conform/ header tests are built using the headers of the glibc under test, the execution tests from conformtest (a few tests of the values of macros evaluating to string constants) are linked and run with system libc, not the newly built libc. Apart from preventing testing in cross environments, this can be a problem even for native testing. Specifically, it can be useful to do native testing when building with a cross compiler that links with a libc that is not the system libc; for example, on x86_64, you can test all three ABIs that way if the kernel support is present, even if the host OS lacks 32-bit or x32 libraries or they are older than the libraries in the sysroot used by the compiler used to build glibc. This works for almost all tests, but not for these conformtest tests. Arrange for conformtest to link and run test programs similarly to other tests, with consequent refactoring of various variables in Makeconfig to allow passing relevant parts of the link-time command lines down to conformtest. In general, the parts of the link command involving $@ or $^ are separated out from the parts that should be passed to conformtest (the variables passed to conformtest still involve various variables whose names involve $(@F), but those variables simply won't be defined for the conformtest makefile rules and I think their presence there is harmless). This is also most of the support that would be needed to allow running those tests of string constants for cross testing when test-wrapper is defined. That will also need changes to where conformtest.py puts the test executables, so it puts them in the main object directory (expected to be shared with a test system in cross testing) rather than /tmp (not expected to be shared) as at present. Tested for x86_64.
Diffstat (limited to 'conform/Makefile')
-rw-r--r-- | conform/Makefile | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/conform/Makefile b/conform/Makefile index c64a83a905..296db818f0 100644 --- a/conform/Makefile +++ b/conform/Makefile @@ -176,6 +176,9 @@ $(conformtest-header-tests): $(objpfx)%/conform.out: \ (set -e; std_hdr=$*; std=$${std_hdr%%/*}; hdr=$${std_hdr#*/}; \ mkdir -p $(@D); \ $(PYTHON) $< --cc='$(CC)' --flags='$(conformtest-cc-flags)' \ + --ldflags='$(+link-tests-before-inputs)' \ + --libs='$(+link-tests-after-inputs)' \ + --run-program-prefix='$(run-program-prefix)' \ --standard=$$std --header=$$hdr $(conformtest-xfail) \ $(conformtest-cross) \ > $@ 2>&1); \ |