[clang] [Driver] Restore compiler-rt arch suffix for PS and Windows (PR #89775)

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 23 11:02:52 PDT 2024


MaskRay wrote:

My recollection of the past discussions is that we want users to switch to the new hierarchy.
*BSD, Linux, and z/OS have migrated but I am not familiar with the Windows ecosystems.

`ToolChain::getCompilerRT` detects both the old and new compiler-rt directory.
Does it not work for PlayStation?

> The old status quo has been that you can build the runtimes with either layout, and clang will use whichever it finds, when invoking the linker.

Yes. We try avoiding a CMake variable that customizes this detection.
We need detection for both old and new file hierarchies for now.

> The recent changes, #81037 and #87866, were (as far as I know) only intended to change what is printed as error messages, when neither is found, to help users correct their setup for the new style layout. But those changes also seem to have unexpected effects in changing e.g. what gets emitted as embedded directive, when the compiler doesn't see either of them at compile time (with e.g. distributed build systems), while they might be available at link time.

This matches my understanding. I am not aware of the embedded directive? Do you embed a path to a compiler-rt library to the generated object files?

I think while technically a new clang can use an old compiler-rt file hierarchy,
technically it is unsupported: kinda like that a very old libc++ may not be built with a new Clang.
I know that changing anything here is tricky as there may be users doing it and we perhaps need to wait a few releases to drop support for the old hierarchy.
The intention is that eventually everyone will use the new file hierarchy.

If we avoid hard-coded library names in compiler-generated relocatable files (just called "object files" on Windows?).
there should be no distributed build system concern.

I am fine if more path probing is added to help users migrate, but the end result (in a few years) should be everyone using a new file hierarchy.

https://github.com/llvm/llvm-project/pull/89775


More information about the cfe-commits mailing list