diff --git a/files.spec.inc b/files.spec.inc index 59dee2a..59b03e5 100644 --- a/files.spec.inc +++ b/files.spec.inc @@ -511,15 +511,20 @@ %{_prefix}/lib/clang/%{maj_ver}/share/*.txt # Files that appear on all targets -%{_prefix}/lib/clang/%{maj_ver}/lib/%{llvm_triple}/libclang_rt.* +%{_prefix}/lib/clang/%{maj_ver}/lib/%{compiler_rt_triple}/libclang_rt.* %ifnarch s390x -%{_prefix}/lib/clang/%{maj_ver}/lib/%{llvm_triple}/clang_rt.crtbegin.o -%{_prefix}/lib/clang/%{maj_ver}/lib/%{llvm_triple}/clang_rt.crtend.o +%{_prefix}/lib/clang/%{maj_ver}/lib/%{compiler_rt_triple}/clang_rt.crtbegin.o +%{_prefix}/lib/clang/%{maj_ver}/lib/%{compiler_rt_triple}/clang_rt.crtend.o %endif %ifnarch %{ix86} s390x -%{_prefix}/lib/clang/%{maj_ver}/lib/%{llvm_triple}/liborc_rt.a +%{_prefix}/lib/clang/%{maj_ver}/lib/%{compiler_rt_triple}/liborc_rt.a +%endif + +# Additional symlink if two triples are in use. +%if "%{llvm_triple}" != "%{compiler_rt_triple}" +%{_prefix}/lib/clang/%{maj_ver}/lib/%{llvm_triple} %endif %endif diff --git a/install.spec.inc b/install.spec.inc index db4b5a9..f97a81b 100644 --- a/install.spec.inc +++ b/install.spec.inc @@ -202,10 +202,23 @@ echo "--gcc-triple=%{_target_cpu}-redhat-linux" >> %{buildroot}%{_sysconfdir}/%{ %if %{without compat_build} +# Triple where compiler-rt libs are installed. If it differs from llvm_triple, then there is +# also a symlink llvm_triple -> compiler_rt_triple. +%global compiler_rt_triple %{llvm_triple} + %ifarch ppc64le # Fix install path on ppc64le so that the directory name matches the triple used # by clang. -mv %{buildroot}%{_prefix}/lib/clang/%{maj_ver}/lib/powerpc64le-redhat-linux-gnu %{buildroot}%{_prefix}/lib/clang/%{maj_ver}/lib/ppc64le-redhat-linux-gnu +mv %{buildroot}%{_prefix}/lib/clang/%{maj_ver}/lib/powerpc64le-redhat-linux-gnu %{buildroot}%{_prefix}/lib/clang/%{maj_ver}/lib/%{llvm_triple} +%endif + +%ifarch %{ix86} +# Fix install path on ix86 so that the directory name matches the triple used +# by clang on both actual ix86 (i686) and on x86_64 with -m32 (i386): +%global compiler_rt_triple i386-redhat-linux-gnu +%if "%{llvm_triple}" != "%{compiler_rt_triple}" +ln -s %{compiler_rt_triple} %{buildroot}%{_prefix}/lib/clang/%{maj_ver}/lib/%{llvm_triple} +%endif %endif %endif