Community
cancel
Showing results for 
Search instead for 
Did you mean: 
116 Views

Wrong (or not) linking command line for xilibtool executing libtool with XCode on Mac

Jump to solution

Dear Intel Compiler Experts,


An issue making a project impossible to link on certain machine setup is blocking us at the moment on Mac OS.

To explain the context, the project is a dynamic library composed of one static library compiled by ICC and other files compiled and linked (with this static lib) by the Apple Compiler. On certain computers, the compilation is fully working with XCode 5.1.1 and ICC15, but on some others not. The exact same issue happens also with XCode 7.2 and ICC16.

The issue is the following one:

xilibtool: executing 'libtool'

error: libtool: more than one: -syslibroot option specified


If we add the '-v' option to the XCode Parameter 'OTHER_LIBTOOLFLAGS' we are now able to see more about this issue. Also we did the test on another machine where the issue was not happening. In both cases presented here, we are using ICC15 + XCode 5.1.1.

* Build with a MacPro with Mac OS X 10.10.5 with installed ICC15 and ICC16 (Fail)
xilibtool: executing 'libtool'
libtool  \
    -static \
    -arch_only \
    i386 \
    -syslibroot \
    /Developer/Xcode5.1.1/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk \
    -L/ [The *.a of the library compiled with ICC]
    -o \
    [The *.a of the library compiled with ICC]
    -L/usr/bin/icpc-15.0-base/compiler/lib \
    -L/usr/lib \
    -syslibroot \
    /Developer/Xcode5.1.1/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk \
    [The *.o files]
    /usr/bin/icpc-15.0-base/compiler/lib/libimf.a \
    /usr/bin/icpc-15.0-base/compiler/lib/libsvml.a \
    /usr/bin/icpc-15.0-base/compiler/lib/libirng.a \
    /usr/bin/icpc-15.0-base/compiler/lib/libipgo.a \
    /usr/bin/icpc-15.0-base/compiler/lib/libdecimal.a \
    /usr/bin/icpc-15.0-base/compiler/lib/libirc.a

error: libtool: more than one: -syslibroot option specified
Usage: libtool -static [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch]
Usage: libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table <filename>] [-seg_addr_table_filename <file_system_path>] [-all_load]

Indeed, there are two commands "syslibroot" in that case. More strange, the commands are involving two different MacOSX SDK versions... this is completely unexpected and not wanted.


* Build with a MacMini with Mac OS X 10.8.5 with installed ICC14 and ICC15 (Success)

xilibtool: executing 'libtool'
libtool  \
    -static \
    -arch_only \
    x86_64 \
    -L/ [The *.a of the library compiled with ICC]
    -o \
    [The *.a of the library compiled with ICC]
    -L/usr/bin/icpc-15.0-base/compiler/lib \
    -L/usr/lib \
    -syslibroot \
    /Developer/Xcode5.1.1/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk \
    [The *.o files]
    /usr/bin/icpc-15.0-base/compiler/lib/libimf.a \
    /usr/bin/icpc-15.0-base/compiler/lib/libsvml.a \
    /usr/bin/icpc-15.0-base/compiler/lib/libirng.a \
    /usr/bin/icpc-15.0-base/compiler/lib/libipgo.a \
    /usr/bin/icpc-15.0-base/compiler/lib/libdecimal.a \
    /usr/bin/icpc-15.0-base/compiler/lib/libirc.a

This case, everything is normal. Same XCode Project, same ICC version.

Has someone an idea about what could be the origin of this issue?


Thanks in advance!


Best Regards,


JbR

0 Kudos

Accepted Solutions
Zach_N_
Beginner
116 Views

It's not clear to me what's causing this, but here's a workaround that got me past this linker problem. Remove and reinstall the Xcode Command Line Tools by:

1. Delete directory /Library/Developer/CommandLineTools

2. Reinstall by running `xcode-select --install` from Terminal

That's it... hope that helps.

View solution in original post

2 Replies
Zach_N_
Beginner
117 Views

It's not clear to me what's causing this, but here's a workaround that got me past this linker problem. Remove and reinstall the Xcode Command Line Tools by:

1. Delete directory /Library/Developer/CommandLineTools

2. Reinstall by running `xcode-select --install` from Terminal

That's it... hope that helps.

View solution in original post

116 Views

Hi Zach,

Indeed, after reinstalling the command line tool, the linking issue seems to not appears any more.

Thanks again for your suggestion.