Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22233

'Compiler proper' command for C program

$
0
0

This is regarding the compilation steps mentioned in the Linux Journal article.

The C program was compiled using cpp, cc1, as and ld commands in that article. I am able to execute the steps with cpp, as and ld. But the cc1 throws error.

cpp hello_new_world.c -o hello_new_world.i

As I am unable to use cc1:

gcc -S hello_new_world.i -o hello_new_world.s
ld -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/9/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/9 -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -lc -lgcc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/9/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crtn.o hello_new_world.o -o hello_new_world
as hello_new_world.s -o hello_new_world.o

Even though I can do the compilation steps using gcc switches -E, -S and -c switches, is there any command which replaced cc1 in the latest gcc? Or how to do the compiler proper with the dedicated command?

$ cc1 hello_new_world.i -o hello_new_world.s

Command 'cc1' not found, did you mean:

  command 'cct' from deb proj-bin (5.2.0-1)
  command 'ccr' from deb codecrypt (1.8-1)
  command 'ccx' from deb calculix-ccx (2.11-1build2)
  command 'cc' from deb gcc (4:9.2.1-3.1ubuntu1)
  command 'cc' from deb clang (1:9.0-49~exp1)
  command 'cc' from deb pentium-builder (0.21ubuntu1)
  command 'cc' from deb tcc (0.9.27-8)
  command 'ccs' from deb unanimity (3.3.0+dfsg-2.1)

Viewing all articles
Browse latest Browse all 22233

Trending Articles



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