[MacPorts] #57612: libtool does not respect -syslibroot when linking

MacPorts noreply at macports.org
Fri Nov 16 00:33:13 UTC 2018


#57612: libtool does not respect -syslibroot when linking
---------------------+--------------------
  Reporter:  kencu   |      Owner:  (none)
      Type:  defect  |     Status:  new
  Priority:  Normal  |  Milestone:
 Component:  ports   |    Version:
Resolution:          |   Keywords:
      Port:          |
---------------------+--------------------

Comment (by kencu):

 It looks like if you don't pass `-isysroot` to clang during the link, but
 only pass `syslibroot`, it appends the `syslibroot` search path onto the
 library default search path, which fails:
 {{{
 /bin/sh ../libtool  --tag=CC   --mode=link /usr/bin/clang -v  -pipe -Os
 -arch i386
 -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk
 -no-undefined -version-info 0:58:0 -L/opt/universal/lib
 -Wl,-headerpad_max_install_names -Wl,-v -arch i386
 -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk
 -o libedit.la -rpath /opt/universal/lib chared.lo common.lo el.lo eln.lo
 emacs.lo hist.lo keymacro.lo map.lo chartype.lo parse.lo prompt.lo read.lo
 refresh.lo search.lo sig.lo terminal.lo tty.lo vi.lo wcsdup.lo
 tokenizer.lo tokenizern.lo history.lo historyn.lo filecomplete.lo
 readline.lo literal.lo        -lncurses
 libtool: link: /usr/bin/clang -v -dynamiclib  -o .libs/libedit.0.dylib
 .libs/chared.o .libs/common.o .libs/el.o .libs/eln.o .libs/emacs.o
 .libs/hist.o .libs/keymacro.o .libs/map.o .libs/chartype.o .libs/parse.o
 .libs/prompt.o .libs/read.o .libs/refresh.o .libs/search.o .libs/sig.o
 .libs/terminal.o .libs/tty.o .libs/vi.o .libs/wcsdup.o .libs/tokenizer.o
 .libs/tokenizern.o .libs/history.o .libs/historyn.o .libs/filecomplete.o
 .libs/readline.o .libs/literal.o   -L/opt/universal/lib -lncurses  -Os
 -arch i386 -Wl,-headerpad_max_install_names -Wl,-v -arch i386
 -Wl,-syslibroot
 -Wl,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk
 -install_name  /opt/universal/lib/libedit.0.dylib -compatibility_version 1
 -current_version 1.58 -Wl,-single_module
 Apple LLVM version 10.0.0 (clang-1000.11.45.5)
 Target: i386-apple-darwin18.2.0
 Thread model: posix
 InstalledDir:
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
 @(#)PROGRAM:ld  PROJECT:ld64-409.12
 BUILD 17:47:51 Sep 25 2018
 configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h
 armv6m armv7k armv7m armv7em arm64e arm64_32
 Library search paths:
         /opt/universal/lib
         /opt/universal/lib
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/lib
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib
 Framework search paths:
         /Library/Frameworks/
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/
 ld: warning: The i386 architecture is deprecated for macOS (remove from
 the Xcode build setting: ARCHS)
 ld: warning: ignoring file
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/lib/libSystem.tbd,
 missing required architecture i386 in file
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/lib/libSystem.tbd
 Undefined symbols for architecture i386:
   "__DefaultRuneLocale", referenced from:
       _ce__isword in chared.o
       _cv__isword in chared.o
       _cv__isWord in chared.o
       _cv_next_word in chared.o
       _cv_prev_word in chared.o
       _cv__endword in chared.o
       _ed_move_to_beg in common.o
       ...
 }}}

 if you DO pass `-isysroot` to `clang` during the link, it replaces the
 default library search path (which is what you want) -- and then
 `syslibroot` adds it on again for us, for good measure:
 {{{
 /bin/sh ../libtool  --tag=CC   --mode=link /usr/bin/clang
 -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk
 -v  -pipe -Os -arch i386
 -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk
 -no-undefined -version-info 0:58:0 -L/opt/universal/lib
 -Wl,-headerpad_max_install_names -Wl,-v -arch i386
 -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk
 -o libedit.la -rpath /opt/universal/lib chared.lo common.lo el.lo eln.lo
 emacs.lo hist.lo keymacro.lo map.lo chartype.lo parse.lo prompt.lo read.lo
 refresh.lo search.lo sig.lo terminal.lo tty.lo vi.lo wcsdup.lo
 tokenizer.lo tokenizern.lo history.lo historyn.lo filecomplete.lo
 readline.lo literal.lo        -lncurses
 libtool: link: /usr/bin/clang
 -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk
 -v -dynamiclib  -o .libs/libedit.0.dylib  .libs/chared.o .libs/common.o
 .libs/el.o .libs/eln.o .libs/emacs.o .libs/hist.o .libs/keymacro.o
 .libs/map.o .libs/chartype.o .libs/parse.o .libs/prompt.o .libs/read.o
 .libs/refresh.o .libs/search.o .libs/sig.o .libs/terminal.o .libs/tty.o
 .libs/vi.o .libs/wcsdup.o .libs/tokenizer.o .libs/tokenizern.o
 .libs/history.o .libs/historyn.o .libs/filecomplete.o .libs/readline.o
 .libs/literal.o   -L/opt/universal/lib -lncurses  -Os -arch i386
 -Wl,-headerpad_max_install_names -Wl,-v -arch i386 -Wl,-syslibroot
 -Wl,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk
 -install_name  /opt/universal/lib/libedit.0.dylib -compatibility_version 1
 -current_version 1.58 -Wl,-single_module
 Apple LLVM version 10.0.0 (clang-1000.11.45.5)
 Target: i386-apple-darwin18.2.0
 Thread model: posix
 InstalledDir:
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
 @(#)PROGRAM:ld  PROJECT:ld64-409.12
 BUILD 17:47:51 Sep 25 2018
 configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h
 armv6m armv7k armv7m armv7em arm64e arm64_32
 Library search paths:
         /opt/universal/lib
         /opt/universal/lib
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib
 Framework search paths:
         /Library/Frameworks/
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/
 ld: warning: The i386 architecture is deprecated for macOS (remove from
 the Xcode build setting: ARCHS)
 libtool: link: (cd ".libs" && rm -f "libedit.dylib" && ln -s
 "libedit.0.dylib" "libedit.dylib")
 libtool: link: ar cru .libs/libedit.a  chared.o common.o el.o eln.o
 emacs.o hist.o keymacro.o map.o chartype.o parse.o prompt.o read.o
 refresh.o search.o sig.o terminal.o tty.o vi.o wcsdup.o tokenizer.o
 tokenizern.o history.o historyn.o filecomplete.o readline.o literal.o
 libtool: link: ranlib .libs/libedit.a
 }}}

 So this looks like a clang ld driver bug to me at the moment...

-- 
Ticket URL: <https://trac.macports.org/ticket/57612#comment:5>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list