Bug 171363 - Link step should not run if the flag "Preprocessonly (-E)" is specified in the compile step
Summary: Link step should not run if the flag "Preprocessonly (-E)" is specified in th...
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-build (show other bugs)
Version: 4.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: cdt-build-inbox@eclipse.org CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-23 04:18 EST by Abeer Bagul CLA
Modified: 2020-09-04 15:25 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Abeer Bagul CLA 2007-01-23 04:18:01 EST
Build ID: I20061214-1445 (Eclipse 3.3 M4)

While compiling my main.c file, I can specify the flag -E (Preprocess only) in the project properties dialog (C/C++ Build -> GCC Compiler -> Preprocessor -> Select the checkbox "Preprocess only").
If this flag is specified, the file which is generated as a result of the compile step will have the name main.o, but will contain a pre-processed c file.

The linker invocation fails because the file main.o is not a valid object file. 
Is it possible to cancel the invocation of a future command by checking the value of an option specified for an earlier command?

The console output is:

-----------------
**** Build of configuration Debug for project hello ****

make -k all
Building file: ../main.c
Invoking: GCC C Compiler
gcc -E -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d"
-MT"main.d" -o"main.o" "../main.c"
Finished building: ../main.c

Building target: hello.exe
Invoking: GCC C Linker
gcc  -o"hello.exe"  ./main.o  ./main.o: file not recognized: File format
not recognized
collect2: ld returned 1 exit status
make: *** [hello.exe] Error 1
make: Target `all' not remade because of errors.
Build complete for project hello
-----------------

More information:
Comment 1 Jonathan CLA 2012-09-24 11:13:03 EDT
I have the same request. This is an interesting thing when you want to have an linker script parsed by the preprocessor only. 

Like in linux tree.