Skip to content

run-make/relocation-model: "final link failed: Nonrepresentable section on output" #47037

Closed
@SimonSapin

Description

@SimonSapin

Running ./x.py test on unmodified master bfbb1f5 fails on Ubuntu 17.10. The output ends like this:

failures:

---- [run-make] run-make/relocation-model stdout ----
	
error: make failed
status: exit code: 2
command: "make"
stdout:
------------------------------------------
LD_LIBRARY_PATH="/home/simon/rust/build/x86_64-unknown-linux-gnu/test/run-make/relocation-model.stage2-x86_64-unknown-linux-gnu:/home/simon/rust/build/x86_64-unknown-linux-gnu/stage2/lib:/home/simon/rust/build/x86_64-unknown-linux-gnu/stage0-tools/x86_64-unknown-linux-gnu/release/deps:/home/simon/rust/build/x86_64-unknown-linux-gnu/stage0-sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib:" '/home/simon/rust/build/x86_64-unknown-linux-gnu/stage2/bin/rustc' --out-dir /home/simon/rust/build/x86_64-unknown-linux-gnu/test/run-make/relocation-model.stage2-x86_64-unknown-linux-gnu -L /home/simon/rust/build/x86_64-unknown-linux-gnu/test/run-make/relocation-model.stage2-x86_64-unknown-linux-gnu  -C relocation-model=static foo.rs
Makefile:17: recipe for target 'others' failed

------------------------------------------
stderr:
------------------------------------------
error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/home/simon/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/home/simon/rust/build/x86_64-unknown-linux-gnu/test/run-make/relocation-model.stage2-x86_64-unknown-linux-gnu/foo.foo0.rcgu.o" "/home/simon/rust/build/x86_64-unknown-linux-gnu/test/run-make/relocation-model.stage2-x86_64-unknown-linux-gnu/foo.foo1.rcgu.o" "/home/simon/rust/build/x86_64-unknown-linux-gnu/test/run-make/relocation-model.stage2-x86_64-unknown-linux-gnu/foo.foo2.rcgu.o" "-o" "/home/simon/rust/build/x86_64-unknown-linux-gnu/test/run-make/relocation-model.stage2-x86_64-unknown-linux-gnu/foo" "/home/simon/rust/build/x86_64-unknown-linux-gnu/test/run-make/relocation-model.stage2-x86_64-unknown-linux-gnu/foo.crate.allocator.rcgu.o" "-Wl,--gc-sections" "-Wl,-z,relro,-z,now" "-nodefaultlibs" "-L" "/home/simon/rust/build/x86_64-unknown-linux-gnu/test/run-make/relocation-model.stage2-x86_64-unknown-linux-gnu" "-L" "/home/simon/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/home/simon/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-0baa2c971f4ccb5c.rlib" "/home/simon/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc_jemalloc-276e820bb149c519.rlib" "/home/simon/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-d795c34fd7eb72c9.rlib" "/home/simon/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-0f4b95d88e53e455.rlib" "/home/simon/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc_system-6d9370e956155877.rlib" "/home/simon/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-f874e85b0fc1f5b8.rlib" "/home/simon/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-c7758873e5bedec1.rlib" "/home/simon/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_unicode-c9b8ae6d904bd621.rlib" "/home/simon/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-c80c8268f013635d.rlib" "/home/simon/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-6389cf691b0a8db6.rlib" "-Wl,-Bdynamic" "-l" "dl" "-l" "rt" "-l" "pthread" "-l" "pthread" "-l" "gcc_s" "-l" "c" "-l" "m" "-l" "rt" "-l" "pthread" "-l" "util" "-l" "util"
  = note: /usr/bin/ld: /home/simon/rust/build/x86_64-unknown-linux-gnu/test/run-make/relocation-model.stage2-x86_64-unknown-linux-gnu/foo.foo0.rcgu.o: relocation R_X86_64_32 against symbol `rust_eh_personality' can not be used when making a shared object; recompile with -fPIC
          /usr/bin/ld: final link failed: Nonrepresentable section on output
          collect2: error: ld returned 1 exit status
          

error: aborting due to previous error

make: *** [others] Error 101

------------------------------------------

thread '[run-make] run-make/relocation-model' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:2776:8
note: Run with `RUST_BACKTRACE=1` for a backtrace.


failures:
    [run-make] run-make/relocation-model

test result: FAILED. 168 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out

thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:476:21


command did not execute successfully: "/home/simon/rust/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/home/simon/rust/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/home/simon/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/home/simon/rust/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--rustdoc-path" "/home/simon/rust/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" "--src-base" "/home/simon/rust/src/test/run-make" "--build-base" "/home/simon/rust/build/x86_64-unknown-linux-gnu/test/run-make" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "run-make" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/home/simon/rust/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--nodejs" "/usr/bin/node" "--host-rustcflags" "-Crpath -O -Zmiri -Zunstable-options" "--target-rustcflags" "-Crpath -O -Zmiri -Zunstable-options -Lnative=/home/simon/rust/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python" "--lldb-python" "/usr/bin/python" "--gdb" "/usr/bin/gdb" "--llvm-version" "4.0.1\n" "--cc" "cc" "--cxx" "c++" "--cflags" "-ffunction-sections -fdata-sections -fPIC -m64" "--llvm-components" "aarch64 aarch64asmparser aarch64asmprinter aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils all all-targets analysis arm armasmparser armasmprinter armcodegen armdesc armdisassembler arminfo asmparser asmprinter bitreader bitwriter codegen core coroutines coverage debuginfocodeview debuginfodwarf debuginfomsf debuginfopdb demangle engine executionengine globalisel hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo instcombine instrumentation interpreter ipo irreader jsbackend jsbackendcodegen jsbackenddesc jsbackendinfo libdriver lineeditor linker lto mc mcdisassembler mcjit mcparser mips mipsasmparser mipsasmprinter mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmprinter msp430codegen msp430desc msp430info native nativecodegen nvptx nvptxasmprinter nvptxcodegen nvptxdesc nvptxinfo objcarcopts object objectyaml option orcjit passes pnacltransforms powerpc powerpcasmparser powerpcasmprinter powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata runtimedyld scalaropts selectiondag sparc sparcasmparser sparcasmprinter sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzasmprinter systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target transformutils vectorize x86 x86asmparser x86asmprinter x86codegen x86desc x86disassembler x86info x86utils" "--llvm-cxxflags" "-I/home/simon/rust/build/x86_64-unknown-linux-gnu/llvm/include -ffunction-sections -fdata-sections -fPIC -m64 -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -Werror=date-time -std=c++11 -ffunction-sections -fdata-sections -O3 -DNDEBUG  -fno-exceptions -fno-rtti -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS" "--ar" "ar" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" ""
expected success, got: exit code: 101

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-testsuiteArea: The testsuite used to check the correctness of rustcC-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions