Hi Alexandre

Alexandre Oliva <ol...@adacore.com> wrote:


When the linker plugin is not available, dump outputs in lto runs are
different from those outputs.exp tests expect, so skip them for now.

Targets (like Darwin too) that don’t have the linker plugin (presumably)
use fat LTO objects and drive the LTO process using collect2 (Darwin
and Solaris seem to be two at least that do this)

That means that the intermediate objects proceed all the way to .s
output - and thus the ‘final’ pass is run (producing the extra files seen).

You can mimic this with x86 Linux by appending -ffat-lto-objects to an
LTO command line.

I have an ugly patch that makes this work for Darwin (essentially, by
having two versions of the LTO tests - one for targets with fat LTO
and one for thin) since it seems that one has to apply all the files
expected to the list - [this comment is also on PR95577].

Perhaps, as the author, you can see a more elegant way to implement
this - and I was wondering (as an aside) if the -ffat-lto-objects case should
be tested on targets which default to thin LTO anyway?

cheers
Iain

Regstrapped on x86_64-linux-gnu.  Ok to install?


for  gcc/testsuite/ChangeLog

        * outputs.exp (skip_lto): Set when missing the linker plugin.
---
testsuite/gcc.misc-tests/outputs.exp |    3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git gcc/testsuite/gcc.misc-tests/outputs.exp gcc/testsuite/gcc.misc-tests/outputs.exp
index 06a32db..a47f8a6 100644
--- gcc/testsuite/gcc.misc-tests/outputs.exp
+++ gcc/testsuite/gcc.misc-tests/outputs.exp
@@ -42,7 +42,8 @@ if ![check_no_compiler_messages gsplitdwarf object {

# Check for -flto support.  We explicitly test the result to skip
# tests that use -flto.
-set skip_lto ![check_effective_target_lto]
+set skip_lto { ![check_effective_target_lto] \
+              || ![check_linker_plugin_available] }

# Prepare additional options to be used for linking.
# We do not compile to an executable, because that requires naming an output.


--
Alexandre Oliva, freedom fighter    he/him    https://FSFLA.org/blogs/lxo/
Free Software Evangelist              Stallman was right, but he's left :(
GNU Toolchain Engineer           Live long and free, and prosper ethically


Reply via email to