Skip to content

tests.mk/runtest.rs splits RUSTFLAGS/host_rustcflags,target_rustcflags inappropriately #31529

@infinity0

Description

@infinity0

edit: TL;DR: tests.mk and runtest.rs respectively split RUSTFLAGS and {host,target}_rustcflags inappropriately; reproduce this in rust upstream (1.8 and earlier) by:

  • test.mk bug: set RUSTFLAGS="-C link-args=\"-Wl,-Bsymbolic-functions -Wl,-z,relro\"" when building tests
  • runtest.rs bug: set RUSTFLAGS="-C link-args='-Wl,-Bsymbolic-functions -Wl,-z,relro'" when running tests.

These are two separate and independent bugs.


Hi, I'm having a hard time debugging a build failure and was wondering if anyone could help. We have multiple identical build failures for Ubuntu across different versions of rustc e.g. see 1.5 on amd64-xenial, 1.8-nightly-20160209 on i386-xenial, 1.8-nightly-20160209 on amd64-xenial. The packages are based on the working Debian packages.

The failure looks related to the command line being run; however they are very similar on Debian and Ubuntu (newlines manually inserted for clarity):

--- debian (from my local testing)
+++ ubuntu (from the 1.8 amd64-xenial link above)
@@ -1,41 +1,41 @@
 LD_LIBRARY_PATH=
  /«BUILDDIR»/rustc-1.8.0~~nightly.20160209+dfsg1/x86_64-unknown-linux-gnu/stage2/lib:
  /usr/lib/llvm-3.7/lib:
  $LD_LIBRARY_PATH
 x86_64-unknown-linux-gnu/stage2/bin/compiletest
  --compile-lib-path x86_64-unknown-linux-gnu/stage2/lib
  --run-lib-path x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib
  --rustc-path x86_64-unknown-linux-gnu/stage2/bin/rustc
  --rustdoc-path x86_64-unknown-linux-gnu/stage2/bin/rustdoc
  --llvm-bin-path /usr/lib/llvm-3.7/bin
  --aux-base /«BUILDDIR»/rustc-1.8.0~~nightly.20160209+dfsg1/src/test/auxiliary/
  --stage-id stage2-x86_64-unknown-linux-gnu
  --target x86_64-unknown-linux-gnu
  --host x86_64-unknown-linux-gnu
  --python "/usr/bin/python2.7"
- --gdb-version="GNU gdb (Debian 7.10-1+b1) 7.10"
+ --gdb-version="GNU gdb (Ubuntu 7.10.1-0ubuntu1) 7.10.1"
  --lldb-version=""
  --android-cross-path=/opt/ndk_standalone
  --adb-path=
  --adb-test-dir=
- --host-rustcflags " -C link-args="-Wl,-z,relro" --cfg rtopt -C rpath -O -L x86_64-unknown-linux-gnu/rt"
+ --host-rustcflags " -C link-args="-Wl,-Bsymbolic-functions -Wl,-z,relro" --cfg rtopt -C rpath -O -L x86_64-unknown-linux-gnu/rt"
  --lldb-python-dir=
- --target-rustcflags " -C link-args="-Wl,-z,relro" --cfg rtopt -C rpath -O -L x86_64-unknown-linux-gnu/rt"
+ --target-rustcflags " -C link-args="-Wl,-Bsymbolic-functions -Wl,-z,relro" --cfg rtopt -C rpath -O -L x86_64-unknown-linux-gnu/rt"
  --verbose
  --valgrind-path ""/usr/bin/valgrind"
   --error-exitcode=100
   --fair-sched=try
   --quiet
   --soname-synonyms=somalloc=NONE
   --suppressions=/«BUILDDIR»/rustc-1.8.0~~nightly.20160209+dfsg1/src/etc/x86.supp
   --tool=memcheck
   --leak-check=full"
  --force-valgrind
  --src-base /«BUILDDIR»/rustc-1.8.0~~nightly.20160209+dfsg1/src/test/rustdoc/
  --build-base x86_64-unknown-linux-gnu/test/rustdoc/
  --mode rustdoc
  --logfile tmp/check-stage2-T-x86_64-unknown-linux-gnu-H-x86_64-unknown-linux-gnu-rustdocck.log &&
 touch -r
  tmp/check-stage2-T-x86_64-unknown-linux-gnu-H-x86_64-unknown-linux-gnu-rustdocck.ok.start_time
  tmp/check-stage2-T-x86_64-unknown-linux-gnu-H-x86_64-unknown-linux-gnu-rustdocck.ok &&
 rm tmp/check-stage2-T-x86_64-unknown-linux-gnu-H-x86_64-unknown-linux-gnu-rustdocck.ok.start_time

The failure on Ubuntu looks like this:

run rustdocck [i686-unknown-linux-gnu]: i686-unknown-linux-gnu/stage2/bin/compiletest
thread '<main>' panicked at 'UnrecognizedOption("W")', /«BUILDDIR»/rustc-1.8.0~~nightly.20160209+dfsg1/src/compiletest/compiletest.rs:101
stack backtrace:
   1: 0xf737b154 - sys::backtrace::tracing::imp::write::h59a57150de078a41Btu
   2: 0xf7383891 - panicking::default_handler::_$u7b$$u7b$closure$u7d$$u7d$::closure.43171
   3: 0xf7383412 - panicking::default_handler::he7b491197c6c99803Wy
   4: 0xf7347e85 - sys_common::unwind::begin_unwind_inner::h0ac7a886eb1f5e41qit
   5: 0xf7348937 - sys_common::unwind::begin_unwind_fmt::h5539aae7d4657c99wht
   6: 0xf76e23cd - parse_config::hd63e903e447ce232uCd
   7: 0xf76da65c - main::hcc56979a8470e836GBd
   8: 0xf7382e8a - sys_common::unwind::try::try_fn::h1480467219455099781
   9: 0xf7378a57 - __rust_try
  10: 0xf7382b5c - rt::lang_start::hb58bd81a27354c059Oy
  11: 0xf76e635d - main
  12: 0xf710271d - __libc_start_main
  13: 0xf76d9d10 - <unknown>
/«BUILDDIR»/rustc-1.8.0~~nightly.20160209+dfsg1/mk/tests.mk:743: recipe for target 'tmp/check-stage2-T-i686-unknown-linux-gnu-H-i686-unknown-linux-gnu-rustdocck.ok' failed
make[2]: *** [tmp/check-stage2-T-i686-unknown-linux-gnu-H-i686-unknown-linux-gnu-rustdocck.ok] Error 101

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions