[MacPorts] #53931: clang's ld doesn't recognise "-lto_library" flag on 10.6

MacPorts noreply at macports.org
Sat Apr 22 19:12:59 UTC 2017


#53931: clang's ld doesn't recognise "-lto_library" flag on 10.6
-------------------------------------------------+-------------------------
  Reporter:  mojca                               |      Owner:  jeremyhu
      Type:  defect                              |     Status:  new
  Priority:  Normal                              |  Milestone:
 Component:  ports                               |    Version:
Resolution:                                      |   Keywords:  snowleopard
      Port:  clang-3.9 clang-4.0 llvm-3.9        |
  llvm-4.0                                       |
-------------------------------------------------+-------------------------

Comment (by kencu):

 Fresh install of macports-2.4.1 on 10.6 with stock Xcode 3.2.6. No
 modifications made.
 {{{
 Version:        3.2 (10A432)
   Location:     /Developer
   Applications:
   Xcode:        3.2 (1610)
   Interface Builder:    3.2 (732)
   Instruments:  2.0 (1095)
   Dashcode:     3.0 (328)
   SDKs:
   Mac OS X:
   10.4: (8S2167)
   10.5: (9J61)
   10.6: (10A432)
 }}}

 `sudo port -v install ld64-236`  downloads a prebuilt binary and installs
 it, with some deps.

 If you uninstall all ports then try the build again, forcing a build of
 ld64-236, it fails on snowleopard with this old familiar error:

 {{{

 $ port -v installed
 No ports are installed.
 }}}
 {{{
 $ sudo port -v build ld64-236
 --->  Computing dependencies for ld64-236.............................
 The following dependencies will be installed:
  bzip2
  cctools
  clang-3.4
  clang_select
  db48
  expat
  gdbm
  gettext
  ld64
  ld64-127
  libedit
  libffi
  libiconv
  libmacho-headers
  libxml2
  llvm-3.4
  llvm_select
  ncurses
  openssl
  perl5
  perl5.24
  python27
  python2_select
  python_select
  readline
  sqlite3
  xz
  zlib
 Continue? [Y/n]: Y
 }}}

 {{{
 /opt/local/bin/clang++-mp-3.4 -Os -Os -stdlib=libstdc++ -stdlib=libstdc++
 -arch x86_64 -I/opt/local/libexec/llvm-3.4/include -DLTO_SUPPORT
 -Isrc/abstraction -Isrc/ld -Isrc/ld/parsers -I/opt/local/include
 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_ld64/ld64-236/work/dyld-421.2/include
 -c -o src/ld/passes/branch_island.o src/ld/passes/branch_island.cpp
 In file included from src/ld/parsers/opaque_section_file.cpp:26:
 In file included from /usr/include/c++/4.2.1/vector:65:
 /usr/include/c++/4.2.1/bits/functexcept.h:41:10: fatal error:
 'bits/c++config.h' file not found
 #include <bits/c++config.h>
          ^
 In file included from src/ld/parsers/macho_dylib_file.cpp:34:
 In file included from /usr/include/c++/4.2.1/vector:65:
 /usr/include/c++/4.2.1/bits/functexcept.h:41:10: fatal error:
 'bits/c++config.h' file not found
 #include <bits/c++config.h>
          ^
 In file included from src/ld/passes/branch_island.cpp:32:
 In file included from /usr/include/c++/4.2.1/vector:65:
 /usr/include/c++/4.2.1/bits/functexcept.h:41:10: fatal error:
 'bits/c++config.h' file not found
 #include <bits/c++config.h>
          ^
 In file included from src/other/dyldinfo.cpp:34:
 In file included from /usr/include/c++/4.2.1/vector:65:
 /usr/include/c++/4.2.1/bits/functexcept.h:41:10: fatal error:
 'bits/c++config.h' file not found
 #include <bits/c++config.h>
          ^
 In file included from src/ld/parsers/archive_file.cpp:32:
 In file included from /usr/include/c++/4.2.1/vector:65:
 /usr/include/c++/4.2.1/bits/functexcept.h:41:10: fatal error:
 'bits/c++config.h' file not found
 #include <bits/c++config.h>
 ...
 }}}

 which is fixed as usual by adding this bit into the Portfile in the
 ld64-236 section:

 {{{
 configure.cppflags-append -I/usr/include/c++/4.2.1/i686-apple-darwin10
 }}}

 and then ld64-236 builds through to completion, with a few warnings, and
 installs OK. In the end, here is what you're left with:

 {{{
 $ port -v installed | grep ld64
   ld64 @3_0+ld64_127 (active) platform='darwin 10' archs='x86_64'
 date='2017-04-22T11:24:34-0700'
   ld64-127 @127.2_14+llvm34 (active) platform='darwin 10' archs='x86_64'
 date='2017-04-22T11:24:32-0700'
   ld64-236 @236.3_7+llvm34 (active) platform='darwin 10' archs='x86_64'
 date='2017-04-22T12:08:21-0700'
 }}}

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


More information about the macports-tickets mailing list