Skip to content
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

Posix: Make LDC_INSTALL_LTOPLUGIN & LDC_INSTALL_LLVM_RUNTIME_LIBS default to ON if LLVM is linked statically #3673

Merged
merged 7 commits into from
Feb 21, 2021

Conversation

kinke
Copy link
Member

@kinke kinke commented Feb 20, 2021

And to OFF if LLVM is linked dynamically. As we depend on the LLVM .so anyway in that case, it should be safe to depend on its LTO plugin and the associated (clang) compiler-rt libraries as well. The assumption is that most users choosing a shared LLVM prefer dependencies over renamed duplicates, and that users of a static LLVM strive for self-sufficiency or at least not conflicting with potential other LLVM installations.

Use the default values for CI, which means that linker plugin and compiler-rt libs are still included in our prebuilt packages (except for FreeBSD) and that the code locating non-bundled libraries is tested for CI jobs using a shared distro LLVM, like Cirrus and Circle CI on Ubuntu and FreeBSD. That code had to be extended to include the LLVM lib dir when using a shared LLVM (e.g., the install dir on FreeBSD is /usr/local/llvm90). And the constraints for according lit tests have been considerably lowered too, simply assuming the compiler-rt libraries are available somewhere (and that the linker chosen by LDC supports the LTO plugin).

…tically

And to OFF if LLVM is linked dynamically. As we depend on the LLVM .so
anyway in that case, it should be safe to depend on its LTO plugin as
well.

Use the default value for CI, which means that it's still included by
our prebuilt packages (except for FreeBSD) and that the code locating
the 'system' LTO plugin is tested for CI jobs using a shared distro
LLVM, like Cirrus and Circle CI on Ubuntu and FreeBSD.
As they fail for the Cirrus CI job and FreeBSD 12.1 at least.
[The LTO tests on FreeBSD have just been enabled and were previously
disabled.]
…G check

As they are IMO unfavorably disrupting the output, e.g.:

-- -- Building LDC with dynamic compilation support (LDC_DYNAMIC_COMPILE): ON
-- -- Building LDC with integrated LLD linker (LDC_WITH_LLD): ON
-- -- Building LDC with enabled assertions (LDC_ENABLE_ASSERTIONS): ON
-- Performing Test LINKER_ACCEPTS_EXPORT_DYNAMIC_FLAG
-- Performing Test LINKER_ACCEPTS_EXPORT_DYNAMIC_FLAG - Success
-- -- Building LDC with plugin support (LDC_ENABLE_PLUGINS): ON
-- -- Including LTO linker plugin (LDC_INSTALL_LTOPLUGIN): ON (/home/vsts/work/1/llvm/lib/LLVMgold.so)
-- -- Including LLVM compiler-rt libraries (LDC_INSTALL_LLVM_RUNTIME_LIBS): ON
@kinke kinke force-pushed the lto_plugin branch 2 times, most recently from 6ce6348 to 3e26f37 Compare February 20, 2021 12:19
@@ -804,12 +812,6 @@ if (LDC_INSTALL_LLVM_RUNTIME_LIBS)
copy_compilerrt_lib("windows/clang_rt.builtins-${compilerrt_arch_suffix}.lib" "ldc_rt.builtins.lib" FALSE)
copy_compilerrt_lib("windows/clang_rt.profile-${compilerrt_arch_suffix}.lib" "ldc_rt.profile.lib" FALSE)
copy_compilerrt_lib("windows/clang_rt.fuzzer-${compilerrt_arch_suffix}.lib" "ldc_rt.fuzzer.lib" FALSE)
copy_compilerrt_lib("windows/clang_rt.xray-${compilerrt_arch_suffix}.lib" "ldc_rt.xray.lib" FALSE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is XRay still not available on Windows?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, sadly not, at least not up to & including v11; I haven't checked 12 yet.

@kinke kinke changed the title Posix: Make LDC_INSTALL_LTOPLUGIN default to ON if LLVM is linked statically Posix: Make LDC_INSTALL_LTOPLUGIN & LDC_INSTALL_LTOPLUGIN default to ON if LLVM is linked statically Feb 20, 2021
@kinke kinke changed the title Posix: Make LDC_INSTALL_LTOPLUGIN & LDC_INSTALL_LTOPLUGIN default to ON if LLVM is linked statically Posix: Make LDC_INSTALL_LTOPLUGIN & LDC_INSTALL_LLVM_RUNTIME_LIBS default to ON if LLVM is linked statically Feb 20, 2021
@kinke kinke marked this pull request as ready for review February 20, 2021 13:39
…atically

And to OFF if LLVM is linked dynamically. The assumption is that most
users choosing a shared LLVM prefer a dependency on the associated
clang compiler-rt libs too, and that users of a static LLVM strive
for not conflicting with potential other LLVM installations.
… library lookups

When looking up the LTO linker plugin and compiler-rt libraries.
Most of them are available. [For ARMv7-A, there are no libs.]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants