Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken nssfix build on newer glibc (take 2) #259

Merged
merged 4 commits into from
Aug 7, 2023
Merged

Conversation

JonathonReinhart
Copy link
Owner

@JonathonReinhart JonathonReinhart commented Jul 11, 2023

This takes a different approach than #255 by simply linking against the libnss_*.so.2 SONAME explicitly, rather than the normal method of passing -lnss_*. This works because the .so.2 stubs still exist on GLIBC >=2.34.

Fixes #245 (take 2)

@JonathonReinhart
Copy link
Owner Author

Regarding this failure:
https://github.com/JonathonReinhart/staticx/actions/runs/5774679773/job/15651888713?pr=259

--------------------------------------------------------------------------------
Verify StaticX can't link against target system libs

App run normally:
dlopen("libcrypt.so") returned 0x563d4dc492d0
OK

Making staticx executable ($STATICX_FLAGS=):

Running staticx executable
dlopen("libcrypt.so") returned (nil)
OK

Running original app under centos:5
./app: /lib64/libc.so.6: version `GLIBC_2.34' not found (required by ./app)
Error: Process completed with exit code 1.

This has nothing to do with libnssfix.

The problem is a logical error with the test here:

scuba --image $TEST_DOCKER_IMAGE $app $libname 0

We're building a dynamic app on Ubuntu 22.04 and wondering why it fails to run on CentOS 5. We were getting (un)lucky before with GLIBC versions.

The test is attempting to show that -nodeflib works: that the original app is able to dlopen() a file from the filesystem, but is unable to do so after statcx-ifying. The offending line is there to prove that the given libname exists in the docker image and can be dlopen()ed regularly. That gives more credibility to the subsequent negative test.

I guess ideally we would do the first part with an app already on the system or by building inside of docker, but that seems like too much work.

We can't run a new dynamic executable in an old OS; that's the point of
staticx.
@JonathonReinhart JonathonReinhart marked this pull request as ready for review August 7, 2023 04:16
@JonathonReinhart JonathonReinhart merged commit 5722c1e into main Aug 7, 2023
10 checks passed
@JonathonReinhart JonathonReinhart deleted the 245-again branch August 7, 2023 04:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

libnssfix fails to build under Ubuntu 22.04
1 participant