Can't compile C program on a Mac after upgrade to Mojave
I have used the gcc command on the terminal to compile C programs but all of a sudden, after an update to my Mac's OS (to macOS 10.14 Mojave, and XCode 10.0), I started receiving the...
View Articlefork/exec aarch64-linux-gnu-gcc: exec format error
I have a makefile which states CC=aarch64-linux-gnu-gcc CGO_ENABLED=1 GOARCH=arm64 GO111MODULE=on go build -mod=vendor -ldflags "$(GO_BUILDINFO)" -o bin/victoria-metrics-arm64 ./app/victoria-metrics I...
View ArticleNull statement execution time in C
How does the compiler interpret null statements in C? In terms of execution time. ( empty ";" i.e., without any expression) And will it optimize code during execution if it encounters null statements,...
View ArticleWhy am I getting linker errors using -fgnu-tm?
I'm using GCC 6.2.0 and am trying out the experiemental transaction support. Following the manual, I've added "-fgnu-tm" to my cxxflags and added some synchronized {} blocks to my source code. It...
View ArticleSegmentation fault on linux-working on windows
The goal of this program is to scan a string populated with numbers and white spaces between them and insert each number into an array. Then each number from the array is sent to checkPowerOfTwo...
View ArticleCython: prange is repeating not parallelizing
I have the following simple Cython function for a parallel reduction:# cython: boundscheck = False # cython: initializedcheck = False # cython: wraparound = False # cython: cdivision = True # cython:...
View ArticleUnexpected behavior with inline assignment in GCC [duplicate]
This question already has an answer here:Why are these constructs using pre and post-increment undefined behavior? 14 answersI was messing around with some C code for my compilers class, and ran into...
View ArticleHow do I get gcc to compile with -rdynamic using CMake generated Makefiles?
I want gcc -rdynamic -o prog prog.c -L. -lfoobar -ldl, but I'm not sure how to get the argument -rdynamic to show up on the gcc (ld) linker command.
View Articlecompiling gcc 9.2; getting error: /usr/lib/../lib/crti.o: could not read...
After building three subsidiary libraries (MPC,GMP, MPFR) I started the compilation of gcc 9.2 thusly:tar xvf gcc-9.2.0.tar.gz cd gcc-9.2.0 sed -e '/m64=/s/lib64/lib/' -i.orig gcc/config/i386/t-linux64...
View ArticleAre stack variables aligned by the GCC __attribute__((aligned(x)))?
i have the following code:#include <stdio.h> int main(void) { float a[4] __attribute__((aligned(0x1000))) = {1.0, 2.0, 3.0, 4.0}; printf("%p %p %p %p\n", &a[0], &a[1], &a[2],...
View ArticleWhy does gcc reorder the local variable in function?
I wrote a C program that just read/write a large array. I compiled the program with command gcc -O0 program.c -o program Out of curiosity, I dissemble the C program with objdump -S command. The code...
View Articleerror: command 'gcc' failed with exit status 1 when installing pip packages...
I'm attempting transition my base docker image from centos 7 to alpine, however I receive gcc errors when trying to install pip packages.This is a snippet of the error received:Successfully built...
View ArticleMigrating code from OpenVMS to Linux with GCC compiler -> Error:...
We have a legacy code that used to be compiled and run with no errors under Open-VMS environment, using CXX compiler. We decided to migrate to Linux, and to use GCC compiler, so we copied the code and...
View Articlesubprocess.CalledProcessError: Command '['which', 'g++']' returned non-zero...
I ran into this error while I was installing deformable conv as given here: link(pytorch-env) abhijay@abhijay-G7:~/git-clones/EDVR/codes/models/archs/dcn$ python3 setup.py develop running develop...
View ArticleWhy more stack are allocated by gcc in arm assembly? [duplicate]
This question already has an answer here:Why “Procedure Call Standard for the ARM Architecture” (AAPCS) requires SP to be 8-byte aligned? 3 answersWhy does the compiler allocate more than needed in the...
View ArticleCompile with gcc on Macos 10.14.5 that will support earlier versions of Mac
I have a c ++ code that I wrote that uses almost nothing, which is not the language itself (except using osascript).After compiling it on my operating system version (10.14.5) with the following flags:...
View ArticleGCC placing register args on the stack with a gap below local variables?
I tried to look at the assembly code for a very simple program.int func(int x) { int z = 1337; return z; } With GCC -O0, every C variable has a memory address that's not optimized away, so gcc spills...
View Articleg++-9.1 fails to link opencv [duplicate]
This question already has an answer here:Linking problems due to symbols with abi::cxx11? 2 answersWhat is an undefined reference/unresolved external symbol error and how do I fix it? 32 answersI am...
View ArticleGetting assember output from GCC/Clang in LTO mode
Normally, one can get GCC's optimized assembler output from a source file using the -S flag in GCC and Clang, as in the following example.gcc -O3 -S -c -o foo.s foo.c But suppose I compile all of my...
View Articleinstalled gcc and g++ on Mac mojave is not working (brew install)
I installed gcc by brew on Mac OS mojave, but both of gcc and g++ are not working.I tried compile below simple code by g++ but I got error messages.This program can be compiled correctly by default...
View Article