Prepare Compiler-RT for GnuInstallDirs, matching libcxx, document allThis is a second attempt at D101497, which landed as9a9bc76c0eb72f0f2732c729a460abbd5239c2e3 but had to be reverted in8cf7ddbd
Prepare Compiler-RT for GnuInstallDirs, matching libcxx, document allThis is a second attempt at D101497, which landed as9a9bc76c0eb72f0f2732c729a460abbd5239c2e3 but had to be reverted in8cf7ddbdd4e5af966a369e170c73250f2e3920e7.This issue was that in the case that `COMPILER_RT_INSTALL_PATH` isempty, expressions like "${COMPILER_RT_INSTALL_PATH}/bin" evaluated to"/bin" not "bin" as intended and as was originally.One solution is to make `COMPILER_RT_INSTALL_PATH` always non-empty,defaulting it to `CMAKE_INSTALL_PREFIX`. D99636 adopted that approach.But, I think it is more ergonomic to allow those project-specific pathsto be relative the global ones. Also, making install paths absolute bydefault inhibits the proper behavior of functions like`GNUInstallDirs_get_absolute_install_dir` which make relative installpaths absolute in a more complicated way.Given all this, I will define a function like the one asked for inhttps://gitlab.kitware.com/cmake/cmake/-/issues/19568 (and needed for asimilar use-case).---Original message:Instead of using `COMPILER_RT_INSTALL_PATH` through the CMake forcomplier-rt, just use it to define variables for the subdirs whichthemselves are used.This preserves compatibility, but later on we might consider getting ridof `COMPILER_RT_INSTALL_PATH` and just changing the defaults for thesubdir variables directly.---There was a seaming bug where the (non-Apple) per-target libdir was`${target}` not `lib/${target}`. I suspect that has to do with the docson `COMPILER_RT_INSTALL_PATH` saying was the library dir when that's nolonger true, so I just went ahead and fixed it, allowing me to definefewer and more sensible variables.That last part should be the only behavior changes; everything elseshould be a pure refactoring.---I added some documentation of these variables too. In particular, Iwanted to highlight the gotcha where `-DSomeCachePath=...` without the`:PATH` will lead CMake to make the path absolute. See [1] fordiscussion of the problem, and [2] for the brief official documentationthey added as a result.[1]: https://cmake.org/pipermail/cmake/2015-March/060204.html[2]: https://cmake.org/cmake/help/latest/manual/cmake.1.html#optionsIn 38b2dec37ee735d5409148e71ecba278caf0f969 the problem was somewhatmisidentified and so `:STRING` was used, but `:PATH` is better as itsets the correct type from the get-go.---D99484 is the main thrust of the `GnuInstallDirs` work. Once this lands,it should be feasible to follow both of these up with a simple patch forcompiler-rt analogous to the one for libcxx.Reviewed By: phosek, #libc_abi, #libunwindDifferential Revision: https://reviews.llvm.org/D105765
show more ...
[sanitizers] Make it possible to XFAIL on the effective target, not just the default.Summary:The triple is not the right thing to XFAIL on since LIT only sees the defaulttriple and not the effect
[sanitizers] Make it possible to XFAIL on the effective target, not just the default.Summary:The triple is not the right thing to XFAIL on since LIT only sees the defaulttriple and not the effective triple chosen by any -target option in the RUNdirectives. This discrepancy is shown in the table below: Default Triple | Options | XFAIL | LIT's expected result | Desired expectation =================+===================================+========+=======================+==================== mips-linux-gnu | -target mips-linux-gnu | | Pass | Pass mips-linux-gnu | -target mips64-linux-gnu -mabi=64 | | Pass | Pass mips-linux-gnu | -target mips-linux-gnu | mips | Fail | Fail mips-linux-gnu | -target mips64-linux-gnu -mabi=64 | mips | Fail | Fail/Pass* (debatable**) mips-linux-gnu | -target mips-linux-gnu | mips- | Fail | Fail mips-linux-gnu | -target mips64-linux-gnu -mabi=64 | mips- | Fail | Pass* mips-linux-gnu | -target mips-linux-gnu | mips64 | Pass | Pass mips-linux-gnu | -target mips64-linux-gnu -mabi=64 | mips64 | Pass | Fail* mips64-linux-gnu | -target mips-linux-gnu | | Pass | Pass mips64-linux-gnu | -target mips64-linux-gnu -mabi=64 | | Pass | Pass mips64-linux-gnu | -target mips-linux-gnu | mips | Fail | Fail* mips64-linux-gnu | -target mips64-linux-gnu -mabi=64 | mips | Fail | Fail/Pass (debatable**) mips64-linux-gnu | -target mips-linux-gnu | mips- | Pass | Fail* mips64-linux-gnu | -target mips64-linux-gnu -mabi=64 | mips- | Pass | Pass mips64-linux-gnu | -target mips-linux-gnu | mips64 | Fail | Pass* mips64-linux-gnu | -target mips64-linux-gnu -mabi=64 | mips64 | Fail | Fail x64_64-linux-gnu | -target i386-linux-gnu | | Pass | Pass x64_64-linux-gnu | -target x86_64-linux-gnu | | Pass | Pass x64_64-linux-gnu | -target i386-linux-gnu | i386 | Pass | Fail* x64_64-linux-gnu | -target x86_64-linux-gnu | i386 | Pass | Pass x64_64-linux-gnu | -target i386-linux-gnu | x86_64 | Fail | Pass x64_64-linux-gnu | -target x86_64-linux-gnu | x86_64 | Fail | Fail* * These all differ from LIT's current behaviour. ** People's expectations vary depending on whether they know that LIT does a substring match on the default triple or think it's an exact match on an architecture.This patch adds "target-is-${target_arch}" to the available features list andupdates the mips XFAIL's to use them. XFAIL'ing on these features willcorrectly account for the target being tested. Making the table: Options | XFAIL | LIT's expected result ==================================+==================+====================== -target mips-linux-gnu | | Pass -target mips64-linux-gnu -mabi=64 | | Pass -target mips-linux-gnu | target-is-mips | Fail -target mips64-linux-gnu -mabi=64 | target-is-mips | Pass -target mips-linux-gnu | target-is-mips64 | Pass -target mips64-linux-gnu -mabi=64 | target-is-mips64 | Fail -target i386-linux-gnu | | Pass -target x86_64-linux-gnu | | Pass -target i386-linux-gnu | target-is-i386 | Fail -target x86_64-linux-gnu | target-is-i386 | Pass -target i386-linux-gnu | target-is-x86_64 | Pass -target x86_64-linux-gnu | target-is-x86_64 | FailReviewers: probinsonSubscribers: probinson, kubabrecka, llvm-commits, samsonovDifferential Revision: https://reviews.llvm.org/D22802llvm-svn: 278116