Community
cancel
Showing results for 
Search instead for 
Did you mean: 
allquixotic
Beginner
75 Views

icpc/xild command line parsing

Hello,

I have an anomalous problem which appears to be related to the `xild' linker tool, which icpc invokes almost immediately in this link step when attempting to compile Qt 4.6 Tech Preview. The problem does not manifest if I create a very simple test case of a .cpp that exports one trivial function:

icpc -fPIC -shared -Qoption,ld,-soname,libHack.so.0.0.1 -o libHack.so.0.0.1 hack.cpp

This works fine.

However, there are several problems with this attempted link step in Qt 4.6:


icpc -Wl,-rpath-link,/home/sean/Downloads/qt-everywhere-opensource-src-4.6.0-tp1/lib -Qoption,ld,-rpath,/usr/lib -Qoption,ld,-rpath,/usr/lib -shared -Qoption,ld,-Bsymbolic-functions -Qoption,ld,--dynamic-list,/home/sean/Downloads/qt-everywhere-opensource-src-4.6.0-tp1/src/corelib/QtCore.dynlist -Qoption,ld,-soname,libQtCore.so.4 -o libQtCore.so.4.6.0 .obj/release-shared/qabstractanimation.o .obj/release-shared/qvariantanimation.o .obj/release-shared/qpropertyanimation.o .obj/release-shared/qanimationgroup.o .obj/release-shared/qsequentialanimationgroup.o .obj/release-shared/qparallelanimationgroup.o .obj/release-shared/qpauseanimation.o .obj/release-shared/qfuture.o .obj/release-shared/qfutureinterface.o .obj/release-shared/qfuturesynchronizer.o .obj/release-shared/qfuturewatcher.o .obj/release-shared/qrunnable.o .obj/release-shared/qtconcurrentfilter.o .obj/release-shared/qtconcurrentmap.o .obj/release-shared/qtconcurrentresultstore.o .obj/release-shared/qtconcurrentthreadengine.o .obj/release-shared/qtconcurrentiteratekernel.o .obj/release-shared/qtconcurrentexception.o .obj/release-shared/qthreadpool.o .obj/release-shared/qglobal.o .obj/release-shared/qlibraryinfo.o .obj/release-shared/qmalloc.o .obj/release-shared/qnumeric.o .obj/release-shared/qatomic.o .obj/release-shared/qmutex.o .obj/release-shared/qreadwritelock.o .obj/release-shared/qmutexpool.o .obj/release-shared/qsemaphore.o .obj/release-shared/qthread.o .obj/release-shared/qthreadstorage.o .obj/release-shared/qmutex_unix.o .obj/release-shared/qthread_unix.o .obj/release-shared/qwaitcondition_unix.o .obj/release-shared/qbitarray.o .obj/release-shared/qbytearray.o .obj/release-shared/qbytearraymatcher.o .obj/release-shared/qcryptographichash.o .obj/release-shared/qdatetime.o .obj/release-shared/qeasingcurve.o .obj/release-shared/qhash.o .obj/release-shared/qline.o .obj/release-shared/qlinkedlist.o .obj/release-shared/qlist.o .obj/release-shared/qlocale.o .obj/release-shared/qpoint.o .obj/release-shared/qmap.o .obj/release-shared/qmargins.o .obj/release-shared/qcontiguouscache.o .obj/release-shared/qrect.o .obj/release-shared/qregexp.o .obj/release-shared/qshareddata.o .obj/release-shared/qsharedpointer.o .obj/release-shared/qsize.o .obj/release-shared/qstring.o .obj/release-shared/qstringbuilder.o .obj/release-shared/qstringlist.o .obj/release-shared/qtextboundaryfinder.o .obj/release-shared/qtimeline.o .obj/release-shared/qvector.o .obj/release-shared/qvsnprintf.o .obj/release-shared/harfbuzz-buffer.o .obj/release-shared/harfbuzz-gdef.o .obj/release-shared/harfbuzz-gsub.o .obj/release-shared/harfbuzz-gpos.o .obj/release-shared/harfbuzz-impl.o .obj/release-shared/harfbuzz-open.o .obj/release-shared/harfbuzz-stream.o .obj/release-shared/harfbuzz-shaper-all.o .obj/release-shared/qharfbuzz.o .obj/release-shared/qabstractfileengine.o .obj/release-shared/qbuffer.o .obj/release-shared/qdatastream.o .obj/release-shared/qdebug.o .obj/release-shared/qdir.o .obj/release-shared/qdiriterator.o .obj/release-shared/qfile.o .obj/release-shared/qfileinfo.o .obj/release-shared/qiodevice.o .obj/release-shared/qnoncontiguousbytedevice.o .obj/release-shared/qprocess.o .obj/release-shared/qtextstream.o .obj/release-shared/qtemporaryfile.o .obj/release-shared/qresource.o .obj/release-shared/qresource_iterator.o .obj/release-shared/qurl.o .obj/release-shared/qsettings.o .obj/release-shared/qfsfileengine.o .obj/release-shared/qfsfileengine_iterator.o .obj/release-shared/qfilesystemwatcher.o .obj/release-shared/qfsfileengine_unix.o .obj/release-shared/qfsfileengine_iterator_unix.o .obj/release-shared/qprocess_unix.o .obj/release-shared/qfilesystemwatcher_inotify.o .obj/release-shared/qfilesystemwatcher_dnotify.o .obj/release-shared/qpluginloader.o .obj/release-shared/qfactoryloader.o .obj/release-shared/quuid.o .obj/release-shared/qlibrary.o .obj/release-shared/qlibrary_unix.o .obj/release-shared/qabstracteventdispatcher.o .obj/release-shared/qabstractitemmodel.o .obj/release-shared/qbasictimer.o .obj/release-shared/qeventloop.o .obj/release-shared/qcoreapplication.o .obj/release-shared/qcoreevent.o .obj/release-shared/qmetaobject.o .obj/release-shared/qmetatype.o .obj/release-shared/qmimedata.o .obj/release-shared/qobject.o .obj/release-shared/qobjectcleanuphandler.o .obj/release-shared/qsignalmapper.o .obj/release-shared/qsocketnotifier.o .obj/release-shared/qtimer.o .obj/release-shared/qtranslator.o .obj/release-shared/qvariant.o .obj/release-shared/qcoreglobaldata.o .obj/release-shared/qsharedmemory.o .obj/release-shared/qsystemsemaphore.o .obj/release-shared/qpointer.o .obj/release-shared/qcore_unix.o .obj/release-shared/qcrashhandler.o .obj/release-shared/qsharedmemory_unix.o .obj/release-shared/qsystemsemaphore_unix.o .obj/release-shared/qeventdispatcher_glib.o .obj/release-shared/qeventdispatcher_unix.o .obj/release-shared/qisciicodec.o .obj/release-shared/qlatincodec.o .obj/release-shared/qsimplecodec.o .obj/release-shared/qtextcodec.o .obj/release-shared/qtsciicodec.o .obj/release-shared/qutfcodec.o .obj/release-shared/qtextcodecplugin.o .obj/release-shared/qfontlaocodec.o .obj/release-shared/qiconvcodec.o .obj/release-shared/qstatemachine.o .obj/release-shared/qabstractstate.o .obj/release-shared/qstate.o .obj/release-shared/qfinalstate.o .obj/release-shared/qhistorystate.o .obj/release-shared/qabstracttransition.o .obj/release-shared/qsignaltransition.o .obj/release-shared/qeventtransition.o .obj/release-shared/qxmlstream.o .obj/release-shared/qxmlutils.o .obj/release-shared/moc_qfuturewatcher.o .obj/release-shared/moc_qthreadpool.o .obj/release-shared/moc_qnamespace.o .obj/release-shared/moc_qthread.o .obj/release-shared/moc_qeasingcurve.o .obj/release-shared/moc_qlocale.o .obj/release-shared/moc_qtimeline.o .obj/release-shared/moc_qfile.o .obj/release-shared/moc_qiodevice.o .obj/release-shared/moc_qnoncontiguousbytedevice_p.o .obj/release-shared/moc_qtemporaryfile.o .obj/release-shared/moc_qsettings.o .obj/release-shared/moc_qfilesystemwatcher_p.o .obj/release-shared/moc_qfilesystemwatcher_inotify_p.o .obj/release-shared/moc_qfilesystemwatcher_dnotify_p.o .obj/release-shared/moc_qpluginloader.o .obj/release-shared/moc_qlibrary.o .obj/release-shared/moc_qfactoryloader_p.o .obj/release-shared/moc_qabstracteventdispatcher.o .obj/release-shared/moc_qabstractitemmodel.o .obj/release-shared/moc_qeventloop.o .obj/release-shared/moc_qcoreapplication.o .obj/release-shared/moc_qcoreevent.o .obj/release-shared/moc_qmimedata.o .obj/release-shared/moc_qsocketnotifier.o .obj/release-shared/moc_qtimer.o .obj/release-shared/moc_qtranslator.o .obj/release-shared/moc_qobjectcleanuphandler.o .obj/release-shared/moc_qsharedmemory.o .obj/release-shared/moc_qeventdispatcher_glib_p.o .obj/release-shared/moc_qeventdispatcher_unix_p.o .obj/release-shared/moc_qtextcodecplugin.o .obj/release-shared/moc_qabstractstate.o .obj/release-shared/moc_qstate.o .obj/release-shared/moc_qfinalstate.o .obj/release-shared/moc_qhistorystate.o .obj/release-shared/moc_qabstracttransition.o .obj/release-shared/moc_qsignaltransition.o .obj/release-shared/moc_qeventtransition.o -L/home/sean/Downloads/qt-everywhere-opensource-src-4.6.0-tp1/lib -lpthread -lz -lm -ldl -pthread -lgthread-2.0 -lrt -lglib-2.0
ipo: warning #11015: Warning unknown option -Bsymbolic-functions
ipo: warning #11015: Warning unknown option --dynamic-list
ipo: warning #11009: file format not recognized for /home/sean/Downloads/qt-everywhere-opensource-src-4.6.0-tp1/src/corelib/QtCore.dynlist
ipo: remark #11000: performing multi-file optimizations
ipo: remark #11005: generating object file /tmp/ipo_icpcOAvw8i.o
ld: cannot open linker script file -soname: No such file or directory

Let's focus on each warning:
ipo: warning #11015: Warning unknown option -Bsymbolic-functions
Huh? GNU ld on my system definitely supports this option. My knowledge of the Intel compiler toolchain is admittedly limited, but I expected this option to be passed like this: icpc -> xild -> ld.

ipo: warning #11015: Warning unknown option --dynamic-list
GNU ld on my system expects the --dynamic-list option to have its parameter specified with an equals sign `=' rather than a space ` '. If -Qoption doesn't know to put an equals sign instead of a space, then GNU ld is going to complain. I need to coerce icpc/xild to properly send along this option.

ipo: warning #11009: file format not recognized for /home/sean/Downloads/qt-everywhere-opensource-src-4.6.0-tp1/src/corelib/QtCore.dynlist
Huh? As I clearly specified, this .dynlist file is part of a command line option to GNU ld. IPO shouldn't be doing anything with it, so I'm confused why this is showing up at all.

ld: cannot open linker script file -soname: No such file or directory
Huh? As I clearly specified, -soname is a parameter to the linker, to be passed verbatim to GNU ld. Why does xild try to use this as a script file!? What part of my command line is telling xild that I'm trying to pass a script file?


I have tried about a hundred different ways of organizing this command line to get icpc, or even directly invoking xild, to cleanly link this object file. But it seems that the command line option parser is deficient in understanding exactly what I'm telling it to do, probably because xild has this very awkward way of invoking GNU ld behind my back, without giving me any control over that step at all.

I am very close to just using GCC for this project, but would very much like to get the performance optimizations of Intel's compiler toolchain if possible. Is there any way to adjust my commandline to support the features I am trying to use of GNU ld without having icpc/xild freak out?

Thanks,

Sean
0 Kudos
2 Replies
TimP
Black Belt
75 Views

Does it work better if you don't attempt to mix ipo with ld options which appear to assume plain gnu-style .o files?
allquixotic
Beginner
75 Views

Quoting - tim18
Does it work better if you don't attempt to mix ipo with ld options which appear to assume plain gnu-style .o files?

I can link all the objects together using plain GNU ld and the command line options that are applicable to GNU ld. That's not a problem.

If I remove the GNU ld commandline options entirely, I get undefined symbols such as __dso_handle, which means that somehow I need to tell xild how to do the equivalent of what GNU ld would do.

Besides, doesn't the whole ipo step just create additional object files in /tmp and pass them all to GNU ld along with the options? That was my understanding, anyway. I had hoped that I _could_ mix IPO with ld options that are eventually passed down to GNU ld via xild. If not, then xild is extremely limited indeed.