Skip to content

Fix environ on FreeBSD with cdylib targets that use -Wl,--no-undefined .#153718

Open
asomers wants to merge 1 commit intorust-lang:mainfrom
asomers:environ-freebsd
Open

Fix environ on FreeBSD with cdylib targets that use -Wl,--no-undefined .#153718
asomers wants to merge 1 commit intorust-lang:mainfrom
asomers:environ-freebsd

Conversation

@asomers
Copy link
Contributor

@asomers asomers commented Mar 11, 2026

Instead of relying on the linker to find the 'environ' symbol, use dlsym. This fixes using environ from cdylibs that link with -Wl,--no-undefined .

Fixes #153451
Sponsored by: ConnectWise

Instead of relying on the linker to find the 'environ' symbol, use
dlsym.

Fixes rust-lang#153451
Sponsored by:	ConnectWise
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Mar 11, 2026
@rustbot
Copy link
Collaborator

rustbot commented Mar 11, 2026

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ChrisDenton, libs
  • @ChrisDenton, libs expanded to 8 candidates

@rustbot
Copy link
Collaborator

rustbot commented Mar 11, 2026

⚠️ Warning ⚠️

  • There are issue links (such as #123) in the commit messages of the following commits.
    Please move them to the PR description, to avoid spamming the issues with references to the commit, and so this bot can automatically canonicalize them to avoid issues with subtree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

std::sys::env::environ is causing linking problems on FreeBSD

3 participants