Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7953 Discussions

debug symbol of binary appeare always w/o debug enable

huang__yixuan
Beginner
433 Views

Hello, 

My ICC version intel_parallel_studio_xe_2015_update1, trial version.

I used following command to compile, 

icc  -w -fpermissive -fPIE -I. -DMKL_ILP64 -DLINUX  -std=c++11 -g0 -O3  -c xx.cpp -o /tmp/xx.o
xiar rcs /tmp/xx.a /tmp/xx.o

and use following command to link.

icc  /tmp/release/*.o -o release/yy -L/opt/intel/composer_xe_2015.3.187/lib/intel64 -L/opt/intel/composer_xe_2015.3.187/mkl/lib/intel64 -Wl,--start-group /opt/intel/composer_xe_2015.3.187/mkl/lib/intel64/libmkl_core.a /opt/intel/composer_xe_2015.3.187/mkl/lib/intel64/libmkl_intel_lp64.a /opt/intel/composer_xe_2015.3.187/mkl/lib/intel64/libmkl_sequential.a /opt/intel/composer_xe_2015.3.187/compiler/lib/intel64/libiomp5.a /opt/intel/composer_xe_2015.3.187/compiler/lib/intel64/libirc.a -Wl,--end-group -L.  -Bdynamic -lm  -Bstatic -pthread -lstdc++ -ldb -lsqlite3 

when I get binary yy as above, used objdump -t yy|grep debug, it will show. 

0000000000000000 l    d  .debug_aranges    0000000000000000              .debug_aranges
0000000000000000 l    d  .debug_info    0000000000000000              .debug_info
0000000000000000 l    d  .debug_abbrev    0000000000000000              .debug_abbrev
0000000000000000 l    d  .debug_line    0000000000000000              .debug_line
0000000000000000 l    d  .debug_str    0000000000000000              .debug_str
0000000000000000 l    d  .debug_loc    0000000000000000              .debug_loc
0000000000000000 l    d  .debug_ranges    0000000000000000              .debug_ranges

 

 

That I think it is a debug version, but actually, I do compile release version. 

My gcc is 4.9.2 compile from source code and instead of system default gcc (4.4) , os is centos6.6. 

2.6.32-504.el6.x86_64 #1 SMP Wed Oct 15 04:27:16 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

 

gcc -v 

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.9.2/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../gcc-4.9.2/configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++ --disable-dssi --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux --disable-multilib
Thread model: posix
gcc version 4.9.2 (GCC)

 

When I used gcc to compile, it should no issue. binary for gcc is about 5.2M, and for icc is 11M. 

Please advise any solution? 

 

Thanks, 

yixuan

 

 

0 Kudos
2 Replies
TimP
Honored Contributor III
433 Views

Do you not expect -g0 option to require debug symbols?

0 Kudos
huang__yixuan
Beginner
433 Views

Tim Prince wrote:

Do you not expect -g0 option to require debug symbols?

 

-g0 is my second try when it shows debug information even without that parameter. 

my first try is using following parameter:

icc  -w -fpermissive -fPIE -I. -DMKL_ILP64 -DLINUX -std=c++11 -O3  -c xx.cpp -o xx.o

 

0 Kudos
Reply