pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: lang/libunwind failing on Alma (RHEL) 8



On 1/18/24 17:36, Jason Bacon wrote:

Heads-up to anyone interested.  I'll look into this eventually if nobody
else fixes it first, but I can't say when I'll have time.

"cannot find -lgcc_s" is a fairly common problem, but I don't recall the
solution off the top of my head.

-- Check for working C compiler:
/home/bacon/Pkgsrc/pkgsrc/lang/libunwind/work/.cwrapper/bin/cc - broken
CMake Error at
/home/bacon/Pkgsrc/pkg/share/cmake-3.28/Modules/CMakeTestCCompiler.cmake:67
(message):
   The C compiler



     "/home/bacon/Pkgsrc/pkgsrc/lang/libunwind/work/.cwrapper/bin/cc"



   is not able to compile a simple test program.



   It fails with the following output:



     Change Dir:
'/home/bacon/Pkgsrc/pkgsrc/lang/libunwind/work/libunwind-16.0.6.src/cmake-pkgsrc-build/CMakeFiles/CMakeScratch/TryCompile-OKRmj3'



     Run Build Command(s): /home/bacon/Pkgsrc/pkg/bin/cmake -E env
VERBOSE=1 /home/bacon/Pkgsrc/pkg/bin/gmake -f Makefile cmTC_1e7e7/fast

     make  -f CMakeFiles/cmTC_1e7e7.dir/build.make
CMakeFiles/cmTC_1e7e7.dir/build

     Building C object CMakeFiles/cmTC_1e7e7.dir/testCCompiler.c.o

     /home/bacon/Pkgsrc/pkgsrc/lang/libunwind/work/.cwrapper/bin/cc
-O2 -I/home/bacon/Pkgsrc/pkg/include -I/usr/include -o
CMakeFiles/cmTC_1e7e7.dir/testCCompiler.c.o -c
/home/bacon/Pkgsrc/pkgsrc/lang/libunwind/work/libunwind-16.0.6.src/cmake-pkgsrc-build/CMakeFiles/CMakeScratch/TryCompile-OKRmj3/testCCompiler.c

     Linking C executable cmTC_1e7e7

     /home/bacon/Pkgsrc/pkg/bin/cmake -E cmake_link_script
CMakeFiles/cmTC_1e7e7.dir/link.txt --verbose=1

     /home/bacon/Pkgsrc/pkgsrc/lang/libunwind/work/.cwrapper/bin/cc -O2
-I/home/bacon/Pkgsrc/pkg/include -I/usr/include
-L/home/bacon/Pkgsrc/pkg/gcc10/lib/gcc/x86_64-redhat-linux/10.5.0
-Wl,-R/home/bacon/Pkgsrc/pkg/gcc10/lib/gcc/x86_64-redhat-linux/10.5.0
-L/home/bacon/Pkgsrc/pkg/gcc10/lib64
-Wl,-R/home/bacon/Pkgsrc/pkg/gcc10/lib64 -Wl,-zrelro
-L/home/bacon/Pkgsrc/pkg/lib -Wl,-R/home/bacon/Pkgsrc/pkg/lib
-L/usr/lib64 -Wl,-R/usr/lib64  -rdynamic
CMakeFiles/cmTC_1e7e7.dir/testCCompiler.c.o -o cmTC_1e7e7

     /usr/bin/ld: cannot find -lgcc_s

     collect2: error: ld returned 1 exit status

     *** Error code 1



     Stop.

     make[1]: stopped in
/home/bacon/Pkgsrc/pkgsrc/lang/libunwind/work/libunwind-16.0.6.src/cmake-pkgsrc-build/CMakeFiles/CMakeScratch/TryCompile-OKRmj3

     gmake: *** [Makefile:127: cmTC_1e7e7/fast] Error 1











   CMake will not be able to correctly generate this project.

Call Stack (most recent call first):

   CMakeLists.txt





-- Configuring incomplete, errors occurred!
*** Error code 1

Stop.
bmake[7]: stopped in /home/bacon/Pkgsrc/pkgsrc/lang/libunwind
*** Error code 1

FYI, I plan to commit the following patch as a stop-gap, unless there are any objections and suggestions. I don't know if this problem exists on other Linux distros, so I'm limiting the fix to RHEL derivatives.

--- Makefile    6 Oct 2023 19:15:21 -0000       1.34
+++ Makefile    23 Feb 2024 13:05:21 -0000
@@ -22,7 +22,13 @@
 USE_LANGUAGES=         c c++
 USE_TOOLS+=            pax
 SSP_SUPPORTED=         no
+
+.include "../../mk/bsd.prefs.mk"
+
+# Configure fails on Alma8 with "/usr/bin/ld: cannot find -lgcc_s"
+.if ${OPSYS} != Linux || !exists(/etc/redhat-release)
 GCC_REQD+=             10      # must be in sync with libcxx
+.endif

 CMAKE_ARGS+=   -DCMAKE_BUILD_TYPE=Release



Home | Main Index | Thread Index | Old Index