Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link failure #833

Open
artiomn opened this issue Sep 26, 2024 · 4 comments
Open

Link failure #833

artiomn opened this issue Sep 26, 2024 · 4 comments

Comments

@artiomn
Copy link
Contributor

artiomn commented Sep 26, 2024

Manjaro, GCC 14.2.1.
Link failure, because of asan can't be found:

[ 87%] Linking CXX executable ../bin/pcm-memory
cd /home/artiom/projects/pcm/build/src && /usr/bin/cmake -E cmake_link_script CMakeFiles/pcm-memory.dir/link.txt --verbose=1
/usr/bin/c++  -Wno-unknown-pragmas -fPIC -DCMAKE_INSTALL_PREFIX="/usr/local" -Wextra -DPCM_USE_PERF -Wl,-z,now -Wall -O3 -rdynamic -fPIE -fstack-protector -D_FORTIFY_SOURCE=2 -ftrapv -fsanitize=address -fwrapv -fno-delete-null-pointer-checks -fno-strict-overflow -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer  -fsanitize=address  -fsanitize=address -s -static-libasan "CMakeFiles/pcm-memory.dir/pcm-memory.cpp.o" -o ../bin/pcm-memory  libpcm.a
/usr/bin/ld: cannot find -lasan: No such file or directory
collect2: error: ld returned 1 exit status
make[2]: *** [src/CMakeFiles/pcm-memory.dir/build.make:98: bin/pcm-memory] Error 1
make[2]: Leaving directory '/home/artiom/projects/pcm/build'
make[1]: *** [CMakeFiles/Makefile2:390: src/CMakeFiles/pcm-memory.dir/all] Error 2
[ 88%] Linking CXX executable ../bin/pcm-core
cd /home/artiom/projects/pcm/build/src && /usr/bin/cmake -E cmake_link_script CMakeFiles/pcm-core.dir/link.txt --verbose=1
/usr/bin/c++  -Wno-unknown-pragmas -fPIC -DCMAKE_INSTALL_PREFIX="/usr/local" -Wextra -DPCM_USE_PERF -Wl,-z,now -Wall -O3 -rdynamic -fPIE -fstack-protector -D_FORTIFY_SOURCE=2 -ftrapv -fsanitize=address -fwrapv -fno-delete-null-pointer-checks -fno-strict-overflow -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer  -fsanitize=address  -fsanitize=address -s -static-libasan "CMakeFiles/pcm-core.dir/pcm-core.cpp.o" -o ../bin/pcm-core  libpcm.a
/usr/bin/ld: cannot find -lasan: No such file or directory
collect2: error: ld returned 1 exit status
make[2]: *** [src/CMakeFiles/pcm-core.dir/build.make:98: bin/pcm-core] Error 1
make[2]: Leaving directory '/home/artiom/projects/pcm/build'
make[1]: *** [CMakeFiles/Makefile2:468: src/CMakeFiles/pcm-core.dir/all] Error 2

[ 89%] Linking CXX executable ../bin/pcm
cd /home/artiom/projects/pcm/build/src && /usr/bin/cmake -E cmake_link_script CMakeFiles/pcm.dir/link.txt --verbose=1
/usr/bin/c++  -Wno-unknown-pragmas -fPIC -DCMAKE_INSTALL_PREFIX="/usr/local" -Wextra -DPCM_USE_PERF -Wl,-z,now -Wall -O3 -rdynamic -fPIE -fstack-protector -D_FORTIFY_SOURCE=2 -ftrapv -fsanitize=address -fwrapv -fno-delete-null-pointer-checks -fno-strict-overflow -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer  -fsanitize=address  -fsanitize=address -s -static-libasan CMakeFiles/pcm.dir/pcm.cpp.o -o ../bin/pcm  libpcm.a
/usr/bin/ld: cannot find -lasan: No such file or directory
collect2: error: ld returned 1 exit status
make[2]: *** [src/CMakeFiles/pcm.dir/build.make:98: bin/pcm] Error 1
make[2]: Leaving directory '/home/artiom/projects/pcm/build'
make[1]: *** [CMakeFiles/Makefile2:260: src/CMakeFiles/pcm.dir/all] Error 2
[ 90%] Linking CXX executable ../bin/pcm-sensor
cd /home/artiom/projects/pcm/build/src && /usr/bin/cmake -E cmake_link_script CMakeFiles/pcm-sensor.dir/link.txt --verbose=1
/usr/bin/c++  -Wno-unknown-pragmas -fPIC -DCMAKE_INSTALL_PREFIX="/usr/local" -Wextra -DPCM_USE_PERF -Wl,-z,now -Wall -O3 -rdynamic -fPIE -fstack-protector -D_FORTIFY_SOURCE=2 -ftrapv -fsanitize=address -fwrapv -fno-delete-null-pointer-checks -fno-strict-overflow -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer  -fsanitize=address  -fsanitize=address -s -static-libasan "CMakeFiles/pcm-sensor.dir/pcm-sensor.cpp.o" -o ../bin/pcm-sensor  libpcm.a
/usr/bin/ld: cannot find -lasan: No such file or directory
collect2: error: ld returned 1 exit status
make[2]: *** [src/CMakeFiles/pcm-sensor.dir/build.make:98: bin/pcm-sensor] Error 1
make[2]: Leaving directory '/home/artiom/projects/pcm/build'
make[1]: *** [CMakeFiles/Makefile2:702: src/CMakeFiles/pcm-sensor.dir/all] Error 2
[ 91%] Linking CXX executable ../bin/pcm-iio
cd /home/artiom/projects/pcm/build/src && /usr/bin/cmake -E cmake_link_script CMakeFiles/pcm-iio.dir/link.txt --verbose=1
/usr/bin/c++  -Wno-unknown-pragmas -fPIC -DCMAKE_INSTALL_PREFIX="/usr/local" -Wextra -DPCM_USE_PERF -Wl,-z,now -Wall -O3 -rdynamic -fPIE -fstack-protector -D_FORTIFY_SOURCE=2 -ftrapv -fsanitize=address -fwrapv -fno-delete-null-pointer-checks -fno-strict-overflow -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer  -fsanitize=address  -fsanitize=address -s -static-libasan "CMakeFiles/pcm-iio.dir/pcm-iio.cpp.o" -o ../bin/pcm-iio  libpcm.a
/usr/bin/ld: cannot find -lasan: No such file or directory
collect2: error: ld returned 1 exit status
make[2]: *** [src/CMakeFiles/pcm-iio.dir/build.make:98: bin/pcm-iio] Error 1
make[2]: Leaving directory '/home/artiom/projects/pcm/build'
make[1]: *** [CMakeFiles/Makefile2:494: src/CMakeFiles/pcm-iio.dir/all] Error 2
@rdementi
Copy link
Contributor

hi, is libasan package installed? could you please provide the full log from cmake?

@rdementi
Copy link
Contributor

similar to other distros could you please try to install libasan and libasan-static ?

dnf -y install gcc-c++ git findutils make cmake openssl openssl-devel libasan libasan-static

@artiomn
Copy link
Contributor Author

artiomn commented Sep 27, 2024

hi, is libasan package installed? could you please provide the full log from cmake?

Probably not, but it must be detected at configuration stage...
If CMake haven't detected libasan, build may be continued without it.
Or stopped, but at the CMake stage.

dnf -y install gcc-c++ git findutils make cmake openssl openssl-devel libasan libasan-static

Not a problem (but I use not RPM-based distros, mostly Debian and sometimes Manjaro).
But I think the build behavior is not quite correct.

@rdementi
Copy link
Contributor

I agree. That would be good to check in CMake

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants