Tagged Questions
4
votes
1answer
53 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:
...
1
vote
0answers
18 views
Debugging information in GCC preprocessor output [migrated]
I was inspecting the preprocessed output generated by GCC, and I see a lot of these in the .i file that I generated using the -save-temps flag:
# 8 "/usr/include/i386-linux-gnu/gnu/stubs.h" 2 3 4
...
-3
votes
2answers
65 views
Using file system call
I'm trying to learn system calls for open,write and close a file.
I use this sample and the result is:
gcc: error trying to exec 'cc1plus': execvp: No such file or directory
Here's my program:
...
0
votes
0answers
33 views
GCC Constructor & Link order, Are they have relation? [migrated]
I have to write this question, I have try a lots to find the reason.
There is a.c:
UTEST_BEGIN()
UID(a_test)
{
printf("a test");
return true;
}
UTEST_END(a)
b.c is simlar:
UTEST_BEGIN()
...
2
votes
3answers
122 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 ...
58
votes
4answers
13k 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 ...
1
vote
1answer
8k 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 ...
4
votes
1answer
534 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 ...
5
votes
4answers
612 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 ...
0
votes
1answer
2k views
how to Update gcc of OpenSuse 11.2?
I have OpenSuse 11.2 with gcc version 4.4.1. I would like to update my gcc version to 4.5.1. I have downloaded gcc-4.5-19.1.i586.rpm. When I rpm install it, it's asking for ...