LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to find equivalent cc options for gcc compiler (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-find-equivalent-cc-options-for-gcc-compiler-883591/)

rajeshu 05-30-2011 04:49 PM

How to find equivalent cc options for gcc compiler
 
I am comiling some programs on Linux using gcc previously compiled using cc compiler on Solaris. Below are some of the confusions:

1. There is -xildoff option in cc which is giving error "language ildoff not recognized". xildoff in cc is for switching off the option of incremental editor ild. Is there anything equivalent on gcc?

2. There is runtime link option in cc as -R but gcc just says "unrecognised option". Does gcc only supports LD_RUN_PATH?

3. There is -Xa option to force cc to chose a particular flavor of c.Its for default c and K&R C. gcc has -std option but not sure which one is equivalent to -Xa in c. It seems -std=c90?

Any help to chose the right options plese?
Thanks

neonsignal 05-31-2011 02:57 AM

Quote:

Originally Posted by rajeshu (Post 4371363)
There is -xildoff option in cc which is giving error "language ildoff not recognized". xildoff in cc is for switching off the option of incremental editor ild. Is there anything equivalent on gcc?

I'm assuming ild is an incremental linker. There is no ild in the GNU world, although ld supports relocatable linking (which also means the ability to incrementally link) using the '-r' or '-i' flags. There is no need to turn the option off, because by default you will not be incrementally linking.

Quote:

There is runtime link option in cc as -R but gcc just says "unrecognised option". Does gcc only supports LD_RUN_PATH?
The compiler does not directly link the files; the compiler chains to ld to do this. Options given to the compiler do not automatically get passed on to ld. Instead, use the '-X' flag where there are options that need to be passed to the linker. The command 'man ld' will give you a list of linker options; in this case '-rpath' to set the runtime library path, so gcc would need the options '-Xlinker -rpath=path'.

Quote:

There is -Xa option to force cc to chose a particular flavor of c.Its for default c and K&R C. gcc has -std option but not sure which one is equivalent to -Xa in c. It seems -std=c90?
If you mean the original K&R C, it was only an informal standard, so there is no need to supply any options. If you mean the second edition K&R, then it is the ANSI standard (which I am guessing is what '-Xa' means), so yes, this would mean using '-ansi' or '-std=c90' (and possibly '-pedantic' to enforce this). The gcc documentation has a page on this.

rajeshu 05-31-2011 05:25 PM

Many thanks for the updates. Reaaly helped meclarify my doubts.


All times are GMT -5. The time now is 06:20 AM.