Questions tagged [gcc]
Questions regarding GNU Compiler Collection Suite.
756 questions
3
votes
0
answers
81
views
Problem with xcb with shm and image = it works fine [closed]
I want to show how does it work under X11 with Xshm etc = OK fine if you resize window without flickering problem.
Example:
Code main.c ( X11 version )
#include <X11/Xlib.h>
#include <X11/...
2
votes
1
answer
137
views
Trying to install MinGW means I can no longer install GCC
I was trying to install MinGW onto my system, and it seems I've bricked many of my headers by doing this. I'd run configure (../configure --host=x86_64-w64-mingw32) then sudo make install for mingw-...
4
votes
2
answers
895
views
Compiling stand-alone function binaries from the Linux kernel
How can I take snippets from the Linux kernel drivers' code, for example this drm_fb_helper_hotplug_event function inside drivers/gpu/drm/drm_fb_helper.c, and compile a binary file that I can run to ...
0
votes
1
answer
130
views
Which GCC version to use for compiling Linux 5.4.1 to bzImage without strlcpy errors?
I’m trying to compile the Linux 5.4.1 kernel to a bzImage using an older GCC version I built from source (gcc 8.2.0 and binutils 2.31.1), with:
make CC=<path_to_old_gcc> LD=<path_to_old_ld>...
0
votes
0
answers
130
views
ldd not showing actual shared libraries address
After having deactivated ASLR, with:
echo 0 | sudo tee /proc/sys/kernel/randomize_va_space
I used ldd /path/to/binary to get the address of the shared library that my binary (written in C) was using, ...
0
votes
0
answers
91
views
getting libstdc++_libbacktrace in gcc-6 on Raspbian?
I wanted to get a C++ backtrace on Raspbian 9, where there is gcc-6 available, and found https://stackoverflow.com/questions/72341483/how-can-i-generate-a-c23-stacktrace-with-gcc-12-1 :
You need to ...
0
votes
2
answers
173
views
cc/gcc -R flag to linker
Reference:
Weak symbol
In the link the following linker option is mentioned:
cc main.o -L`pwd` -Wl,-R`pwd` -lpowerslow -o main2
The purpose of all of the above flags have been documented in the GCC ...
0
votes
2
answers
536
views
Suggestions on Linux distro that allows updates ot C++ to latest compiler releases
I am currently using Ubuntu 24.04 (22.04. sorry, wrong) but frustrated that I can't load the latest GCC compilers. I have GCC 14.2 but want to install 14.3 and then 15.1 when available. Ubuntu won't ...
1
vote
0
answers
95
views
Weird behavior: Does libasan consume system memory constantly in Linux?
I am working on an embedded Linux system (kernel-5.10), and the cross GCC only supports -fsanitize=address for address sanitizer.
Then I built a testing program with -fsanitize=address and -lasan. ...
0
votes
0
answers
355
views
Building GCC 12.4, I get: libisl.so.23: ... No such file or directory
I'm trying to build GCC 12.4.0 on Oracle Linux 9.4 (sorry about that... not my choice of distribution), as a non-root user. So, I've downloaded and built my relevant prerequisites: gmp, mpfr, mpc, isl,...
0
votes
0
answers
50
views
Solaris 10 g++ virtual memory exhausted
I am trying to use the cm3-unix64le-d5.11.1-20210610 from the Modula 3 github. i am running the .cpp file and I get a virtual memory exhausted: Not enough space error. I have 16GB of RAM and I'm ...
1
vote
3
answers
2k
views
How to run node v20.x on CentOs 7.9?
I've been stuck on this issue for too long. Basically I have a node v20.x app that I'd like to run on a CentOS 7.9 server. For reasons, we do not wish to upgrade the OS now but I'm sure there must be ...
0
votes
1
answer
120
views
Do I need to extract a source tar file for each pass in LFS, or does creating a seperate named "build" folder suffice (like "build", "build2")?
There's a handful of programs like GCC that not only require two different passes when setting up LFS, but as is the case with GCC, it is also used for Libstdc++.
When going thru this setting up for ...
2
votes
1
answer
331
views
Automatic flush of stream when reading input
I read in Advanced Programming in Unix Environment this:
Line buffering comes with two caveats. First, the size of the buffer
that the standard I/O library uses to collect each line is fixed, so
I/O ...
0
votes
0
answers
162
views
cannot install yay -S --noconfirm bambustudio-git after yay -Syu to local/gcc 14.2.1+r134+gab884fffe3fc-1
I did a system upgrade on manjaro using yay -Syu. It appears it upgraded gcc to some experimental version.
I tried reinstalling gcc13 but it didn't fix the problem:
export LDFLAGS="${LDFLAGS/-...
0
votes
1
answer
408
views
Why was gcc-10 used in Debian12? (cat /proc/version)
On Debian 12 with KDE cat /proc/version returns:
Linux version 5.10.0-17-amd64 ([email protected]) (gcc-10
(Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian)
2.35.2) #1 ...
2
votes
1
answer
595
views
How can I install gcc10 in amazon linux 2023?
I am trying to install the NVIDIA driver and Cuda toolkit but it expects gcc10. Using p2.xlarge which has Tesla k80. And Tesla k80 supports Cuda toolkit 11.4 (https://www.nvidia.com/en-us/drivers/). ...
0
votes
0
answers
1k
views
Building GCC 9.1.0 fails (make: *** [Makefile:1004: all] Error 2)
Coding newbie, I'm a researcher trying to get an air quality program to run. It requires GCC9.1.0, but during the make step I keep getting an error line:
make[1]: Leaving directory '/home/(my name)/...
0
votes
1
answer
421
views
dlsym, when run from an LD_PRELOAD interposer, does not find any symbols from the main program
/* dlsym-main.c */
#include <stdio.h>
void doSomething(char const *msg)
{
fprintf(stderr, "Main program is doing %s\n", msg);
}
void (*fnptr)(char const *) = doSomething;
int ...
0
votes
2
answers
451
views
How to figure out version of gcc in debian 8 or 9 distribution without installation?
I need to get gcc compiler version 4.9.0 exactly for its standard library to use with specific version of intel compilers.
I figured out debian 8 has almost the desired version of gcc. I made a ...
0
votes
1
answer
121
views
Are gcc and g++ now distinct executables?
According to comments and accepted answers linked below, gcc and g++ are the same executable. Because they are the same, the value of argv[0] will determine behavior, whether the argument is "gcc&...
2
votes
1
answer
195
views
when is the environ symbol defined in the executable?
If I compile a simple test program, I get environment symbols defined (and exported) in the executable itself:
root@4ef8c4a55769:/# clang --version
Debian clang version 11.0.1-2
Target: aarch64-...
0
votes
1
answer
294
views
Compiling kernel modules for a Terramaster NAS
I'm having a bit of trouble with compiling the Coral AI PCIe drivers for my Terramaster NAS. Terramaster support has been no use at all. However, one other user has managed to compile some modules to ...
0
votes
1
answer
970
views
Building GCC 12.2.0 from source for aarch64 target
I've been trying to cross compile the source code to build GCC 12.2.0 for my RaspberryPi 4 B running Ubuntu 22.04. SO far I've tried doing this while configuring the project:
../gcc-12.2.0/configure --...
0
votes
0
answers
228
views
Linux From Scratch 12.1 GCC testsuite failing and timing out
I'm currently building Linux From Scratch 12.1 with the book, I've followed the instructions line by line. I'm struggling with the GCC testsuite, I have lots of FAIL and timeout. In addition to that, ...
0
votes
1
answer
138
views
How to validate self-build GNU toolchain and newlib?
I am working on an embedded system, where there is ARM SOC and RTOS.
I have built GNU toolchain with newlib for this embedded system, and did very basic testing.
Now before I can be sure to use the ...
0
votes
0
answers
413
views
RPM libgcc package conflicts with installed libgcc version newer
I am installing gcc4 (http://v14700.1blu.de/aix/index.php?n=Main.Gcc#v4.8.3) on aix.
One of the dependencies is libgcc 4.8.3-1.I install it via rpm -i libgcc-4.8.3-1.aix7.1.ppc.rpm and get the error: ...
0
votes
1
answer
231
views
Failed to build GNU toolchain and newlib 4.4 for ARM from scratch in X86 Linux
I am working on an embedded RTOS on ARM, now I am going to build the GNU toolchain for the ARM in my X86 Linux host (ubuntu-20.04), so I did followings by referring to https://gnutoolchains.com/...
0
votes
1
answer
176
views
Building and installing GCC 12 in a parallel/sub prefix on heavily modified Ubuntu 14.04
One of my systems that I still use a lot runs a kind of "Frankenbuntu" 14.04 that has received lots of additional updates via PPAs and software I build and install to /opt/local (using an ...
0
votes
0
answers
219
views
Failure to bootstrap GCC 13.2
I am trying to install the latest version of GCC 13.2 on my system:
Linux minty-virtual-machine 5.15.0-94-generic #104-Ubuntu SMP Tue Jan 9 15:25:40 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
...
0
votes
2
answers
381
views
I'm Using Distribution $X That was shipped With Compiler $Y, but I Need Compiler Version $Z
Issue
This question, and answers containing various approaches to solving it comes up many times almost daily on our exchange here. If a search result brought you here Welcome! If a comment I left in ...
0
votes
1
answer
3k
views
Debian Bullseye: Install gcc-11.4.0 and dependencies
I need to install gcc-11.4.0 + dependencies on Debian Bullseye.
I downloaded gcc-11.4.0 from:
http://ftp.de.debian.org/debian/pool/main/g/gcc-11/gcc-11_11.4.0-7_amd64.deb
However, if I try to install ...
5
votes
1
answer
2k
views
How to robustly determine which version of GCC was used to build the kernel from bash shell
What is a robust way in a bash shell to determine the version of GCC used to compile the currently running kernel? I need it in the form of major.minor.patch so that I can compare it with the last ...
0
votes
0
answers
117
views
Unable to build a cpp program on AIX with gcc fsanitize address
I'm trying to build a cpp program on AIX 7.2 using gcc with address sanitizer (-fsanitize=address) but this errors out with:
cc1plus: warning: '-fsanitize=address' not supported for this target
...
6
votes
4
answers
15k
views
Unrecognized command-line option ‘-ftrivial-auto-var-init=zero’ when building kernel module
I have very little experience with kernel module development. Despite this I have been tasked with maintaining an old driver for a Sensoray 626 DAQ card. I am using a very simple dkms setup to build ...
0
votes
0
answers
117
views
configure: error: C compiler cannot create executables ERROR on FreeBSD 14.0-RELEASE
I'm not able to install sudo on my FreeBSD 14.0-RELEASE-p3 amd64
marietto:/usr/ports/security/sudo # make
===> License sudo accepted by the user
===> sudo-1.9.15p4 depends on file: /usr/...
1
vote
1
answer
922
views
How can I build an older GCC version (8.5.0) on a newer Linux distribution (Devuan Excalibur/Debian Trixie)?
If I download and try to build GCC 8.x on a newer machine, e.g. Devuan Excalibur GNU/Linux (i.e. Debian Trixie without systemd) - this fails, with the error going something like this:
libstdc++.so.6: ...
0
votes
1
answer
261
views
gcc build error
when I configure gcc I got a error message
could anyone help me ? plz..
messages..
checking whether the C compiler works... no
configure: error: in `/home/kjs0625/gcc/gcc-13.1.0':
configure: error: C ...
0
votes
1
answer
223
views
Allowing just switch ranges in gcc
I'm trying to clean up some C code and build a Debian package. The makefile was set to use -Wall but debuild uses -Wpedantic .
As it happens this was "a good thing" as the code was casting ...
1
vote
1
answer
407
views
Compiling GCC failed on Openbsd 7.4 (configure: error: .... libgomp)
I'm yak shaving: to compile gcc (especially with libgccjit for ultimately compiling emacs with native-comp) on openbsd 7.4.
The reason behind is libgccjit isn't available via pkg_add. Thus I'm trying ...
2
votes
2
answers
3k
views
Before you can run VMware several modules must be compiled (vmmon and vmnet)
I just restarted my Pop!_OS and when trying to open vmware it says I have to compile several modules. It then goes onto trying to compile vmmon and vmnet, which fails. and gives me an error log file.
...
1
vote
1
answer
816
views
make command doesn't produce any executable
My Makefile contains the following:
CC=gcc
CFLAGS=-Wall
main: hello.o hello_fn.o
clean:
rm -f main hello.o hello_fn.o
It should have produced an executable file main (I've read that in ...
0
votes
1
answer
222
views
is it possible to link the zlib when genreate so with gcc
I need to invoke the c method from rust. Fisrt step, I am using gcc to generate a so file like this:
gcc -shared *.o -o libsynctex_parser.so
But when I build the rust project, it shows that the c ...
1
vote
0
answers
162
views
Behavior of running ldconfig with a directory argument
I have installed some shared libraries to the non-standard directory /usr/lib64/mylib. Then I run sudo ldconfig /usr/lib64/mylib. I can assert by running ldconfig -p that my libraries are indeed ...
1
vote
2
answers
4k
views
Error building GCC 9: version `GLIBCXX_3.4.30' not found
I've been trying to install GCC 9.5 on Debian Bookworm (12) using gcc-12 which is available in the Debian repos. The build fails at make citing it couldn't find GLIBCXX_3.4.30. The relevant part of ...
-1
votes
2
answers
259
views
How can we edit the source code of GNU's gdb debugger?
I am on a Linux(Ubuntu 22) machine with gcc installed. We know that gcc comes with gdb as debugger. There are many commands in gdb and I want to change the behaviour of some inbuilt commands(disp). ...
1
vote
1
answer
441
views
make menuconfig hangs when trying to compile linux kernel 6.1.44
I am trying to compile linux kernel 6.1 on Debian 12.
I have installed the build environment:
apt-get install build-essential bc libncurses-dev libssl-dev libelf-dev bison flex
Now when I run make ...
0
votes
0
answers
544
views
Compile git for /lib/ld-linux-armhf.so.3 from vm that links with /lib/ld-linux-aarch64.so.1 by default
I'm building git from source from a debian 10 vm that has /lib/ld-linux-aarch64.so.1, which ends up linked in the git binary after a basic NO_TCLTK=true make prefix=$(pwd)/2.41.0/arm make all and ~ ...
0
votes
1
answer
759
views
Why is debug flag in GCC abbreviated "g"?
In GCC the debug flag is "-g". I have not been able to find why "g" was chosen for this. Does anyone know?
0
votes
0
answers
403
views
How do I determine the GCC version in /proc/version on Ubuntu?
my core problem is that I can't find what version of GCC was used to compile my kernel on an Ubuntu machine. I've tried cat /proc/version, but the result is the following:
Linux version 5.19.0-46-...