Skip to content

Behavior of -rpath under llvm-mingw does not match gcc-mingw #102777

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

Closed
tomager opened this issue Aug 11, 2024 · 1 comment
Closed

Behavior of -rpath under llvm-mingw does not match gcc-mingw #102777

tomager opened this issue Aug 11, 2024 · 1 comment
Labels

Comments

@tomager
Copy link

tomager commented Aug 11, 2024

The behavior of -rpath under llvm-mingw is different than in gcc-mingw. Please see mstorsjo/llvm-mingw#300 for more information. Briefly summarized here:

Here is the output of gcc-mingw (toolchain generated from crosstool-ng) compiling the simple program [1] with -rpath option:

# /xgcc-x86_64-w64-mingw32/bin/x86_64-w64-mingw32-g++ test.cc -Wl,-rpath,anything
<no error>

And here is the llvm-mingw toolchain failing on the same inputs:

# /xllvm-x86_64-w64-mingw32/bin/x86_64-w64-mingw32-g++ test.cc -Wl,-rpath,anything
lld: error: unknown argument: -rpath
clang: error: linker command failed with exit code 1 (use -v to see invocation)

It would be nice if lld behaved the same as gcc-mingw, to lower friction when porting mingw packages to clang/llvm.

Would there be objections to a patch that causes -rpath to be silently ignored?

[1]

#include <iostream>

int main(int argc, const char** argv) {
  std::cout<<"hello world!"<<std::endl;
  *(volatile int*)0 = 0;
  return 0;
}
@EugeneZelenko EugeneZelenko added llvm-tools All llvm tools that do not have corresponding tag and removed new issue labels Aug 11, 2024
@tomager
Copy link
Author

tomager commented Aug 22, 2024

This was fixed in #102886

@tomager tomager closed this as completed Aug 22, 2024
@EugeneZelenko EugeneZelenko added lld and removed llvm-tools All llvm tools that do not have corresponding tag labels Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants