test/link/glibc_compat: Add C test case for glibc versions - #19007
Merged
Conversation
rootbeer
force-pushed
the
glibc-c-test
branch
2 times, most recently
from
February 24, 2024 19:27
c47defa to
fe42c88
Compare
rootbeer
force-pushed
the
glibc-c-test
branch
2 times, most recently
from
February 29, 2024 03:55
996bdf8 to
92030ed
Compare
rootbeer
force-pushed
the
glibc-c-test
branch
2 times, most recently
from
March 16, 2024 23:29
af860bc to
c85dd5c
Compare
glibc_runtime_check.c is a simple test case that exercises glibc functions that might smoke out linking problems with Zig's C compiler. The build.zig compiles it against a variety of glibc versions. Also document and test glibc v2.2.5 (from 2002) as the oldest working glibc target for C binaries.
Had constrained the `aarch64_be` target, but not `aarch64`. This constraint is necessary because earlier versions of glibc do not support the aarch64 architecture. Also, skip unsupported test cases.
Member
|
Nice! |
Member
|
BTW, here are some pre-built glibc sets that you can use: Warning: these files are massive - multiple GiB each. I have not enabled any such testing on the CI (yet?) Basically, QEMU can be used to run cross-compiled zig code that uses glibc. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
glibc_runtime_check.c: a simple test case that exercises glibc functions that might smoke out linking problems with Zig's C compiler. The build.zig compiles it against a variety of glibc versions.Also mark the
aarch64glibc minimum version as 2.17 (theaarch64_betarget was already marked). This is necessary because earlier versions of glibc do not support the aarch64 architecture.Also document and test glibc v2.2.5 (from 2002) as the oldest working glibc target for C binaries. (Earlier versions fail with a raft of missing symbols.)