Skip to content

fix: ensure -zlazy for systems that default to -znow#1729

Open
xandris wants to merge 1 commit into
containers:mainfrom
xandris:bugfix/ensure-z-lazy
Open

fix: ensure -zlazy for systems that default to -znow#1729
xandris wants to merge 1 commit into
containers:mainfrom
xandris:bugfix/ensure-z-lazy

Conversation

@xandris
Copy link
Copy Markdown

@xandris xandris commented Nov 10, 2025

I see #1706 and #1722. this is more minimal change for systems that default to znow

@xandris xandris requested a review from debarshiray as a code owner November 10, 2025 01:08
xandris added a commit to xandris/toolbox that referenced this pull request Nov 10, 2025
Adds -zlazy to the go build wrapper and the 'go run' command for
generating completions. Some systems like Gentoo default to znow if it
is left unset.

See: containers#1729
Signed-off-by: Alexandra Parker <alex.iris.parker@gmail.com>
@xandris xandris force-pushed the bugfix/ensure-z-lazy branch from 59be97f to 73ed56e Compare November 10, 2025 01:11
@silverhadch
Copy link
Copy Markdown

Ping.

Copy link
Copy Markdown
Member

@debarshiray debarshiray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking into this, @xandris , and my apologies for the delay! I always shudder at this linker hackery. :)

Comment thread src/go-build-wrapper
$tags \
-trimpath \
-ldflags "-extldflags '-Wl,-dynamic-linker,$dynamic_linker -Wl,-rpath,/run/host$libc_dir_canonical_dirname -Wl,--export-dynamic -Wl,--unresolved-symbols=ignore-in-object-files' -linkmode external -X github.com/containers/toolbox/pkg/version.currentVersion=$4" \
-ldflags "-extldflags '-Wl,-z,lazy,-dynamic-linker,$dynamic_linker,-rpath,/run/host$libc_dir_canonical_dirname,--export-dynamic,--unresolved-symbols=ignore-in-object-files' -linkmode external -X github.com/containers/toolbox/pkg/version.currentVersion=$4" \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect we have a typo here that explains the CI failures.

Shouldn't it be -Wl,-dynamic-linker,$dynamic_linker -Wl,-z,lazy?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's okay to stack up linker arguments in -Wl. the commas just separate successive argv elements that ld receives, so it's not necessary to have multiple -Wl flags... but it doesn't hurt either

i think the problem was actually a missing comma in my change to src/meson_generate_completions.py! that caused Python to concatenate the lazy with the . that was intended for go run. sorry about that

@debarshiray
Copy link
Copy Markdown
Member

recheck

Copy link
Copy Markdown
Member

@debarshiray debarshiray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this fixes #1706 Could you please link to the issue instead of the PR in the commit message?

Adds -zlazy to the go build wrapper and the 'go run' command for
generating completions. Some systems like Gentoo default to znow if it
is left unset.

See: containers#1706
Signed-off-by: Alexandra Parker <alex.iris.parker@gmail.com>
@xandris xandris force-pushed the bugfix/ensure-z-lazy branch from 73ed56e to 8811838 Compare June 5, 2026 02:44
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.

3 participants