Open
Description
I'm almost ready to package Flang on Gentoo. The remaining problem is that the driver hardcodes the lib
directory for libflang_rt.a
:
llvm-project/clang/lib/Driver/ToolChains/CommonArgs.cpp
Lines 1361 to 1370 in 6fde8fe
This is problematic for two reasons:
- Gentoo is using
lib64
for 64-bit libraries on platforms such on amd64, andlib
for 32-bit libraries, and installing a 64-bit library intolib
is generally an error. - 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?