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

MacPorts noreply at macports.org
Thu Nov 15 23:47:19 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):

 If, however, we add the `-isysroot` into the link mix (which we know
 should not be needed), by adding this to the Portfile:
 {{{
 # accept an sdkroot if one is set
 if {${configure.sdkroot} ne ""} {
     configure.cxx        "${configure.cxx} -isysroot${configure.sdkroot}"
     configure.cc         "${configure.cc}  -isysroot${configure.sdkroot}"
 }
 }}}

 presto -- we have success. The only difference I can see here is that now
 `-isysroot` had been added to the link command, and then it works:
 {{{
 /bin/sh ../libtool  --tag=CC   --mode=link /usr/bin/clang
 -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk
 -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 -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
 -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 -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
 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
 }}}

 and

 {{{
 $ port -v installed libedit
 The following ports are currently installed:
   libedit @20170329-3.1_2+universal platform='darwin 18' archs='i386
 x86_64' date='2018-11-05T20:57:12-0800'
   libedit @20180525-3.1_0+universal (active) platform='darwin 18'
 archs='i386 x86_64' date='2018-11-15T15:46:50-0800'
 }}}

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


More information about the macports-tickets mailing list