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

Revert #255 #262

Merged
merged 4 commits into from
Aug 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ jobs:
os:
- version: "ubuntu-20.04"
native-python: "3.8"
- version: "ubuntu-22.04"
native-python: "3.10"
python-version:
- "3.7"
- "3.8"
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/).

## [Unreleased]
### Fixed
- Reverted invalid fix ([#255]) for libnssfix link failure ([#262])


## [0.14.0] - 2023-07-10
### Fixed
- Fixed issue causing libnssfix link failure when building on GLIBC 2.34 ([#255])
Expand Down Expand Up @@ -339,3 +344,4 @@ Initial release
[#238]: https://github.com/JonathonReinhart/staticx/pull/238
[#247]: https://github.com/JonathonReinhart/staticx/pull/247
[#255]: https://github.com/JonathonReinhart/staticx/pull/255
[#262]: https://github.com/JonathonReinhart/staticx/pull/262
12 changes: 0 additions & 12 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,6 @@ conf = base_env.Configure(custom_tests=custom_tests)
# Does our default libc have NSS?
conf.env["HAS_NSS"] = conf.CheckNSS()

# Starting in GLIBC 2.34, some NSS modules (files, dns) can be built-in to
# libc.so. Determine which ones are builtin. See #245.
conf.env["NSS_MODS_BUILTIN"] = []
if conf.env["HAS_NSS"]:
maybe_builtin_nss_modules = ["files", "dns"]
for mod in maybe_builtin_nss_modules:
libname = "libnss_" + mod
# It the library doesn't exist, assume it is built-in.
if not conf.BasicCheckLib(libname):
conf.env.Append(NSS_MODS_BUILTIN=libname)
print("Builtin NSS modules:", conf.env["NSS_MODS_BUILTIN"])

base_env = conf.Finish()

################################################################################
Expand Down
17 changes: 6 additions & 11 deletions libnssfix/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,6 @@ env.NsswitchConfH(
source = nsswitch_conf,
)


# Link against the configured NSS module libraries.
# These aren't needed directly for the library itself, but this ensures
# that they will be available for nss at runtime (via dlopen), and
# allows their paths to be easily discovered via ldd(1).
nss_libs = set(env.GetNsswitchLibs(nsswitch_conf))

# Exclude those already built-in to glibc.
nss_libs -= set(env["NSS_MODS_BUILTIN"])

# Build libnssfix.so
libnssfix = env.SharedLibrary(
target = 'nssfix',
Expand Down Expand Up @@ -60,7 +50,12 @@ libnssfix = env.SharedLibrary(
],
LIBS = [
libc_stub,
] + list(nss_libs),

# These aren't needed directly for the library itself, but this ensures
# that they will be available for nss at runtime (via dlopen), and
# allows their paths to be easily discovered via ldd(1).
env.GetNsswitchLibs(nsswitch_conf),
],
)

Return('libnssfix')
20 changes: 0 additions & 20 deletions site_scons/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,6 @@ def CheckNSS(context):
return ok


def BasicCheckLib(context, libname):
"""Check for a C library.

Similar to built-in CheckLib but works around
https://github.com/SCons/scons/issues/4373.
"""
context.Message("Checking for library %s... " % libname)

oldLIBS = context.AppendLIBS([libname])
ok = context.TryLink(
"int main(void) { return 0; }",
".c"
)
context.SetLIBS(oldLIBS)

context.Result(ok)
return ok


custom_tests = dict(
CheckNSS = CheckNSS,
BasicCheckLib = BasicCheckLib,
)