Issue |
127538
|
Summary |
[Flang] Driver hardcodes `lib/libflang_rt.a` path that is incorrect on `lib64` systems, and does not permit multilib
|
Labels |
flang
|
Assignees |
|
Reporter |
mgorny
|
I'm almost ready to package Flang on Gentoo. The remaining problem is that the driver hardcodes the `lib` directory for `libflang_rt.a`:
https://github.com/llvm/llvm-project/blob/6fde8fe9adc835df50ea57b710781ffe8a6657e8/clang/lib/Driver/ToolChains/CommonArgs.cpp#L1361-L1370
This is problematic for two reasons:
1. Gentoo is using `lib64` for 64-bit libraries on platforms such on amd64, and `lib` for 32-bit libraries, and installing a 64-bit library into `lib` is generally an error.
2. The forced use of a single library directory makes cross-compilation / multilib builds impossible. I haven't tested how well Flang works with that yet, but at least a dumb `flang --target=i686-pc-linux-gnu hello.f90` seems to work, modulo trying to link a 64-bit runtime.
I've tried fiddling a fair bit, and unfortunately I don't see any good way of getting the correct `lib*` directory in that code. Perhaps the correct approach would be to include the architecture in the filename the way compiler-rt does — and perhaps move it to clang's resource directory while at it?
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs