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

MacPorts noreply at macports.org
Fri Apr 21 00:50:57 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):

 again, with clang-3.9.0 and ld64, this time forcing LTO -- works.

 {{{
 $ clang -v -flto main.c
 clang version 3.9.0 (tags/RELEASE_390/final)
 Target: x86_64-apple-darwin10.8.0
 Thread model: posix
 InstalledDir: /opt/local/libexec/llvm-3.9/bin
  "/opt/local/libexec/llvm-3.9/bin/clang" -cc1 -triple x86_64-apple-
 macosx10.6.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage
 -emit-llvm-bc -flto -disable-free -disable-llvm-verifier -discard-value-
 names -main-file-name main.c -mrelocation-model pic -pic-level 2 -mthread-
 model posix -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu
 core2 -target-linker-version 264.3.102 -v -dwarf-column-info -debugger-
 tuning=lldb -resource-dir
 /opt/local/libexec/llvm-3.9/bin/../lib/clang/3.9.0 -fdebug-compilation-dir
 /Users/cunningh/Desktop/test -ferror-limit 19 -fmessage-length 80 -stack-
 protector 1 -fblocks -fobjc-runtime=macosx-10.6.0 -fencode-extended-block-
 signature -fmax-type-align=16 -fdiagnostics-show-option -fcolor-
 diagnostics -o /var/folders/I0/I0fOotq3ErGZHYxrmmWiqU+++TI/-Tmp-/main-
 9db6ce.o -x c main.c
 clang -cc1 version 3.9.0 based upon LLVM 3.9.0 default target x86_64
 -apple-darwin10.8.0
 #include "..." search starts here:
 #include <...> search starts here:
  /usr/local/include
  /opt/local/libexec/llvm-3.9/bin/../lib/clang/3.9.0/include
  /usr/include
  /System/Library/Frameworks (framework directory)
  /Library/Frameworks (framework directory)
 End of search list.
  "/opt/local/libexec/llvm-3.9/bin/ld" -demangle -object_path_lto
 /var/folders/I0/I0fOotq3ErGZHYxrmmWiqU+++TI/-Tmp-/cc-9ece95.o -lto_library
 /opt/local/libexec/llvm-3.9/lib/libLTO.dylib -dynamic -arch x86_64
 -macosx_version_min 10.6.0 -o a.out -lcrt1.10.6.o
 /var/folders/I0/I0fOotq3ErGZHYxrmmWiqU+++TI/-Tmp-/main-9db6ce.o -lSystem
 /opt/local/libexec/llvm-3.9/bin/../lib/clang/3.9.0/lib/darwin/libclang_rt.osx.a
 }}}

 $ ./a.out
 Hello


 $ port -v installed | grep ld64
   ld64 @2_0+universal-ld64_127-ld64_136-ld64_236-ld64_97 (active)
 platform='darwin 10' archs='i386 x86_64' date='2016-09-01T23:15:02-0700'
   ld64-136 @136_9+llvm39-llvm34 (active) platform='darwin 10'
 archs='x86_64' date='2016-12-21T10:45:57-0800'
   ld64-latest @274.1_1+llvm39+universal-llvm34 (active) platform='darwin
 10' archs='i386 x86_64' date='2016-12-21T15:41:59-0800'

 $ port -v installed | grep clang-3.9
   clang-3.9 @3.9.0_2+analyzer (active) platform='darwin 10' archs='x86_64'
 date='2016-12-21T04:54:30-0800'

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


More information about the macports-tickets mailing list