Description of problem: Trying to compile any program with clang -m32 -fsanitize=undefined (or -fsanitize=address, or -fsanitize=leak), even when the required i686 packages are installed, results in: /usr/bin/ld: cannot find /usr/lib64/clang/6.0.1/lib/linux/libclang_rt.asan-i386.a: No such file or directory clang-6.0: error: linker command failed with exit code 1 (use -v to see invocation) This is because it looks for the 32-bit library of the sanitizer in /usr/lib64, and not in /usr/lib, where the file is actually installed. Version-Release number of selected component (if applicable): Fedora 28 clang version 6.0.1 How reproducible: always Steps to Reproduce: 1. echo "int main(){return 0;}" > a.c 2. clang -m32 -fsanitize=address a.c Actual results: /usr/bin/ld: cannot find /usr/lib64/clang/6.0.1/lib/linux/libclang_rt.asan-i386.a: No such file or directory clang-6.0: error: linker command failed with exit code 1 (use -v to see invocation) Expected results: File should compile normally. Additional info:
For information, I just upgraded to Fedora 29, and the problem persists, although it is using clang 7 this time: /usr/bin/ld: cannot find /usr/lib64/clang/7.0.1/lib/linux/libclang_rt.ubsan_standalone-i386.a: No such file or directory clang-7: error: linker command failed with exit code 1 (use -v to see invocation) Once again, the correct path should refer to /usr/lib, not /usr/lib64.
The problem is still there for rawhide, creating a few symlinks appropriately should do the trick, let me investigate that.
Fixed as of compiler-rt-8.0.0-2.fc31
Would it be possible to backport this fix and release versions for FC29 and FC30? Thanks.
FEDORA-2019-271b8968c9 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-271b8968c9
FEDORA-2019-819537896d has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-819537896d
compiler-rt-8.0.0-2.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-271b8968c9
compiler-rt-7.0.1-2.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-819537896d
Thanks for backporting the fix. I just tested the new versions from the updates-testing repositories on FC29 and found two problems 1. The package needs to create symlinks in /usr/lib64/clang/7.0.1/lib/linux directory as well because clangs search the library there and not in /usr/lib64/clang/7.0.1/lib/ /usr/bin/ld: cannot find /usr/lib64/clang/7.0.1/lib/linux/libclang_rt.asan-i386.a: No such file or directory $ find /usr/lib /usr/lib64 -name libclang_rt.asan-i386.a /usr/lib/clang/7.0.1/lib/libclang_rt.asan-i386.a /usr/lib/clang/7.0.1/lib/linux/libclang_rt.asan-i386.a /usr/lib64/clang/7.0.1/lib/libclang_rt.asan-i386.a 2 The pre and post install scripts do not check whether the package is being upgraded or removed. For example reinstall prints errors and remove the symlinks. I guess that in the future update will do the same. $ sudo dnf reinstall compiler-rt compiler-rt.i686 --enablerepo=updates-testing Running transaction Preparing : 1/1 Reinstalling : compiler-rt-7.0.1-2.fc29.x86_64 1/4 Reinstalling : compiler-rt-7.0.1-2.fc29.i686 2/4 Running scriptlet: compiler-rt-7.0.1-2.fc29.i686 2/4 ln: failed to create symbolic link '../../../../lib64/clang/7.0.1/lib/libclang_rt.asan_cxx-i386.a': File exists ln: failed to create symbolic link '../../../../lib64/clang/7.0.1/lib/libclang_rt.asan-i386.a': File exists ln: failed to create symbolic link '../../../../lib64/clang/7.0.1/lib/libclang_rt.asan-preinit-i386.a': File exists $ find /usr/lib /usr/lib64 -name libclang_rt.asan-i386.a /usr/lib/clang/7.0.1/lib/libclang_rt.asan-i386.a /usr/lib/clang/7.0.1/lib/linux/libclang_rt.asan-i386.a
Vasil, can you tell me if https://koji.fedoraproject.org/koji/taskinfo?taskID=36325500 fixes your issue? Thanks!
Hi serge_sans_paille, Sorry, it does not solve any of the two issues. I've downloaded the x86_64 and i686 rpms from https://koji.fedoraproject.org/koji/buildinfo?buildID=1309391 as the link you gave me is only for x86_64. The upgrade from compiler-rt-7.0.1-1.fc29.x86_64 works as expected. $ sudo dnf upgrade ./compiler-rt-7.0.1-2.fc29.x86_64.rpm ./compiler-rt-7.0.1-2.fc29.i686.rpm Dependencies resolved. ====================================================================================================================================================== Package Architecture Version Repository Size ====================================================================================================================================================== Upgrading: compiler-rt x86_64 7.0.1-2.fc29 @commandline 2.5 M compiler-rt i686 7.0.1-2.fc29 @commandline 1.2 M Transaction Summary ====================================================================================================================================================== Upgrade 2 Packages Total size: 3.8 M Is this ok [y/N]: y Downloading Packages: Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Upgrading : compiler-rt-7.0.1-2.fc29.x86_64 1/4 Upgrading : compiler-rt-7.0.1-2.fc29.i686 2/4 Running scriptlet: compiler-rt-7.0.1-2.fc29.i686 2/4 Cleanup : compiler-rt-7.0.1-1.fc29.i686 3/4 Cleanup : compiler-rt-7.0.1-1.fc29.x86_64 4/4 Running scriptlet: compiler-rt-7.0.1-1.fc29.x86_64 4/4 Verifying : compiler-rt-7.0.1-2.fc29.x86_64 1/4 Verifying : compiler-rt-7.0.1-1.fc29.x86_64 2/4 Verifying : compiler-rt-7.0.1-2.fc29.i686 3/4 Verifying : compiler-rt-7.0.1-1.fc29.i686 4/4 But reinstall still prints "ln: failed to create symbolic link" errors although it succeed. $ sudo dnf reinstall ./compiler-rt-7.0.1-2.fc29.x86_64.rpm ./compiler-rt-7.0.1-2.fc29.i686.rpm Last metadata expiration check: 0:15:57 ago on 2019-07-19T00:50:30 EEST. Dependencies resolved. ====================================================================================================================================================== Package Architecture Version Repository Size ====================================================================================================================================================== Reinstalling: compiler-rt x86_64 7.0.1-2.fc29 @commandline 2.5 M compiler-rt i686 7.0.1-2.fc29 @commandline 1.2 M Transaction Summary ====================================================================================================================================================== Total size: 3.8 M Installed size: 35 M Is this ok [y/N]: y Downloading Packages: Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Reinstalling : compiler-rt-7.0.1-2.fc29.x86_64 1/4 Reinstalling : compiler-rt-7.0.1-2.fc29.i686 2/4 Running scriptlet: compiler-rt-7.0.1-2.fc29.i686 2/4 ln: failed to create symbolic link '../../../../lib64/clang/7.0.1/lib/libclang_rt.asan_cxx-i386.a': File exists ln: failed to create symbolic link '../../../../lib64/clang/7.0.1/lib/libclang_rt.asan-i386.a': File exists ln: failed to create symbolic link '../../../../lib64/clang/7.0.1/lib/libclang_rt.asan-preinit-i386.a': File exists ln: failed to create symbolic link '../../../../lib64/clang/7.0.1/lib/libclang_rt.builtins-i386.a': File exists ln: failed to create symbolic link '../../../../lib64/clang/7.0.1/lib/libclang_rt.cfi_diag-i386.a': File exists ....... ln: failed to create symbolic link '../../../../lib64/clang/7.0.1/lib/libclang_rt.ubsan_standalone-i386.so': File exists warning: %post(compiler-rt-7.0.1-2.fc29.i686) scriptlet failed, exit status 1 Error in POSTIN scriptlet in rpm package compiler-rt Running scriptlet: compiler-rt-7.0.1-2.fc29.i686 3/4 Cleanup : compiler-rt-7.0.1-2.fc29.i686 3/4 Cleanup : compiler-rt-7.0.1-2.fc29.x86_64 4/4 Running scriptlet: compiler-rt-7.0.1-2.fc29.x86_64 4/4 Verifying : compiler-rt-7.0.1-2.fc29.x86_64 1/4 Verifying : compiler-rt-7.0.1-2.fc29.x86_64 2/4 Verifying : compiler-rt-7.0.1-2.fc29.i686 3/4 Verifying : compiler-rt-7.0.1-2.fc29.i686 4/4 Reinstalled: compiler-rt-7.0.1-2.fc29.x86_64 compiler-rt-7.0.1-2.fc29.i686 Complete! $ echo $? 0 And linking still fails with /usr/bin/ld: cannot find /usr/lib64/clang/7.0.1/lib/linux/libclang_rt.asan-i386.a: No such file or directory as clang looks for libclang_rt.asan-i386.a in `/usr/lib64/clang/7.0.1/lib/linux/` directory and not in `/usr/lib64/clang/7.0.1/lib/` where you create the symlinks. See also the original report. $ rpm -q --scripts compiler-rt-7.0.1-2.fc29.i686.rpm postinstall scriptlet (using /bin/sh): if test "`uname -m`" = x86_64 then cd /usr/lib/clang/7.0.1/lib mkdir -p ../../../../lib64/clang/7.0.1/lib for i in *.a *.so do ln -s ../../../../lib/clang/7.0.1/lib/$i ../../../../lib64/clang/7.0.1/lib/$i done fi preuninstall scriptlet (using /bin/sh): if test "`uname -m`" = x86_64 then cd /usr/lib/clang/7.0.1/lib for i in *.a *.so do rm ../../../../lib64/clang/7.0.1/lib/$i done rmdir -p ../../../../lib64/clang/7.0.1/lib 2>/dev/null 1>/dev/null || : fi Not quite sure whether the symlink in `/usr/lib64/clang/7.0.1/lib/` is needed but for sure you need to create one in the `linux` subdirectory. In my opinion you need to either: * Check the first argument in the pre/post scripts that indicates whether the package is being installed, upgraded or removed. https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#_syntax * Create the symlinks in the %install section and then package them in the %files section. Hope this helps and many thanks for your efforts on this issue. Regards, Vasil
Vasil : you've been reinstalling the 7.0.1-2 version while the above link was pointing to 7.0.1-3. Anyway I've updated the script, tested it and everything looks fine on my side, can you check https://koji.fedoraproject.org/koji/taskinfo?taskID=36344238? Concerning your suggestions: * Create the symlinks in the %install section and then package them in the %files section. << I don't want to do that because I need to check if I'm running on x86_64 from a i686 package, something I can only do at runtime * Check the first argument in the pre/post scripts that indicates whether the package is being installed << That's an option, I've settled for a small rm instead Please let me know if the above package works nice.
(In reply to serge_sans_paille from comment #12) > Vasil : you've been reinstalling the 7.0.1-2 version while the above link > was pointing to 7.0.1-3. Oops, sorry, my mistake. > Anyway I've updated the script, tested it and > everything looks fine on my side, can you check > https://koji.fedoraproject.org/koji/taskinfo?taskID=36344238? > > Concerning your suggestions: > > * Create the symlinks in the %install section and then package them in the > %files section. << I don't want to do that because I need to check if I'm > running on x86_64 from a i686 package, something I can only do at runtime OK > * Check the first argument in the pre/post scripts that indicates whether > the package is being installed << That's an option, I've settled for a small > rm instead > > Please let me know if the above package works nice. I've just tested version 7.0.1-3. On the first install/upgrade the symlinks are created in the `linux` subdirectory and the linking problem is solved. But there still is a problem with reinstalling the packages and I guess with updating from 7.0.1-3 to any newer version. The symlinks are removed after reinstall $ find /usr/lib /usr/lib64 -name libclang_rt.asan-i386.a /usr/lib/clang/7.0.1/lib/libclang_rt.asan-i386.a /usr/lib/clang/7.0.1/lib/linux/libclang_rt.asan-i386.a /usr/lib64/clang/7.0.1/lib/linux/libclang_rt.asan-i386.a $ sudo dnf reinstall ./compiler-rt-7.0.1-3.fc29.i686.rpm ./compiler-rt-7.0.1-3.fc29.x86_64.rpm Dependencies resolved. ====================================================================================================================================================== Package Architecture Version Repository Size ====================================================================================================================================================== Reinstalling: compiler-rt i686 7.0.1-3.fc29 @commandline 1.2 M compiler-rt x86_64 7.0.1-3.fc29 @commandline 2.5 M Transaction Summary ====================================================================================================================================================== Total size: 3.8 M Installed size: 35 M Is this ok [y/N]: y Downloading Packages: Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Reinstalling : compiler-rt-7.0.1-3.fc29.x86_64 1/4 Reinstalling : compiler-rt-7.0.1-3.fc29.i686 2/4 Running scriptlet: compiler-rt-7.0.1-3.fc29.i686 2/4 Running scriptlet: compiler-rt-7.0.1-3.fc29.i686 3/4 Cleanup : compiler-rt-7.0.1-3.fc29.i686 3/4 Cleanup : compiler-rt-7.0.1-3.fc29.x86_64 4/4 Running scriptlet: compiler-rt-7.0.1-3.fc29.x86_64 4/4 Verifying : compiler-rt-7.0.1-3.fc29.i686 1/4 Verifying : compiler-rt-7.0.1-3.fc29.i686 2/4 Verifying : compiler-rt-7.0.1-3.fc29.x86_64 3/4 Verifying : compiler-rt-7.0.1-3.fc29.x86_64 4/4 Reinstalled: compiler-rt-7.0.1-3.fc29.i686 compiler-rt-7.0.1-3.fc29.x86_64 Complete! $ find /usr/lib /usr/lib64 -name libclang_rt.asan-i386.a /usr/lib/clang/7.0.1/lib/libclang_rt.asan-i386.a /usr/lib/clang/7.0.1/lib/linux/libclang_rt.asan-i386.a
We're making progress! What about https://koji.fedoraproject.org/koji/taskinfo?taskID=36349588?
Created attachment 1592621 [details] Symlinks are not removed when erasing the packages. (In reply to serge_sans_paille from comment #14) > We're making progress! Yes, we are!. > What about https://koji.fedoraproject.org/koji/taskinfo?taskID=36349588? The only small problem I've found is that symlinks are not removed when erasing the packages. See the attached log.
Somehow resurecting the thread, but I think the issue was still there on rawhide, and https://src.fedoraproject.org/rpms/compiler-rt/pull-request/24 should fix it.