Questions regarding GNU Compiler Collection Suite.

learn more… | top users | synonyms

135
votes
4answers
50k views

Why is FreeBSD deprecating GCC in favor of Clang/LLVM?

So I was surfing the net and stumbled upon this article. It basically states that FreeBSD, starting from Version 10 and above will deprecate GCC in favor of Clang/LLVM. From what I have seen around ...
44
votes
5answers
2k views

How to compile the C compiler from scratch, then compile Unix/Linux from scratch

Let's say I work for a large services organisation outside the US/UK. We use UNIX and Linux servers extensively. Reading through this article it mentions that it would be easy to insert a backdoor ...
10
votes
5answers
5k views

Compiling GNU/Linux with -O3 optimization

It's said that compiling GNU tools and Linux kernel with -O3 gcc optimization option will produce weird and funky bugs. Is it true? Has anyone tried it or is it just a hoax?
9
votes
2answers
2k views

Why does FreeBSD use the GPL-licensed GCC?

Why does FreeBSD use GCC as its default compiler? I am under the impression that a core pillar of the FreeBSD philosophy is not to use any GNU software and in particular, GPL code. Yet GCC which is ...
9
votes
1answer
772 views

How does gcc know where boost is installed

I installed boost using sudo apt-get install on Ubuntu. Later I did not have to give gcc the I flag alongwith the path to the boost libraries to use boost ! Nor did I do any pkg-config --cflags --libs ...
7
votes
2answers
2k views

.dtors looks writable, but attempts to write segfault

This is Ubuntu 9.04, 2.6.28-11-server, 32bit x86 $ cat test.c main() { int *dt = (int *)0x08049f18; *dt = 1; } $ readelf -S ./test ... [18] .dtors PROGBITS 08049f14 000f14 000008 ...
7
votes
2answers
831 views

Find and install man file manually

I seem to be missing some man pages, notably gcc and g++. It doesn't help that I specify the section. whereis doesn't list man pages for those two, so I think they are simply not there. With Google I ...
6
votes
1answer
5k views

Install g++ when having gcc (C only) — RH6

I have a RedHat 6 machine, which came with gcc but without g++. The gcc version is 4.4.4 20100726 (this is what I got from gcc --version). How can I get g++ working? Currently, the shell just returns ...
6
votes
1answer
3k views

Is there a way to deactivate Buffer overflow protection on my machine?

I want to do some experiments with buffer overflows on my various virtual machines, including (but not limited to) Debian 6, Ubuntu 12.04, Fedora 16, but every time I try to execute the buffer ...
6
votes
2answers
10k views

Get newest gcc for debian?

I can't build my apps on gcc since I use various c++0x features. I'm on Debian 6 (Lenny) and after upgrade/updating I have gcc version 4.4.5-8. I'm unsure which version is required but mingw 4.6.2 ...
6
votes
1answer
2k views

Linux, GNU GCC, ld, version scripts and the ELF binary format — How does it work?

I'm trying to learn more about library versioning in Linux and how to put it all to work. Here's the context: -- I have two versions of a dynamic library which expose the same set of interfaces, say ...
6
votes
1answer
757 views

CLFS: Building GCC cross compiler

Currently I try to build a embedded Linux from scratch with the instructions from Cross Linux from Scratch. Everything worked fine until I tried to compile the GCC Cross-Compiler. I want to build the ...
5
votes
4answers
889 views

Does optimizing for size reduce runtime memory usage as well as binary size?

Does optimizing for size with gcc -Os only reduce the binary size of a program, or does it reduce its runtime memory usage as well? I know what exactly the results are depend on the specific code, but ...
5
votes
1answer
23k views

gcc can't link to pthread?

I have recently installed XUbuntu 11.10 64bit, but I am having problem compiling the most simple pthread example. Here is the code pthread_simple.c: #include <stdio.h> #include ...
5
votes
1answer
577 views

How to recompile a Debian package with -Os?

There are a few larger programs I am interested in compiling with -Os. The normal method I use to patch/recompile programs is apt-get source followed by dpkg-buildpackage. I learned from the ...
5
votes
1answer
999 views

How can I get a static C compiler?

I'm playing around with chroot environments, and I'd like to have a portable C compiler so that I can easily set up some basic build-tools in each environment without having to move too many libraries ...
4
votes
4answers
2k views

How do I install GCC on a system with no compiler?

I've been messing around with my NAS which runs on Linux. I have root access, but there is no compiler. I seem to remember something about being able to compile on another system, but I'm not certain. ...
4
votes
2answers
7k views

How to create .ko files in Linux

I have written one driver for one device in Linux. How can I create (using gcc) a .ko file so that I can insert it into the kernel?
4
votes
1answer
157 views

Effect of static and dynamic linking on start address

I have a simple C program. I run: $ gcc Q1.c -Wall -save-temps -o Q1 Then I inspect the executable generated: $ objdump -f Q1 Q1: file format elf32-i386 architecture: i386, flags 0x00000112: ...
4
votes
1answer
203 views

Where does GCC look for its internal executables?

I have installed GCC to a custom prefix. When it is invoked, it complains that it cannot find some of its internal binaries. My computer's "official" GCC keeps them here: ...
4
votes
3answers
631 views

Changing my toolchain architecture (in gentoo)

This is somewhat gentoo-specific, so I'll explain it in that context, then try to abstract it to a generic linux machine. I accidently set my CHOST to "i686-pc-linux-gnu" in the beginning, not paying ...
4
votes
1answer
90 views

How to send the content of an emacs buffer to gcc without writing to disk?

It's common for me to run a throwaway piece of code I'm not particularly interested in saving on my disk, so I'm often working inside emacs in a buffer not attached to any file in my system. When ...
4
votes
1answer
605 views

CentOS 5.8 with gcc 4.4.7 links against libstdc++ 6.0.8. How is it possible?

According to the gcc ABI policy, gcc 4.4.7 should depend on libstdc++ 6.0.13. As far as I understood, the compiler version and the libstdc++ version are deeply interrelated and can't be swapped, so it ...
4
votes
1answer
458 views

Can I use a chroot on my dev machine to build an application to run on embedded linux installation?

I am trying to develop an application to run on an embedded linux installation. It comes with an older version of libc than I have on my development maching. If I were to create a chroot environment ...
4
votes
2answers
702 views

Unix/Linux C++ debugger that supports STL containers?

Currently I am using gcc-4.3.6 and Eclipse IDE for c++ development. I want to debug my project in Eclipse with gdb. I am having a hard time debugging code when it contains STL containers. Also I am ...
4
votes
1answer
152 views

How/why can Firefox packages work on all Linuxes?

How/why can a Firefox 64bit (or 32bit) package work on different Linux distributions since each Linux distribution has a different version for gcc, glibc, linux kernel, etc. ?
4
votes
2answers
787 views

list header files used by a project compiled with gcc along with hierarchy

I currently have a C++ project that spans two different source control systems. Without checking in the full complete source code from the first system into the second system I plan to check in just ...
4
votes
1answer
79 views

GCC (toolchain) for Ralink SoC - ELF not found and syntax error

I bought a Chinese P2P camera and there was no MJPEG stream, so I wanted to compile mjpg-streamer for it. Here's my CPU's info: # cat /proc/cpuinfo system type : Ralink SoC processor ...
4
votes
1answer
3k views

GCC error trying to exec 'cc1'

I was cross compiling a Linux kernel for my Raspberry Pi on a laptop (running debian 7) (followed the instructions here) but when I start compiling (make ARCH=arm CROSS_COMPILE=${CCPREFIX}) I get the ...
4
votes
1answer
298 views

Compiling C++11 code on old machines

I'm trying to compile a C++11 project on a bunch of old machines with old kernels. They're running CentOS 6.2, 6.3 Alt Linux 4.1. Others are unknown but similarly old. The machines won't let me ...
4
votes
2answers
371 views

Installing gcc without root?

I'm running OSX, and I don't have root, or an existing compiler. Is there any way I can install gcc? Are there official or trusted unofficial mach-o binaries that can be downloaded for a certain ...
3
votes
2answers
2k views

Running C Programs on Linux

I watched a video lecture today that introduced C and things like how to make a C program that will run in Linux. I followed the steps given and now I'm stuck with a bit of a problem. I created my C ...
3
votes
4answers
138 views

Why is that when I download a binary from the web it doesn't have executable permissions set, but when I use gcc to build a binary it does?

For example, if I have the file hello.c which just contains: int main() { printf("Hello world"); return 0; } and I built it in gcc with gcc hello.c -o hello I can then run ./hello and it ...
3
votes
3answers
300 views

Shortening build command

Is there any way I can shorten this openCV build command? g++ file.cpp -o newFileName `pkg-config --cflags --libs opencv` I tried adding: -o newFileName `pkg-config --cflags --libs opencv` to an ...
3
votes
2answers
3k views

Relationship between cc1 and gcc?

I'm trying to install Ruby in my home directory on a Linux server (without root access), which of course requires using gcc. The closest thing I can find is a directory by that name which (if you go ...
3
votes
2answers
43 views

Running -march optimized software on another architechture?

I'm running an Athlon64 server with LFS and would like to have a local copy of the server in a virtual machine for testing purposes and building software. My PC uses an i7 and the existing server ...
3
votes
1answer
67 views

GCC not runnable on FreeBSD

I'm trying to run GCC on FreeBSD and I get this error: % gcc ar: unrecognized option `--plugin' usage: ar -d [-Tjsvz] archive file ... ar -m [-Tjsvz] archive file ... ar -m ...
3
votes
1answer
345 views

ArchLinux pacman updates on Arm

I have ArchLinux embedded in userspace on my Samsung Series 3 Chromebook. The version of GCC I have installed via pacman is 4.7.2. I'd like a newer version, and the package database here shows that ...
3
votes
1answer
169 views

sudo environment: “g++: command not found”

I have a relatively fresh RHEL 6.5 install, on to which I have installed from source GCCC 4.9. After I installed GCC 4.9, I uninstalled the distro-provided older GCC version via: sudo yum remove gcc ...
3
votes
1answer
6k views

Install gcc 4.7.2 on Debian squeeze 64x

I want to use gcc 4.7.2 on my Debian squeeze 64x I followed instructions in this thread: Get newest gcc for debian?, but I'm getting an error, I tried several apt-get install commands I will settle ...
3
votes
1answer
419 views

Install Compiler, GCC, in SCO

I am having difficulty trying to install the GCC compiler in SCO, but can't get it to work. I have used an FTP to transfer some files (.tar.gz) to /u/test/installgnu/ and I extracted the files, but ...
3
votes
2answers
16k views

Debian 6 Squeeze - installing build-essentials - gcc / g++

The first thing to say is: "I am noob", so please be patient and don't laugh.. too much on me. I need to install c / c++ compiler and I heard that the best thing to do is to install gcc/g++ for that ...
3
votes
2answers
47 views

configure: error: C compiler cannot create executables

I am trying to upgrade apache 2.2.15 to 2.2.27. While running config.nice taken from apache2.2.15/build I am getting following error: checking whether the C compiler works... no configure: error: in ...
3
votes
1answer
23 views

How to configure my enviorment in such a way that a proper (different from the system one) version of library is used

I guess that this question is a borderline between ServerFault and StackOverflow and this site. But I think that U&L is most relevant. I have some C++ code that depends on a library in version X ...
3
votes
2answers
188 views

Howto install gcc on NetBSD 6.1.2?

I did a minimal install of NetBSD 6.1.2 and thought it would be easy to install a working gcc package. But even after pkg_add -r gcc48 gcc48-libs and adding gcc to the path, gcc is still not able to ...
2
votes
3answers
278 views

Linux GCC compiler options

I have recently started using Linux as a tool for programing. In my book, I have seen that the GCC is used with 2 options: -g and -o. Now, I know that -o is to set a filename, but what is the purpose ...
2
votes
3answers
335 views

How does gcc handle file permissions?

The executable files that gcc creates have execution permissions -rwxrwxr-x which are different than the permissions that the source file has. -rw-rw-r-- How does gcc set these permissions ?
2
votes
1answer
622 views

Extracting / Installing a TAR file

When I extract a tar file using this command: tar xvzf gcc-4.7.1.tar.gz (This is the directory the tar file is in: cd /u/test/GCC-4.7.1/) The files were extracted but they are in /dev/... (see below ...
2
votes
1answer
379 views

Compile the Ubuntu “Raring” Kernel with the Intel Compiler

Of course, the first question is: why I'm doing this. Just for fun! I'm learning more about Linux kernels and I have a virtual machine that I can replace in 15 minutes. Getting to business, I don't ...
2
votes
1answer
394 views

Being not admin user how to install local GCC instead of provided?

So I came into my classrom Debian is installed, and gcc 4.1. I want to install (compile from sources is an option - I have time..) for my self GCC 4.7 and adress it in bash as gcc anywhere. Is such ...