Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Browsing all 21994 articles
Browse latest View live
↧

How do you package GCC for distribution?

I am making a modified C++ compiler and I have it built and tested locally. However, I would like to be able to package my build for Windows, Linux (Debian), and Mac OSX.All of the instructions I can...

View Article


gcc linker not finding linked libraries

I'm porting a small program to run on my RPi from my windows machine. The code is correctly ported but I'm having some issues with the linking process. Googling or searching on here has yielded nothing...

View Article


CMake and Static Linking

I'm using CMake in a project, and I'm trying to statically link some libraries.I've set:set(BUILD_SHARED_LIBS OFF)set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++...

View Article

gcc optimization flags for Xeon?

I'd want your input which gcc compiler flags to use when optimizing for Xeons?There's no 'xeon' in mtune or march so which is the closest match?

View Article

SIGILL Stack overflow

From https://www.allegro.cc/forums/thread/617807If I don't call abort on line 44, my program crashes with SIGILL.Why doesn't it exit cleanly? I put the value of the frame pointer back where it was but...

View Article


How to install an older version of gcc on Fedora

I tried to install CUDA on fedora 31 but got stuck at the last step because CUDA officially support fedora 29 (gcc 8.2) while the version shipped with fedora 31 is 9.2, I then installed pytorch with...

View Article

How to solve "Could not find the task 'gcc build active file." error in VSCode?

I've just setup VSCode to work from home with my remote SSH that runs Gentoo x64. Everything works fine apart from the GCC debugger which we usually use. It throws me the error in the title.Here's my...

View Article

How do the likely/unlikely macros in the Linux kernel work and what is their...

I've been digging through some parts of the Linux kernel, and found calls like this:if (unlikely(fd < 0)){ /* Do something */}orif (likely(!err)){ /* Do something */}I've found the definition of...

View Article


Modify AST tree in C and compile the new AST tree

What I want to do is 1. Parse C code to generate AST2. Modify the AST3. Compile the new AST without changing the .c source file.Is there any tool I can use to do this? If not, is there any tool I can...

View Article


Assembly. Why does GCC create extra instructions in the end of .text section?

I'm learning GAS Assembler on Windows with MinGW-64 and I have a question about MinGW. Why does this compiler generate extra instructions in the end of .text section? I found some answers where people...

View Article

Using array inside function. Change made to the array inside function is not...

I am declaring an array inside main() and without initializing the array, I am printing the array by passing it to a function. It is printing the same value as many time as I run this program. As we...

View Article

`movaps` vs. `movups` in GCC: how does it decide?

I recently researched a segfault in a piece of software compiled with GCC 8. The code looked as follows (this is just a sketch)struct Point{ int64_t x, y;};struct Edge{ // some other fields // ......

View Article

How to make a shared library delay loaded on Linux

I've been searching a way to make a shared library (let's name the library libbar.so) delay loaded on Linux and it should hopefully be realized with a help from only a linker, not modifying anything on...

View Article


How to compile and run a C program with `gcc`?

A complete newbie here. I am learning to read the codes on suckless.org. They are written in C, and are most quite short, so I think it's a good start.The problem is I know too little to start with....

View Article

Why the compiler does this division

I'm trying to optimize nbody algorithm and this operation is expensive real s = jMass / POW(distSqr,3.0/2.0);so I tried to convert in:s = jMass * POW(distSqr, -3.0/2.0);but the compiler gcc with -Ofast...

View Article


Why LSan (with gcc) doesn't find memory leaks which are allocated by mmap?

I tested it with below code// main.c#include <sys/mman.h>#include <string.h>#include <stdlib.h>int main() { int* ptr1 = (int*)malloc(1); int* ptr2 = (int*)mmap(0, 4096*10,...

View Article

Make change directory and allow parallel jobs at one fails

I'm using make command to build my C files in Linux. I can build it without errors form another directory using -C DIRECTORY option. I can build it in it's directory allowing multiple jobs using -j [N]...

View Article


Compiling with GCC error: cc1 out of memory error

I have a machine running Xubuntu 64 bit and I'm trying to compile my pretty long C code. I am using gcc.I chrooted in a raspbian stretch environment because the executable code must run on my Raspberry...

View Article

What is the standard way to manage calling-convention compatibility between a...

I'm building a C program which explicitly dynamically loads DLLs as part of a plugin system. I'm using GCC with Mingw on Windows 7.What calling convention should the exported functions in the DLLs use,...

View Article

Why /usr/lib64 is not in the default location of ld.so?

Yestoday, I tried to upgrade my gcc from version 8.4.0 to 9.3.0 by building from source, because the latest version that can be installed through apt repo of Ubuntu, is 8.4.0.Building and installing...

View Article
Browsing all 21994 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>