This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC][PATCH][ld][testsuite] Add -ffat-lto-objects option to some ld tests


On 26/11/13 15:34, H.J. Lu wrote:
On Tue, Nov 26, 2013 at 7:00 AM, Kyrill Tkachov <kyrylo.tkachov@arm.com> wrote:
On 26/11/13 14:58, H.J. Lu wrote:
On Tue, Nov 26, 2013 at 6:55 AM, Kyrill Tkachov <kyrylo.tkachov@arm.com>
wrote:
On 26/11/13 14:36, H.J. Lu wrote:
On Tue, Nov 26, 2013 at 6:32 AM, Kyrill Tkachov <kyrylo.tkachov@arm.com>
wrote:
Hi all,

I'm seeing some ld testsuite failures on arm-none-linux-gnueabi and
aarch64-none-linux-gnu after a recent gcc commit (r205065) that set
-fno-fat-lto-objects as the default:

PASS->FAIL: LTO 3 symbol
PASS->FAIL: PR ld/12758
PASS->FAIL: PR ld/12760
PASS->FAIL: PR ld/13183

It seems that these tests need -ffat-lto-objects, at least on arm and
aarch64, but I'm not sure I understand the structure of these ld tests
well.

Could someone please comment on whether this is the correct approach?
CC'ing H.J. since he wrote the lto.exp file.

Does -ffat-lto-objects always work when -flto is supported?
If yes, OK for trunk.

The gcc manual says about -ffat-lto-objects: " This option is effective
only
when compiling with -flto and is ignored at link time".
I'd think that it's supposed to always work with -flto.

Was -ffat-lto-objects added together with -flto?
Hmmm... it seems not. -ffat-lto-objects exists in 4.7 but not in 4.6. -flto
was added in 4.6.

Please add  -ffat-lto-objects to check_lto_available.
Then you can use it in lto.exp.
Like this?

[ld/testsuite/]
2013-11-27  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

    * ld-plugin/lto.exp: Add -ffat-lto-objects.
    * lib/ld-lib.exp (check_lto_available): Likewise.
diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
index c5249f0..69946de 100644
--- a/ld/testsuite/ld-plugin/lto.exp
+++ b/ld/testsuite/ld-plugin/lto.exp
@@ -57,7 +57,7 @@ set lto_link_tests {
    "" "-O2"
    {lto-3c.c} {} "libdummy.a"}
   {"Build liblto-3.a"
-   "" "-flto"
+   "" "-flto -ffat-lto-objects"
    {lto-3b.c} {} "liblto-3.a"}
   {"Build libdummy.a 5a"
    "" "-flto"
@@ -111,7 +111,7 @@ set lto_link_tests {
    "" ""
    {pr12758a.s} {} "libdummy.a"}
   {"Build libpr12758.a"
-   "" "-flto -O2"
+   "" "-flto -O2 -ffat-lto-objects"
    {pr12758b.c} {} "libpr12758.a"}
   {"PR ld/12758"
    "-O2 -Wl,-e,foo -nostdlib -flto -fuse-linker-plugin tmpdir/pr12758a.o -Wl,--start-group tmpdir/libpr12758.a -Wl,--end-group" ""
@@ -120,13 +120,13 @@ set lto_link_tests {
    "" ""
    {pr12760a.c} {} "libdummy.a"}
   {"Build libpr12760.a"
-   "" "-flto -O2"
+   "" "-flto -O2 -ffat-lto-objects"
    {pr12760b.c} {} "libpr12760.a"}
   {"PR ld/12760"
    "-O2 -Wl,-e,foo -nostdlib -flto -fuse-linker-plugin tmpdir/pr12760a.o -Wl,--start-group tmpdir/libpr12760.a -Wl,--end-group" ""
    {dummy.c} {} "pr12760.exe" "c" "warning: Bad bar"}
   {"Build libpr13183.a"
-   "-T" "-flto -O2"
+   "-T" "-flto -O2 -ffat-lto-objects"
    {pr13183a.c} {} "libpr13183.a"}
   {"Build libdummy.a PR ld/13183"
    "" "-flto -O2"
diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
index 67c429f..a34a0497 100644
--- a/ld/testsuite/lib/ld-lib.exp
+++ b/ld/testsuite/lib/ld-lib.exp
@@ -1641,7 +1641,7 @@ proc check_lto_available { } {
 	set f [open $src "w"]
 	puts $f ""
 	close $f
-	set status [remote_exec host $CC "-shared -B[pwd]/tmpdir/ld/ -flto -fuse-linker-plugin $src -o $output"]
+	set status [remote_exec host $CC "-shared -B[pwd]/tmpdir/ld/ -flto -ffat-lto-objects -fuse-linker-plugin $src -o $output"]
 	if { [lindex $status 0] == 0 } {
 	    set lto_available_saved 1
 	} else {

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]