MFH: r523512

lang/rust-nightly: Unbreak with lld on 12.1/13.0 i386

 = note: ld: error: relocation R_386_PC32 cannot be used against symbol __rust_probestack; recompile with -fPIC
          >>> defined in /wrkdirs/usr/ports/lang/rust-nightly/work/rustc-nightly-src/build/i686-unknown-freebsd/stage1/lib/rustlib/i686-unknown-freebsd/lib/libcompiler_builtins-6570a75fe85f0e1a.rlib(compiler_builtins-6570a75fe85f0e1a.compiler_builtins.2i519eqi-cgu.15.rcgu.o)
          >>> referenced by std.4xivr03c-cgu.14
          >>>               std-9bd70afd58e204b7.std.4xivr03c-cgu.14.rcgu.o:(_$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h1c78ed6e734a2bfc (.llvm.10122419023709863394)) in archive /wrkdirs/usr/ports/lang/rust-nightly/work/rustc-nightly-src/build/i686-unknown-freebsd/stage1/lib/rustlib/i686-unknown-freebsd/lib/libstd-9bd70afd58e204b7.rlib

          ld: error: relocation R_386_PC32 cannot be used against symbol __rust_probestack; recompile with -fPIC
          >>> defined in /wrkdirs/usr/ports/lang/rust-nightly/work/rustc-nightly-src/build/i686-unknown-freebsd/stage1/lib/rustlib/i686-unknown-freebsd/lib/libcompiler_builtins-6570a75fe85f0e1a.rlib(compiler_builtins-6570a75fe85f0e1a.compiler_builtins.2i519eqi-cgu.15.rcgu.o)
          >>> referenced by std.4xivr03c-cgu.14
          >>>               std-9bd70afd58e204b7.std.4xivr03c-cgu.14.rcgu.o:(std::io::util::copy::h9115f048f2203467) in archive /wrkdirs/usr/ports/lang/rust-nightly/work/rustc-nightly-src/build/i686-unknown-freebsd/stage1/lib/rustlib/i686-unknown-freebsd/lib/libstd-9bd70afd58e204b7.rlib
          clang-cpp: error: linker command failed with exit code 1 (use -v to see invocation)

error: aborting due to previous error

http://beefy17.nyi.freebsd.org/data/head-i386-default/p523508_s356869/logs/rust-nightly-1.42.0.20200118.log
http://beefy4.nyi.freebsd.org/data/121i386-quarterly/527662/logs/rust-nightly-1.42.0.20191222.log

Approved by:	ports-secteam blanket
This commit is contained in:
Tobias Kortkamp 2020-03-04 17:56:57 +00:00
parent 2562ff257c
commit 795f7aa36e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/branches/2020Q1/; revision=527791
2 changed files with 15 additions and 3 deletions

View File

@ -1,11 +1,16 @@
--- src/librustc_target/spec/i686_unknown_freebsd.rs.orig 2018-06-19 04:35:53 UTC
--- src/librustc_target/spec/i686_unknown_freebsd.rs.orig 2020-01-17 16:00:01 UTC
+++ src/librustc_target/spec/i686_unknown_freebsd.rs
@@ -12,7 +12,7 @@ use spec::{LinkerFlavor, Target, TargetResult};
@@ -2,9 +2,11 @@ use crate::spec::{LinkerFlavor, Target, TargetResult};
pub fn target() -> TargetResult {
let mut base = super::freebsd_base::opts();
- base.cpu = "pentium4".to_string();
+ base.cpu = "pentiumpro".to_string();
base.max_atomic_width = Some(64);
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m32".to_string());
- base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m32".to_string());
+ let pre_link_args = base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap();
+ pre_link_args.push("-m32".to_string());
+ pre_link_args.push("-Wl,-znotext".to_string());
base.stack_probes = true;
Ok(Target {

View File

@ -170,7 +170,14 @@ do-configure:
@${ECHO_CMD} '[target.${_RUST_TARGET}]' >> ${WRKSRC}/config.toml
@${ECHO_CMD} 'cc="${CC}"' >> ${WRKSRC}/config.toml
@${ECHO_CMD} 'cxx="${CXX}"' >> ${WRKSRC}/config.toml
.if ${PKGNAMESUFFIX:U} == -nightly && ${ARCH} == i386
# https://github.com/rust-lang/rust/pull/68361
@${PRINTF} '#!/bin/sh\nexec ${CC} -Wl,-znotext "$$@"' > ${WRKDIR}/cc-wrapper
@${CHMOD} +x ${WRKDIR}/cc-wrapper
@${ECHO_CMD} 'linker="${WRKDIR}/cc-wrapper"' >> ${WRKSRC}/config.toml
.else
@${ECHO_CMD} 'linker="${CC}"' >> ${WRKSRC}/config.toml
.endif
@${ECHO_CMD} '[dist]' >> ${WRKSRC}/config.toml
@${ECHO_CMD} 'src-tarball=false' >> ${WRKSRC}/config.toml
@${REINPLACE_CMD} -e 's,%CC%,${CC},g' \