【发布时间】:2014-11-12 10:23:38
【问题描述】:
我在Solaris 10上使用gcc构建make程序,得到如下信息:
gcc: unrecognized option `-rdynamic'
检查gcc 文档中的rdynamic 后,我得到以下解释:
-rdynamic
Pass the flag -export-dynamic to the ELF linker, on targets that support it. This instructs the linker to add all symbols, not only used ones, to the dynamic symbol table. This option is needed for some uses of dlopen or to allow obtaining backtraces from within a program.
我的问题是:
(1) 虽然gcc 打印“gcc: unrecognized option -rdynamic”,但构建仍然成功。这是gcc 的默认行为吗?
(2) 我在Makefile中将“-rdynamic”替换为“-export-dynamic”,构建成功。这种替代有副作用吗?
附:我的gcc信息:
bash-3.00# gcc -v
Reading specs from /usr/local/lib/gcc/i386-pc-solaris2.10/3.4.6/specs
Configured with: ../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --enable-shared --enable-languages=c,c++,f77
Thread model: posix
gcc version 3.4.6
【问题讨论】: