#67 Fix install path on i686
Merged 5 months ago by tuliom. Opened 6 months ago by churchyard.
rpms/ churchyard/compiler-rt i686  into  rawhide

file modified
+11 -1
@@ -34,7 +34,7 @@ 

  

  Name:		compiler-rt

  Version:	%{compiler_rt_version}%{?rc_ver:~rc%{rc_ver}}%{?llvm_snapshot_version_suffix:~%{llvm_snapshot_version_suffix}}

- Release:	1%{?dist}

+ Release:	2%{?dist}

  Summary:	LLVM "compiler-rt" runtime libraries

  

  License:	Apache-2.0 WITH LLVM-exception OR NCSA OR MIT
@@ -112,6 +112,13 @@ 

  # 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

  %endif

+ %ifarch %{ix86}

+ # Fix install path on ix86 so that the directory name matches the triple used

+ # by clang on both actual ix86 and on x86_64 with -m32:

+ %if "%{_target_cpu}" != "i386"

+ ln -s i386-redhat-linux-gnu %{buildroot}%{_prefix}/lib/clang/%{maj_ver}/lib/%{_target_cpu}-redhat-linux-gnu

+ %endif

+ %endif

  

  %check

  #%%cmake_build --target check-compiler-rt
@@ -131,6 +138,9 @@ 

  %changelog

  %{?llvm_snapshot_changelog_entry}

  

+ * Wed Dec 13 2023 Miro Hrončok <mhroncok@redhat.com> - 17.0.6-2

+ - Fix install path on i686

+ 

  * Wed Nov 29 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 17.0.6-1

  - Update to LLVM 17.0.6

  

See https://src.fedoraproject.org/rpms/rapidfuzz-cpp/pull-request/1#comment-172023

[ 43%] Linking CXX executable fuzz_osa_distance
cd /builddir/build/BUILD/rapidfuzz-cpp-2.2.3/redhat-linux-build/fuzzing && /usr/bin/cmake -E cmake_link_script CMakeFiles/fuzz_osa_distance.dir/link.txt --verbose=1
/usr/bin/clang++ -O2 -flto=thin -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS --config /usr/lib/rpm/redhat/redhat-hardened-clang.cfg -fstack-protector-strong   -m32 -march=i686 -mtune=generic -msse2 -mfpmath=sse -mstackrealign -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Wl,-z,relro -Wl,--as-needed  -Wl,-z,now   -flto=thin -Wl,--build-id=sha1 CMakeFiles/fuzz_osa_distance.dir/fuzz_osa_distance.cpp.o -o fuzz_osa_distance  -fsanitize=fuzzer,address
/usr/bin/ld: cannot find /usr/bin/../lib/clang/17/lib/linux/libclang_rt.fuzzer-i386.a: No such file or directory
/usr/bin/ld: cannot find /usr/bin/../lib/clang/17/lib/linux/libclang_rt.asan_static-i386.a: No such file or directory
/usr/bin/ld: cannot find /usr/bin/../lib/clang/17/lib/linux/libclang_rt.asan-i386.a: No such file or directory
/usr/bin/ld: cannot find /usr/bin/../lib/clang/17/lib/linux/libclang_rt.asan_cxx-i386.a: No such file or directory
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

@churchyard can you see if this will work too?

mv %{buildroot}%{_prefix}/lib/clang/%{maj_ver}/lib/{i386,%{_target_cpu}}-redhat-linux-gnu

This makes it easier to read IMHO what bit in the path has changed.

Yes, but the powerpc mv above this does not do that. I decided to be consistent. Should I change both?


For the record, the change here is untested yet. I've only tested it by moving the files manually.

Build succeeded.
https://fedora.softwarefactory-project.io/zuul/buildset/1a91f702339d45f182c745be92d86e66

Isn't this a more serious issue upstream?
IMO the i386 directory should not be ignored when building on i686.

I'm sorry. I don't mean to object to this PR.
It LGTM as a temporary solution, but I'm afraid it's just working around the real issue.
Hopefully I'm mistaken though. :-)

Sure, let's take this upstream. In the meantime, may I merge and ship this?

Fedora CI - dist-git test failed:

+ clang -m32 -fsanitize=address test.c
/usr/bin/ld: cannot find /usr/bin/../lib/clang/17/lib/linux/libclang_rt.asan_static-i386.a: No such file or directory
/usr/bin/ld: cannot find /usr/bin/../lib/clang/17/lib/linux/libclang_rt.asan-i386.a: No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)

So this breaks things.
Maybe both of the folders are needed?

I wonder if the issue is in clang.i686. Look at this:

$ rpm -q clang
clang-17.0.6-1.fc40.i686
$ clang++ -print-runtime-dir
/usr/bin/../lib/clang/17/lib/linux

I didn't expect this output. This directory doesn't even exist.

The x86_64 package has a sane output:

$ rpm -q clang
clang-17.0.6-1.fc40.x86_64
$ clang -m32 clang -print-runtime-dir
/usr/bin/../lib/clang/17/lib/i386-redhat-linux-gnu

Build succeeded.
https://fedora.softwarefactory-project.io/zuul/buildset/dc361faae8594d19b8c6982151f54444

I'm not sure this fix is correct, let me look into this.

The core problem is that the default triple for clang.i686 is i686-redhat-linux-gnu and the default triple for clang -m32 is i386-redhat-linux-gnu. So changing the resource directory path is not going to work.

I think the quick and easy fix would be to change the default triple for clang.i686 to be i386-redhat-linux-gnu. This needs to be done in llvm: https://src.fedoraproject.org/rpms/llvm/blob/rawhide/f/llvm.spec#_347 and then we would need to update this patch in clang to be able to find the correct gcc installation: https://src.fedoraproject.org/rpms/clang/blob/rawhide/f/0001-Driver-Add-a-gcc-equivalent-triple-to-the-list-of-tr.patch.

But actually this issue should not affect the rapidfuzz-cpp package since it is using clang -m32. Does it BuildRequire: compiler-rt.i686 ?

Does it BuildRequire: compiler-rt.i686 ?

No, it BuildRequires compiler-rt. It's not possible to BuildRequire arched packages. When it is built on i686, it installs compiler-rt.i686.

@churchyard Is there a link to the failing CI test?

I think the quick and easy fix would be to change the default triple for clang.i686 to be i386-redhat-linux-gnu.

After thinking about this more, I think we should just add a i686-redhat-gnu-linux symlink that points to the i386-redhat-gnu-linux directory.

rebased onto f47e638

6 months ago

rebased onto 5e9ea9c

6 months ago

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci
https://fedora.softwarefactory-project.io/zuul/buildset/e0933be9999c44cf9c46436b89f00163

With the current version of this, rapidfuzz-cpp.i686 builds and Fedora CI - dist-git test passed.

rpm-tmt-test failed, but that looks like yet another case of unstable test infra.

Build succeeded.
https://fedora.softwarefactory-project.io/zuul/buildset/ff241b3c764a425ea8b38a7d77df8854

Should I ship it, or is there something else @tstellar wants to do?

I intend to ship this as a provenpackager early next week if there is no negative response by the end of this week.

I intend to ship this as a provenpackager early next week if there is no negative response by the end of this week.

@churchyard This PR already has an approval and has been waiting for more reviews for enough time. I will just go ahead, merge it and start a rebuild in Rawhide.
Is this causing issues in stable releases too?

Pull-Request has been merged by tuliom

5 months ago

Is this causing issues in stable releases too?

No idea. Not for me at this moment.

Metadata