11-22-2010
Using cc1 directly is not the way to go. If anything, it will only perform the first stage of the compilation.
I tried to use gcc -v in order to see ho it is done, and there are many more flags it uses on the command line.
my compilation line was: gcc -o checkstatvfs checkstatvfs.c.
The result:
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/cc1 -quiet -v checkstatvfs.c -D_FORTIFY_SOURCE=2 -quiet -dumpbase checkstatvfs.c -mtune=generic -auxbase checkstatvfs -version -fstack-protector -o /tmp/ccmVxJF6.s
as you can see, the output is an assembler file.
Then, the assembler is run:
as -V -Qy -o /tmp/ccYDwa43.o /tmp/ccmVxJF6.s
and after that, collect2 is run:
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/collect2 --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=both -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o checkstatvfs -z relro /usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/crt1.o /usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/crti.o /usr/lib/gcc/x86_64-linux-gnu/4.4.3/crtbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/4.4.3 -L/usr/lib/gcc/x86_64-linux-gnu/4.4.3 -L/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../.. -L/usr/lib/x86_64-linux-gnu /tmp/ccYDwa43.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-linux-gnu/4.4.3/crtend.o /usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/crtn.o
which does the linking, apparently.
You need to determine where did /usr/bin/gcc have gone away. I don't think that doing the compilation one step at the time will work for you.
10 More Discussions You Might Find Interesting
1. Programming
I need to know how to make a binary with gcc. I know how to create an obj file, but I'm not quite sure what to do about the linking part. I've gotten this far "gcc -c somefile.c somefile.o" then I'm left with an object file, but I don't see any linking command line options. Does anyone know how... (4 Replies)
Discussion started by: lilprogrammer
4 Replies
2. Programming
Hi all,
I compile my c program and get following result
hrnpfc01.c:1387: stray '\' in program
hrnpfc01.c:1387: parse error before `,'
hrnpfc01.c:1388: stray '\' in program
hrnpfc01.c:1388: parse error before `,'
hrnpfc01.c:1396: stray '\' in program
hrnpfc01.c:1396: parse error before... (4 Replies)
Discussion started by: zico
4 Replies
3. AIX
hi, everybody£º
i have a question, pls help me¡£
OS : RS/6000 AIX 4.3.3
cPU : Powerpc,POWER3
compiler : gcc 3.2.3
source file £º 8M
OS kernel : 32 bit (selecting at installing operating system, the hardware support 64 bit)
when i compiling the large source file (8 M), i... (3 Replies)
Discussion started by: q30
3 Replies
4. Programming
Hi all,
Yeasterday I try to compile c program by using cygwin. I just find an errors the fist one is concerinig about the end of the line.
To summit my Assignment which is the day after tommorow I have to compile my c program by using just gcc.
If any one know what do I have to... (5 Replies)
Discussion started by: Bell
5 Replies
5. Programming
I am new to comiling c/c++ programs with gcc compilier
unix - AIX version 5.3
gcc compiler version - 4.0.0
My makefile.
# makefile 1.0 08/20/98
#CC = cc
CC = gcc
ESQL = esql
CFLAGS = -Wall
DBSLIB=
DBSLIB=-L${INFORMIXDIR}/lib/esql -L${INFORMIXDIR}/lib `esql -libs`
ALL = hds_near... (9 Replies)
Discussion started by: anish
9 Replies
6. AIX
I'm trying to compile gcc 3.4.6 on AIX 5.2 but I get this error:
bison -t --name-prefix=java_ -o java/parse.c java/parse.y
M4sugar requires GNU M4. Install it before installing M4sugar or
set the M4 environment variable to its path name.make: *** Broken pipe
gcc -c -g -O2 -DIN_GCC -W... (7 Replies)
Discussion started by: untamed
7 Replies
7. Solaris
well, i know wich GCC can be download by Manager package, easy!
but I want install gcc "whith myself hands"
I have gcc .tar and i cant install by console.
after comand $make: erro
ok! i dont have compiler, but i want install gcc!
sorry my english... (6 Replies)
Discussion started by: Hyagosallet
6 Replies
8. UNIX for Dummies Questions & Answers
I have just installed OpenBSD on a 333MHz PPC iMac G3. It has a 6GB HDD that has been partitioned as 1GB MacOS 8.5.1, 3GB MacOS X 10.3.9, 2GB OpenBSD 4.8. I now need to install a bootloader so that my computer can recognize the OpenBSD partition at startup. I have been trying to install... (0 Replies)
Discussion started by: t04st3r
0 Replies
9. Red Hat
Hi All,
I am trying to compile httpd2.2.19 in RHEL5.5 using gcc version 4.1.2. This is first time I am trying to compile httpd in RHEL.
I ran configure with below option
./configure --prefix=/usr/local/apache --enable-rewrite --enable-ssl=shared... (0 Replies)
Discussion started by: kalpeer
0 Replies
10. Programming
I can't compile anything, the final make error says "Command failed for target `install-recursive'", but I am not able to identify the root cause of that error, I tried with cc, gcc 4.5, also gcc 5.2, using make, using gmake 3.82, ld 5.11, gld 2.31... and I am totally stuck yet... please help, to... (4 Replies)
Discussion started by: sugar222
4 Replies