Questions regarding GNU Compiler Collection Suite.

learn more… | top users | synonyms

157
votes
4answers
55k 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 ...
46
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 ...
11
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 ...
10
votes
6answers
6k 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
1answer
1k 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
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 ...
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
1k 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
2answers
12k 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
880 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
1answer
29k 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
4answers
1k 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
2answers
97 views

Packages to rebuild after upgrading gcc on gentoo systems

Which packages should be rebuilt after upgrading gcc on a gentoo system? Is it sufficient to run # emerge -a --oneshot `equery depends gcc |awk '{print " ="$1}'` as suggested similar for perl in ...
5
votes
2answers
3k 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 ...
5
votes
2answers
957 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 ...
5
votes
1answer
634 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
5k 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 ...
5
votes
1answer
48 views

Why is this Python package trying to use a non-existent gcc?

I'm trying to install PyCrypto for Python 3 on Solaris. Whether I do it via "python3 setup.py install" or "pip3 install pycrypto", I run into the same problem: a call is made to a gcc which does not ...
5
votes
2answers
90 views

Would it be possible to compile and bootstrap GNU?

A new Guix release came out some time ago. And I got the idea that if I can bootstrap glibc, gcc, and guix to HURD and Mach, I can have a non-Linux GNU system. But I also need some software like bash, ...
5
votes
1answer
1k 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
4k 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 ...
4
votes
2answers
8k 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
278 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
249 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
689 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
93 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
755 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
540 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
789 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
163 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
1answer
454 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
408 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
437 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
199 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
557 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
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
2answers
708 views

How to build Shallot

I am trying to build Shallot. I run x64 Debian Sqeeze. It runs into compile problems I don't understand... john@hayek:~/build/katmagic-Shallot-831de01$ make cc -O3 -I/usr/include ...
3
votes
1answer
135 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
2k views

How do I install the latest gcc on FreeBSD?

How do I install the latest gcc on FreeBSD ind set up the system so that this latest version would be used to compile further programs? At the moment of this writing the latest release of gcc is ...
3
votes
1answer
401 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
24 views

Why does `libc6 ` depend on `libgcc1`?

I was going through the dependencies of some packages with apt-cache depends and found, that the libc6 package depends on libgcc1, which in turn depends on gcc-4.9-base. Shouldn't such a fundamental ...
3
votes
1answer
527 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
2answers
5k views

error while compiling ffmpeg: gcc is unable to create an executable file

When I run the ./configure command in ffmpeg source directory I get this error: gcc is unable to create an executable file. If gcc is a cross-compiler, use the --enable-cross-compile option. Only do ...
3
votes
1answer
5k views

/usr/bin/ld: cannot find -lfl

After running the following command: g++ lex.yy.c -lfl I get the following error: /usr/bin/ld: cannot find -lfl How can I solve it?
3
votes
1answer
1k views

Why can yum still not update GCC 4.9.0?

GCC 4.9.0 has been released since April 22. However, I can still not update it through the following command: $yum update gcc Why does the yum repository lag so much behind gcc.gnu.org?