Problem with gcc compiler

ZeidMahmoud

New Member
Joined
Nov 2, 2024
Messages
14
Reaction score
5
Credits
176
everytime I try to install any software on my slackware 15 it says It can't complier .

"""

checking build system type... x86_64-pc-linux-gnuchecking host system type... x86_64-pc-linux-gnuchecking target system type... x86_64-pc-linux-gnuchecking for a BSD-compatible install... /bin/ginstall -cchecking whether build environment is sane... yeschecking for a thread-safe mkdir -p... /bin/mkdir -pchecking for gawk... gawkchecking whether make sets $(MAKE)... yeschecking whether make supports nested variables... yeschecking whether make supports nested variables... (cached) yeschecking whether make supports the include directive... yes (GNU style)checking for gcc... gccchecking whether the C compiler works... noconfigure: error: in /root/Downloads/aria2':configure: error: C compiler cannot create executablesSee config.log' for more detailsroot@darkstar ~/D/aria2 (master) [77]#

"""

root@darkstar ~ (master)# gcc --version
gcc (GCC) 14.2.0
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

root@darkstar ~ (master)#

""""

root@darkstar ~/D/aria2 (master) [SIGINT]# ;gcc -vReading specs from /usr/lib64/gcc/x86_64-slackware-linux/14.2.0/specsCOLLECT_GCC=gccCOLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-slackware-linux/14.2.0/lto-wrapperTarget: x86_64-slackware-linuxConfigured with: ../configure --prefix=/usr --libdir=/usr/lib64 --mandir=/usr/man --infodir=/usr/info --enable-shared --enable-bootstrap --enable-languages=ada,c,c++,d,fortran,go,lto,m2,objc,obj-c++,rust --enable-threads=posix --enable-checking=release --with-system-zlib --enable-libstdcxx-dual-abi --with-default-libstdcxx-abi=new --disable-libstdcxx-pch --disable-libunwind-exceptions --enable-__cxa_atexit --disable-libssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-plugin --enable-lto --disable-install-libiberty --disable-werror --with-gnu-ld --with-isl --verbose --with-arch-directory=amd64 --disable-gtktest --enable-clocale=gnu --with-arch=x86-64 --enable-multilib --target=x86_64-slackware-linux --build=x86_64-slackware-linux --host=x86_64-slackware-linuxThread model: posixSupported LTO compression algorithms: zlib zstdgcc version 14.2.0 (GCC)root@darkstar ~/D/aria2 (master)#


"""""


CMake Error at /usr/share/cmake-3.31/Modules/CMakeTestCCompiler.cmake:67 (message): The C compiler "/usr/bin/cc" is not able to compile a simple test program. It fails with the following output: Change Dir: '/tmp/SBo/transmission-4.0.6/build/CMakeFiles/CMakeScratch/TryCompile-iKcyAF' Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/bin/gmake -f Makefile cmTC_de344/fast /usr/bin/gmake -f CMakeFiles/cmTC_de344.dir/build.make CMakeFiles/cmTC_de344.dir/build gmake[1]: Entering directory '/tmp/SBo/transmission-4.0.6/build/CMakeFiles/CMakeScratch/TryCompile-iKcyAF' Building C object CMakeFiles/cmTC_de344.dir/testCCompiler.c.o /usr/bin/cc -O2 -fPIC -o CMakeFiles/cmTC_de344.dir/testCCompiler.c.o -c /tmp/SBo/transmission-4.0.6/build/CMakeFiles/CMakeScratch/TryCompile-iKcyAF/testCCompiler.c Linking C executable cmTC_de344 /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_de344.dir/link.txt --verbose=1 /usr/bin/ld: /lib64/libc.so.6: unknown type [0x13] section .relr.dyn' /usr/bin/ld: skipping incompatible /lib64/libc.so.6 when searching for /lib64/libc.so.6 /usr/bin/ld: cannot find /lib64/libc.so.6 /usr/bin/ld: /lib64/libc.so.6: unknown type [0x13] section .relr.dyn' /usr/bin/ld: skipping incompatible /lib64/libc.so.6 when searching for /lib64/libc.so.6 /usr/bin/ld: /lib64/ld-linux-x86-64.so.2: unknown type [0x13] section .relr.dyn' /usr/bin/ld: skipping incompatible /lib64/ld-linux-x86-64.so.2 when searching for /lib64/ld-linux-x86-64.so.2 /usr/bin/ld: cannot find /lib64/ld-linux-x86-64.so.2 /usr/bin/ld: /lib64/ld-linux-x86-64.so.2: unknown type [0x13] section .relr.dyn' /usr/bin/ld: skipping incompatible /lib64/ld-linux-x86-64.so.2 when searching for /lib64/ld-linux-x86-64.so.2 collect2: error: ld returned 1 exit status /usr/bin/cc -O2 -fPIC CMakeFiles/cmTC_de344.dir/testCCompiler.c.o -o cmTC_de344 gmake[1]: [CMakeFiles/cmTC_de344.dir/build.make:102: cmTC_de344] Error 1 gmake[1]: Leaving directory '/tmp/SBo/transmission-4.0.6/build/CMakeFiles/CMakeScratch/TryCompile-iKcyAF' gmake: [Makefile:133: cmTC_de344/fast] Error 2 CMake will not be able to correctly generate this project.Call Stack (most recent call first): CMakeLists.txt:18 (project)-- Configuring incomplete, errors occurred!transmission:Would you like to continue processing the rest of thequeue or would you like to abort? If this failedpackage is a dependency of another package in the queuethen it may not make sense to continue.(Y)es to continue, (N)o to abort, (R)etry the build?:


""""

I TRIED TO MAKE SIMPLE software to test the complier and this is the result :

root@darkstar /t/t/build# gcc test.c -o test/usr/bin/ld: /lib64/libc.so.6: unknown type [0x13] section .relr.dyn'/usr/bin/ld: skipping incompatible /lib64/libc.so.6 when searching for /lib64/libc.so.6/usr/bin/ld: cannot find /lib64/libc.so.6/usr/bin/ld: /lib64/libc.so.6: unknown type [0x13] section .relr.dyn'/usr/bin/ld: skipping incompatible /lib64/libc.so.6 when searching for /lib64/libc.so.6/usr/bin/ld: /lib64/ld-linux-x86-64.so.2: unknown type [0x13] section .relr.dyn'/usr/bin/ld: skipping incompatible /lib64/ld-linux-x86-64.so.2 when searching for /lib64/ld-linux-x86-64.so.2/usr/bin/ld: cannot find /lib64/ld-linux-x86-64.so.2/usr/bin/ld: /lib64/ld-linux-x86-64.so.2: unknown type [0x13] section .relr.dyn'/usr/bin/ld: skipping incompatible /lib64/ld-linux-x86-64.so.2 when searching for /lib64/ld-linux-x86-64.so.2collect2: error: ld returned 1 exit statusroot@darkstar /t/t/build [1]# ll

""""

root@darkstar /t/t/build# readelf -h /lib64/libc-2.40.so readelf -h /lib64/ld-2.40.soELF Header: Magic: 7f 45 4c 46 02 01 01 03 00 00 00 00 00 00 00 00 Class: ELF64 Data: 2's complement, little endian Version: 1 (current) OS/ABI: UNIX - GNU ABI Version: 0 Type: DYN (Shared object file) Machine: Advanced Micro Devices X86-64 Version: 0x1 Entry point address: 0x29f20 Start of program headers: 64 (bytes into file) Start of section headers: 2409448 (bytes into file) Flags: 0x0 Size of this header: 64 (bytes) Size of program headers: 56 (bytes) Number of program headers: 14 Size of section headers: 64 (bytes) Number of section headers: 63 Section header string table index: 62ELF Header: Magic: 7f 45 4c 46 02 01 01 03 00 00 00 00 00 00 00 00 Class: ELF64 Data: 2's complement, little endian Version: 1 (current) OS/ABI: UNIX - GNU ABI Version: 0 Type: DYN (Shared object file) Machine: Advanced Micro Devices X86-64 Version: 0x1 Entry point address: 0x1f000 Start of program headers: 64 (bytes into file) Start of section headers: 259664 (bytes into file) Flags: 0x0 Size of this header: 64 (bytes) Size of program headers: 56 (bytes) Number of program headers: 10 Size of section headers: 64 (bytes) Number of section headers: 22 Section header string table index: 21root@darkstar /t/t/build#



""""


root@darkstar /t/t/build# upgradepkg --reinstall /var/log/packages/glibc-*Cannot install glibc-2.40-x86_64-5: invalid package extensionCannot install glibc-i18n-2.40-x86_64-5: invalid package extensionCannot install glibc-profile-2.40-x86_64-5: invalid package extensionCannot install glibc-zoneinfo-2024b-noarch-1: invalid package extensionroot@darkstar /t/t/build# uname -a cat /etc/slackware-versionLinux darkstar.example.net 5.15.19 #1 SMP PREEMPT Wed Feb 2 01:50:51 CST 2022 x86_64 Intel(R) Core(TM) i5 CPU M 430 @ 2.27GHz GenuineIntel GNU/LinuxSlackware 15.0root@darkstar /t/t/build#


==========


This is the output of the info of the complier
 


It's been a really long time since I've compiled anything in slackware ( over 20 years ).
So I can't speak specifically to that distro, but for most modern distro's, the c compiler itself isn't enough.
If you're compiling helli world, that's one thing. But if you're compiling anything that requires system libraries
that's another. For example on fedora, the full build suite looks like this.

dnf group install "c-development"
Updating and loading repositories:
Repositories loaded.
Package "make-1:4.4.1-8.fc41.x86_64" is already installed.
Package "gcc-14.2.1-3.fc41.x86_64" is already installed.
Package "gcc-c++-14.2.1-3.fc41.x86_64" is already installed.
Package "autoconf-2.72-3.fc41.noarch" is already installed.
Package "automake-1.16.5-17.fc41.noarch" is already installed.
Package "glibc-devel-2.40-12.fc41.x86_64" is already installed.
Package "pkgconf-2.3.0-1.fc41.x86_64" is already installed.
Package "binutils-2.43.1-2.fc41.x86_64" is already installed.
Package "bison-3.8.2-9.fc41.x86_64" is already installed.
Package "flex-2.6.4-18.fc41.x86_64" is already installed.
Package "gdb-15.2-3.fc41.x86_64" is already installed.
Package "libtool-2.4.7-12.fc41.x86_64" is already installed.
Package "strace-6.12-1.fc41.x86_64" is already installed.
Package "ctags-6.0.0-6.fc41.x86_64" is already installed.
Package "indent-2.2.13-8.fc41.x86_64" is already installed.
Package "valgrind-1:3.24.0-1.fc41.x86_64" is already installed.
Package "byacc-2.0.20240109-2.fc41.x86_64" is already installed.
Package "ccache-4.10.2-1.fc41.x86_64" is already installed.
Package "cscope-15.9-26.fc41.x86_64" is already installed.
Package "elfutils-0.192-6.fc41.x86_64" is already installed.
Package "ltrace-0.7.91-51.fc41.x86_64" is already installed.
Package "perf-6.11.8-300.fc41.x86_64" is already installed.

Ubuntu has a similar suite called build-essentials.
I would be surprised if Slackware doesn't have something similar.

If something has to be compiled in order for it to install... it becomes a chicken and egg problem.
How do I get the stuff needed to compile installed, if I can't compile anything yet?
 
Try posting the output of whereis ld, this issue with the older linker has cropped up in other distros (IDK why, this did not happen on Debian, unless it happened during my sojourn living in the bushes and was quickly fixed). If you have multiple locations for ld, or if ld is in /usr/local/bin/ that could be it the issue. See these topics:

 
Try posting the output of whereis ld, this issue with the older linker has cropped up in other distros (IDK why, this did not happen on Debian, unless it happened during my sojourn living in the bushes and was quickly fixed). If you have multiple locations for ld, or if ld is in /usr/local/bin/ that could be it the issue. See these topics:

root@darkstar ~ (master) [SIGINT]# whereis ld
ld: /usr/bin/ld /usr/man/man1/ld.1.gz /usr/info/ld.info.gz
root@darkstar ~ (master)#
 
I tried using slackpkg instr
It's been a really long time since I've compiled anything in slackware ( over 20 years ).
So I can't speak specifically to that distro, but for most modern distro's, the c compiler itself isn't enough.
If you're compiling helli world, that's one thing. But if you're compiling anything that requires system libraries
that's another. For example on fedora, the full build suite looks like this.

dnf group install "c-development"
Updating and loading repositories:
Repositories loaded.
Package "make-1:4.4.1-8.fc41.x86_64" is already installed.
Package "gcc-14.2.1-3.fc41.x86_64" is already installed.
Package "gcc-c++-14.2.1-3.fc41.x86_64" is already installed.
Package "autoconf-2.72-3.fc41.noarch" is already installed.
Package "automake-1.16.5-17.fc41.noarch" is already installed.
Package "glibc-devel-2.40-12.fc41.x86_64" is already installed.
Package "pkgconf-2.3.0-1.fc41.x86_64" is already installed.
Package "binutils-2.43.1-2.fc41.x86_64" is already installed.
Package "bison-3.8.2-9.fc41.x86_64" is already installed.
Package "flex-2.6.4-18.fc41.x86_64" is already installed.
Package "gdb-15.2-3.fc41.x86_64" is already installed.
Package "libtool-2.4.7-12.fc41.x86_64" is already installed.
Package "strace-6.12-1.fc41.x86_64" is already installed.
Package "ctags-6.0.0-6.fc41.x86_64" is already installed.
Package "indent-2.2.13-8.fc41.x86_64" is already installed.
Package "valgrind-1:3.24.0-1.fc41.x86_64" is already installed.
Package "byacc-2.0.20240109-2.fc41.x86_64" is already installed.
Package "ccache-4.10.2-1.fc41.x86_64" is already installed.
Package "cscope-15.9-26.fc41.x86_64" is already installed.
Package "elfutils-0.192-6.fc41.x86_64" is already installed.
Package "ltrace-0.7.91-51.fc41.x86_64" is already installed.
Package "perf-6.11.8-300.fc41.x86_64" is already installed.

Ubuntu has a similar suite called build-essentials.
I would be surprised if Slackware doesn't have something similar.

If something has to be compiled in order for it to install... it becomes a chicken and egg problem.
How do I get the stuff needed to compile installed, if I can't compile anything yet?
I tried to install them by using slackpkg and sbopkg but they are not there?
 
I tried using slackpkg instr

I tried to install them by using slackpkg and sbopkg but they are not there?
Are you running Slackware Current or Slackware 15.0 Stable?

Did you verify the packages that you downloaded from the Slack Builds repo?

Depending on which version of gcc you need, you will have to install the required dependency "avr-binutils" OR> "arm-binutils" first, before you install gcc.
https://slackbuilds.org/repository/15.0/development/avr-gcc/


Looking at your error:
Code:
compiler cannot create executablesSee config.log
Have a look at your config.log and see what it's complaining about.

I'll boot into my Slackware 15.0 in just a few and let you know what I have.
 
Ok, just booted into my Slackware 15.0 stable installation.
The most recent gcc version is 11.

Code:
root@slackware64:~# gcc --version
gcc (GCC) 11.2.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Make sure your system is up-to-date and that it's upgraded as well with root privileges.
Code:
slackpkg update
slackpkg upgrade-all
 
Are you running Slackware Current or Slackware 15.0 Stable?

Did you verify the packages that you downloaded from the Slack Builds repo?

Depending on which version of gcc you need, you will have to install the required dependency "avr-binutils" OR> "arm-binutils" first, before you install gcc.
https://slackbuilds.org/repository/15.0/development/avr-gcc/


Looking at your error:
Code:
compiler cannot create executablesSee config.log
Have a look at your config.log and see what it's complaining about.

I'll boot into my Slackware 15.0 in just a few and let you know what I have.
Thanks a lot
 
I replace GCC with Simple C Compiler scc on Slackware Without Affecting glibc.
 
I replace GCC with Simple C Compiler scc on Slackware Without Affecting glibc.
I didn't see Simple C Compiler in the SlackBuilds repository.
If you went outside of the Slackware packages suited for the distro you could have dependencies missing.
 
I replaced GCC with the Simple C Compiler (scc) on my Slackware system successfully without affecting glibc or encountering dependency issues. Although since scc isn't available in the SlackBuilds repository, I carefully built it from source, ensuring it met all system requirements.

Here’s how I approached it:
1- I installed scc in a dedicated directory (e.g., /usr/local/scc) to keep it isolated.
2- To ensure compatibility with Slackware’s environment, I verified that scc could handle glibc and other critical components without breaking builds.
3- By updating the PATH and ensuring only scc was used during compilation, I confirmed that my system remained stable.
All dependencies were manually checked, and I’ve tested various applications and system utilities to verify the setup works as intended. Everything is running smoothly!
 
I am curious, is there a LLVM/Clang option for slackware?
 
I TRIED TO MAKE SIMPLE software to test the complier and this is the result :

root@darkstar /t/t/build# gcc test.c -o test/usr/bin/ld: /lib64/libc.so.6: unknown type [0x13] section .relr.dyn'/usr/bin/ld: skipping incompatible /lib64/libc.so.6 when searching for /lib64/libc.so.6/usr/bin/ld: cannot find /lib64/libc.so.6/usr/bin/ld: /lib64/libc.so.6: unknown type [0x13] section .relr.dyn'/usr/bin/ld: skipping incompatible /lib64/libc.so.6 when searching for /lib64/libc.so.6/usr/bin/ld: /lib64/ld-linux-x86-64.so.2: unknown type [0x13] section .relr.dyn'/usr/bin/ld: skipping incompatible /lib64/ld-linux-x86-64.so.2 when searching for /lib64/ld-linux-x86-64.so.2/usr/bin/ld: cannot find /lib64/ld-linux-x86-64.so.2/usr/bin/ld: /lib64/ld-linux-x86-64.so.2: unknown type [0x13] section .relr.dyn'/usr/bin/ld: skipping incompatible /lib64/ld-linux-x86-64.so.2 when searching for /lib64/ld-linux-x86-64.so.2collect2: error: ld returned 1 exit statusroot@darkstar /t/t/build [1]# ll
You don't use the compiler (GCC) directly to compile software.

The GCC compiler has a flag to link object files together, if you omit it you're expected to run ld manually which is PITA.

You need -fPIC flag to build a shared object.
You need -g0 flag to build release
You need -ggdb flag to build debug

You need other flags as well, detailed list of flags is here:
C++:
// https://gcc.gnu.org/onlinedocs/gcc/Invoking-GCC.html
// https://gcc.gnu.org/onlinedocs/gcc/Option-Summary.html

GCC is capable to work without ld (invoke it implicitly) which you better do to avoid trouble.
And above all you need build system like make files at least rather than invoking GCC on command line directly.

The best advice I can give you is to study GCC manuals, start with links above.
 

Staff online

Members online


Latest posts

Top