Use llvm3.9 to fix rawhide FTBFS with llvm-4

However, plugins currently don't work well with dynamic LLVM in
non-standard library paths:

   https://github.com/rust-lang/rust/issues/40717
This commit is contained in:
Josh Stone 2017-03-31 11:00:59 -07:00
parent 2e9a258bc1
commit 2453b710d4

View File

@ -128,13 +128,20 @@ BuildRequires: cmake
%endif %endif
Provides: bundled(llvm) = 3.9 Provides: bundled(llvm) = 3.9
%else %else
BuildRequires: llvm-devel >= 3.7 %if 0%{?fedora} >= 27
%global llvm llvm3.9
%global llvm_root %{_libdir}/%{llvm}
%else
%global llvm llvm
%global llvm_root %{_prefix}
%endif
BuildRequires: %{llvm}-devel >= 3.7
%if %with llvm_static %if %with llvm_static
BuildRequires: llvm-static BuildRequires: %{llvm}-static
BuildRequires: libffi-devel BuildRequires: libffi-devel
%else %else
# Make sure llvm-config doesn't see it. # Make sure llvm-config doesn't see it.
BuildConflicts: llvm-static BuildConflicts: %{llvm}-static
%endif %endif
%endif %endif
@ -182,6 +189,14 @@ Requires: rust-rpm-macros
%global _find_debuginfo_opts -g %global _find_debuginfo_opts -g
%undefine _include_minidebuginfo %undefine _include_minidebuginfo
# Use hardening ldflags.
%global rustflags -Clink-arg=-Wl,-z,relro,-z,now
%if %{without bundled_llvm} && "%{llvm_root}" != "%{_prefix}"
# https://github.com/rust-lang/rust/issues/40717
%global rustflags %{rustflags} -Clink-arg=-L%{llvm_root}/lib
%endif
%description %description
Rust is a systems programming language that runs blazingly fast, prevents Rust is a systems programming language that runs blazingly fast, prevents
segfaults, and guarantees thread safety. segfaults, and guarantees thread safety.
@ -286,9 +301,6 @@ sed -i.ffi -e '$a #[link(name = "ffi")] extern {}' \
%build %build
%{?cmake_path:export PATH=%{cmake_path}:$PATH} %{?cmake_path:export PATH=%{cmake_path}:$PATH}
# Use hardening ldflags.
%global rustflags -Clink-arg=-Wl,-z,relro,-z,now
export RUSTFLAGS="%{rustflags}" export RUSTFLAGS="%{rustflags}"
# We're going to override --libdir when configuring to get rustlib into a # We're going to override --libdir when configuring to get rustlib into a
@ -300,7 +312,7 @@ export RUSTFLAGS="%{rustflags}"
--libdir=%{common_libdir} \ --libdir=%{common_libdir} \
--build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple} \ --build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple} \
--enable-local-rust --local-rust-root=%{local_rust_root} \ --enable-local-rust --local-rust-root=%{local_rust_root} \
%{!?with_bundled_llvm: --llvm-root=%{_prefix} --disable-codegen-tests \ %{!?with_bundled_llvm: --llvm-root=%{llvm_root} --disable-codegen-tests \
%{!?with_llvm_static: --enable-llvm-link-shared } } \ %{!?with_llvm_static: --enable-llvm-link-shared } } \
--disable-jemalloc \ --disable-jemalloc \
--disable-rpath \ --disable-rpath \