Questions tagged [gcc]
GCC is the GNU Compiler Collection. It's the de facto standard compiler for C, C++, Go, Fortran, and Ada on Linux and supports many other languages and platforms as well.
41,811
questions
0
votes
2
answers
111
views
GCC compiler handles "char * str" and "char str[]" with the & operator differently [duplicate]
The compiler treats the types char * var and char var[] differently when it comes to taking the address of a variable via the & operator. Here's a little snippet of code to demonstrate:
#include &...
1
vote
1
answer
57
views
gnu inline assembly constraint `i` for memory address
Recetly, this function rip_rel_ptr has been added to Linux kernel.
https://elixir.bootlin.com/linux/latest/source/arch/x86/include/asm/asm.h#L118.
I can compile the kernel, but when I copy this ...
1
vote
0
answers
77
views
/usr/bin/ld multiple definition of during compile
I just want to mention that I didnt write this code or modify it in any way prior to trying to compile it. I have just been copying the source from EL5 to 6 to 7 and compiling it. I think when it went ...
0
votes
1
answer
29
views
Calling Conventions and Register Selection
I've been delving into compiler theory, and how do they really compile source code into machine code. Though, there is something that all papers about register selection seem to ignore, and I'm not ...
0
votes
0
answers
13
views
Cmake 3.17.5 (Centos7): using ISO C90 whereas CMAKE_CXX_STANDARD=11 [duplicate]
I have a simple program I compile with make via CMake.
The CMakeLists.txt contains
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
but I get lots of warnings and errors.
warning: ISO ...
0
votes
1
answer
55
views
How to resolve glibc errors in conda enviroment installation?
I am a non root user in a Linux based cluster. It doesn't have docker nor I have privileges to install it. The base environment have GLIBC version 2.17. I am trying to install packages (like faiss-gpu,...
0
votes
0
answers
19
views
i386-elf-gcc sending weird errors for C++ compilation
I am currently dabbling in OS Development, and one of the main tasks is to build an i386-elf-tools toolchain. I am following the playlist https://www.youtube.com/playlist?list=...
0
votes
0
answers
40
views
running ./configure returns error: Cannot link with libtool libs! (libltdl)
I am attempting to compile an older program on a new system. I've done this a few times with this same software and I have always been able to find some way to get it to work but this time I am ...
0
votes
0
answers
33
views
Linker problem while retargeting newlib with static library [duplicate]
I use a Gnu Arm toolchain with GCC v12.3.
I want to do some retargeting on my stm32. For this, I have a file stdlib_override.cpp:
#include <cerrno>
#include <sys/stat.h>
#include <sys/...
0
votes
0
answers
31
views
C:\Users\DELL\AppData\Local\Temp\cctSSakm.o:test.c:(.text+0x1e): undefined reference to `get_string' collect2.exe: error: ld returned 1 exit status
I see the error
c:\Users\DELL\AppData\Local\Temp\cc61L1BV.o:test.c:(.text+0x1e): undefined reference to `get_string'
collect2.exe: error: ld returned 1 exit status
C
#include <stdio.h>
#include ...
2
votes
1
answer
113
views
can I overwrite the malloc called by library functions?
my code (main.c):
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void* __real_malloc(size_t size);
void __real_free(void* ptr);
void* __wrap_malloc(size_t size)
{
...
-3
votes
0
answers
90
views
GCC not compiling any source codes [closed]
I'm using Clion and GCC on macOS Sequoia. And, when I tried to compile a source code, it keeps making this compile error.
GCC version : gcc (Homebrew GCC 14.1.0_1) 14.1.0
Apple Clang version : Apple ...
0
votes
0
answers
22
views
Issue compilation mingw32-g++ error: CreateProcess: No such file or directory
^~~~~~~
COLLECT_GCC_OPTIONS='-save-temps' '-v' '-std=c++11' '-Wall' '-march=i386' '-I' 'C:\nat\IP_TRAIN\Components\piscontrol\inc' '-I' 'C:\Qt\4.7.3\include\QtCore' '-I' 'C:\nat\IP_TRAIN\Tools\xbinder\...
0
votes
2
answers
160
views
Is there any way to explicitly tell compiler to stop optimization
Linux, C, GCC, ARM (Allwinner H3). Is it possible to get the following equivalent functionality (pseudocode):
#pragma optimizations-stop
#pragma registers-flush
a=10;
while(*b != 0) c++;
if(a == 0) { ...
0
votes
1
answer
89
views
Building GCC Cross-Compiler for ARM VxWorks
I am trying to build a cross-compiler from a x86-64 Linux host (Ubuntu-22.04 in WSL, with GCC 11) to arm-wrs-vxworks, and I'm having some serious trouble doing so. I have very limited experience with ...