-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
std::sys::env::environ is causing linking problems on FreeBSD #153451
Copy link
Copy link
Closed
Labels
A-dynamic-libraryArea: Dynamic/Shared LibrariesArea: Dynamic/Shared LibrariesA-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesA-processArea: `std::process` and `std::env`Area: `std::process` and `std::env`C-bugCategory: This is a bug.Category: This is a bug.O-freebsdOperating system: FreeBSDOperating system: FreeBSDT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-dynamic-libraryArea: Dynamic/Shared LibrariesArea: Dynamic/Shared LibrariesA-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesA-processArea: `std::process` and `std::env`Area: `std::process` and `std::env`C-bugCategory: This is a bug.Category: This is a bug.O-freebsdOperating system: FreeBSDOperating system: FreeBSDT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
On FreeBSD the
extern char** environsymbol is defined in the CRT rather than libc. This is known to cause linking problems for shared libraries when the linker is passed--no-undefined. The usual workaround for this issue is to resolveenvirondynamically as suggested in https://reviews.freebsd.org/D30842#840642 I already pushed such a fix into LLVM and some other projects.I've put up a minimal reproduction code at https://github.com/arrowd/rust-environ-problem Simply run
maketo get the linking error.CC @asomers