Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why gcc doesn't recognize -rdynamic option?

Tags:

c

gcc

I got a gcc compilation error:

gcc-4.9: error: unrecognized command line option '-rdynamic'

and I tested compilation with -rdynamic in some environments. While I used the same version of gcc (4.9.2), in some environments gcc worked well, but others (e.g. Homebrew gcc 4.9.2_1, cygwin 64bit) not. What makes the difference?

like image 641
Yusuke Yoshimoto Avatar asked Mar 21 '26 08:03

Yusuke Yoshimoto


1 Answers

-rdynamic passes the flag -export-dynamic to ELF linker, on targets that support it.

Executable formats in OS X and Windows are not ELF, thus the option -rdynamic is not supported building for these operating systems.

like image 86
simurg Avatar answered Mar 22 '26 23:03

simurg



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!