Skip to content

Commit 9e875ae

Browse files
nikictbaederr
authored andcommitted
Add i686 -> i386 compiler-rt symlink
This ports the change from https://src.fedoraproject.org/rpms/compiler-rt/pull-request/67 to big-merge, which is a bit more complicated here due to the explicit file lists. By default compiler_rt_triple is the same as llvm_triple. For x86 it is i386-redhat-linux-gnu instead, with a symlink to the llvm_triple i686-redhat-linux-gnu. And then the file list also needs to ship that symlink.
1 parent c14e5cf commit 9e875ae

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

files.spec.inc

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -511,15 +511,20 @@
511511
%{_prefix}/lib/clang/%{maj_ver}/share/*.txt
512512

513513
# Files that appear on all targets
514-
%{_prefix}/lib/clang/%{maj_ver}/lib/%{llvm_triple}/libclang_rt.*
514+
%{_prefix}/lib/clang/%{maj_ver}/lib/%{compiler_rt_triple}/libclang_rt.*
515515

516516
%ifnarch s390x
517-
%{_prefix}/lib/clang/%{maj_ver}/lib/%{llvm_triple}/clang_rt.crtbegin.o
518-
%{_prefix}/lib/clang/%{maj_ver}/lib/%{llvm_triple}/clang_rt.crtend.o
517+
%{_prefix}/lib/clang/%{maj_ver}/lib/%{compiler_rt_triple}/clang_rt.crtbegin.o
518+
%{_prefix}/lib/clang/%{maj_ver}/lib/%{compiler_rt_triple}/clang_rt.crtend.o
519519
%endif
520520

521521
%ifnarch %{ix86} s390x
522-
%{_prefix}/lib/clang/%{maj_ver}/lib/%{llvm_triple}/liborc_rt.a
522+
%{_prefix}/lib/clang/%{maj_ver}/lib/%{compiler_rt_triple}/liborc_rt.a
523+
%endif
524+
525+
# Additional symlink if two triples are in use.
526+
%if "%{llvm_triple}" != "%{compiler_rt_triple}"
527+
%{_prefix}/lib/clang/%{maj_ver}/lib/%{llvm_triple}
523528
%endif
524529

525530
%endif

install.spec.inc

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,23 @@ echo "--gcc-triple=%{_target_cpu}-redhat-linux" >> %{buildroot}%{_sysconfdir}/%{
202202

203203
%if %{without compat_build}
204204

205+
# Triple where compiler-rt libs are installed. If it differs from llvm_triple, then there is
206+
# also a symlink llvm_triple -> compiler_rt_triple.
207+
%global compiler_rt_triple %{llvm_triple}
208+
205209
%ifarch ppc64le
206210
# Fix install path on ppc64le so that the directory name matches the triple used
207211
# by clang.
208-
mv %{buildroot}%{_prefix}/lib/clang/%{maj_ver}/lib/powerpc64le-redhat-linux-gnu %{buildroot}%{_prefix}/lib/clang/%{maj_ver}/lib/ppc64le-redhat-linux-gnu
212+
mv %{buildroot}%{_prefix}/lib/clang/%{maj_ver}/lib/powerpc64le-redhat-linux-gnu %{buildroot}%{_prefix}/lib/clang/%{maj_ver}/lib/%{llvm_triple}
213+
%endif
214+
215+
%ifarch %{ix86}
216+
# Fix install path on ix86 so that the directory name matches the triple used
217+
# by clang on both actual ix86 (i686) and on x86_64 with -m32 (i386):
218+
%global compiler_rt_triple i386-redhat-linux-gnu
219+
%if "%{llvm_triple}" != "%{compiler_rt_triple}"
220+
ln -s %{compiler_rt_triple} %{buildroot}%{_prefix}/lib/clang/%{maj_ver}/lib/%{llvm_triple}
221+
%endif
209222
%endif
210223

211224
%endif

0 commit comments

Comments
 (0)