Reputation: 299
I've tried out the flang-new component of llvm 18.1.6 recently, but stumbled when building a shared library on RHEL 8 Linux: the library code from libFortranRuntime.a and libFortranDecimal.a is always pulled into the shared object. That probably is fine for a library intended to be used from other language code as a plugin for e.g. Python but rather impractical for a library meant to be used from a binary also built with flang-new. Besides adding unnecessary code to the build that also sets up everything needed for a later version conflict when the library built with an older version of flang-new is used by a program built with a newer version.
When running flang-new in link mode with option -v
, I can see the -lFortranRuntime and -lFortranDecimal arguments, but I've got no idea how to make flang-new not use those. I just can't seem to make flang-new stop pulling its run-time library into the shared library, specifically the options -nostdlib and -nodefaultlibs seem to be non-working for flang-new. Also, there seems to be no shared version of these libraries installed with the compiler: I could only find libFortranRuntime.a and libFortranDecimal.a.
This question discusses the same underlying issue for a program output, but remains unresolved if I'm reading that correctly (i.e. only solution presented is for the older flang component and does apparently not apply to flang-new): How to link to the standard libraries statically in flang-new like GFortran?
Upvotes: 0
Views: 22