Skip to content

1.19 powerpc64le run-pass test failure: smallest-hello-world sometimes has bad interaction with --gc-sections #44683

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

Closed
infinity0 opened this issue Sep 18, 2017 · 2 comments

Comments

@infinity0
Copy link
Contributor

This test fails on Debian but not Fedora. I can also reproduce it with the clean 1.19.0 tarball without Debian patches, but ./configure-d to use Debian's LLVM 4.0.

------stderr------------------------------
error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/<<BUILDDIR>>/rustc-1.19.0+dfsg3/build/powerpc64le-unknown-linux-gnu/stage2/lib/rustlib/powerpc64le-unknown-linux-gnu/lib" "/<<BUILDDIR>>/rustc-1.19.0+dfsg3/build/powerpc64le-unknown-linux-gnu/test/run-pass/smallest-hello-world.0.o" "-o" "/<<BUILDDIR>>/rustc-1.19.0+dfsg3/build/powerpc64le-unknown-linux-gnu/test/run-pass/smallest-hello-world.stage2-powerpc64le-unknown-linux-gnu" "-Wl,--gc-sections" "-pie" "-Wl,-O1" "-nodefaultlibs" "-L" "/<<BUILDDIR>>/rustc-1.19.0+dfsg3/build/powerpc64le-unknown-linux-gnu/test/run-pass" "-L" "/<<BUILDDIR>>/rustc-1.19.0+dfsg3/build/powerpc64le-unknown-linux-gnu/test/run-pass/smallest-hello-world.stage2-powerpc64le-unknown-linux-gnu.run-pass.libaux" "-L" "/<<BUILDDIR>>/rustc-1.19.0+dfsg3/build/powerpc64le-unknown-linux-gnu/native/rust-test-helpers" "-L" "/<<BUILDDIR>>/rustc-1.19.0+dfsg3/build/powerpc64le-unknown-linux-gnu/stage2/lib/rustlib/powerpc64le-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/<<BUILDDIR>>/rustc-1.19.0+dfsg3/build/powerpc64le-unknown-linux-gnu/stage2/lib/rustlib/powerpc64le-unknown-linux-gnu/lib/liblibc-5281d33b9c81245c.rlib" "/<<BUILDDIR>>/rustc-1.19.0+dfsg3/build/powerpc64le-unknown-linux-gnu/stage2/lib/rustlib/powerpc64le-unknown-linux-gnu/lib/libcore-5c2b844a2a519641.rlib" "-Wl,-Bdynamic" "-l" "c" "-l" "m" "-l" "rt" "-l" "pthread" "-l" "util" "-Wl,-rpath,/usr/lib/rustlib/powerpc64le-unknown-linux-gnu/lib" "-Wl,--enable-new-dtags"
  = note: /usr/bin/ld: stubs don't match calculated size
          /usr/bin/ld: can not build stubs: Invalid operation
          collect2: error: ld returned 1 exit status
          

error: aborting due to previous error(s)
------------------------------------------

As indicated by the error message there is a long cc invocation. If I run it manually, I get the same failure. However if I remove the "-Wl,--gc-sections" flag then the compilation succeeds. Adding "-Wl,--print-gc-sections" gives me:

(experimental_ppc64el-dchroot)infinity0@plummer:~/rustc-1.19.0-src$ sh test.sh
/usr/bin/ld: Removing unused section '.rodata.cst4' in file '/usr/lib/gcc/powerpc64le-linux-gnu/7/../../../powerpc64le-linux-gnu/Scrt1.o'
/usr/bin/ld: Removing unused section '.data' in file '/usr/lib/gcc/powerpc64le-linux-gnu/7/../../../powerpc64le-linux-gnu/Scrt1.o'
/usr/bin/ld: Removing unused section '.text.rust_eh_register_frames' in file '/home/infinity0/rustc-1.19.0-src/build/powerpc64le-unknown-linux-gnu/test/run-pass/smallest-hello-world.0.o'
/usr/bin/ld: Removing unused section '.text.rust_eh_unregister_frames' in file '/home/infinity0/rustc-1.19.0-src/build/powerpc64le-unknown-linux-gnu/test/run-pass/smallest-hello-world.0.o'
/usr/bin/ld: stubs don't match calculated size
/usr/bin/ld: can not build stubs: Invalid operation
collect2: error: ld returned 1 exit status
@infinity0
Copy link
Contributor Author

Seems to be caused by binutils trunk commits https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=876134

@infinity0
Copy link
Contributor Author

Fixed in binutils upstream and Debian unstable, closing.

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

No branches or pull requests

1 participant