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

driver/linker-gcc.cpp: Don't pass -rpath to linker on wasm targets #4849

Merged
merged 1 commit into from
Mar 3, 2025

Conversation

the-horo
Copy link
Contributor

wasm-ld and lld::wasm don't understand the -rpath argument.

wasm-ld and lld::wasm don't understand the -rpath argument.

Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me>
@@ -613,7 +613,8 @@ void ArgsBuilder::build(llvm::StringRef outputPath,
}

// -rpath if linking against shared default libs or ldc-jit
if (linkAgainstSharedDefaultLibs() || opts::enableDynamicCompile) {
if ((linkAgainstSharedDefaultLibs() || opts::enableDynamicCompile)
&& !triple.isOSBinFormatWasm()) { // wasm-ld doesn't recognize -rpath
Copy link
Member

Choose a reason for hiding this comment

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

Really needed? wasm will most likely never support shared druntime/Phobos, nor dynamic-compile.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Passing -link-defaultlib-shared when compiling with -defaultlib= or -betterC still passes -rpath making it fail. + it makes #4848 fail because I no longer strip the -link-defaultlib-shared that comes from -DBUILD_SHARED_LIBS=... in the wasm switches.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Of course I could add it back but it seems more reasonable to ignore -link-defaultlib-shared, in my opinion at least

@kinke kinke merged commit 9c4e848 into ldc-developers:master Mar 3, 2025
20 checks passed
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.

2 participants