nm can't list symbol name for the object file generated by icc -ipo option

Author: Wang Yang - Intel Compiler Team

Reference Number
: DPD200117663
Version: Intel® C++ Compiler 11.x
Operating System : Linux
Problem Description :
When building some linux applications using the “-ipo” option, the libtool reports “syntax error in VERSION script”.
The root cause is that nm can’t get correct symbol table from the object file generated by icc ‘–ipo’ option build. This can be reproduced by the following example:
file test.c: void foo(){}
icc -c -ipo test.c –o test.o
nm test.o
it will only report
w __ildata_included

The symbol table can not be listed for the object file including ildata.

Resolution Status :
The possible work-arounds are the following:
1. Use the –ip option instead until icc includes a formal fix for this issue. This workaround may lose potential performance gains.
2. Quick workaround by adopting symbol table list from build without ipo option. We need to hack the libtool in this case.
For example, build application using gcc or icc without ipo option. After the build, collect ‘.exp’ files from build directory and copy to my/expfile/folder.
find . –name “*.exp” –exec cp “{}” my/expfile/folder “;”
vi libtool, find the place that generates the export symbols. You may try to search string “{export_symbols}T” to locate that place. Add the code before the symbol generation like:
cp my/expfile/folder/$libname.exp $output_objdir/$libname.exp
It will copy the correct exp file and replace the incorrect one.

For more complete information about compiler optimizations, see our Optimization Notice.