[MacPorts] #62426: libc++: using a newer libc++ to build software on older macos systems

MacPorts noreply at macports.org
Tue Sep 27 13:09:25 UTC 2022


#62426: libc++: using a newer libc++ to build software on older macos systems
-------------------------------------+--------------------
  Reporter:  kencu                   |      Owner:  kencu
      Type:  enhancement             |     Status:  closed
  Priority:  Normal                  |  Milestone:
 Component:  ports                   |    Version:
Resolution:  fixed                   |   Keywords:
      Port:  libcxx macports-libcxx  |
-------------------------------------+--------------------

Comment (by RJVB):

 Adding `-D_LIBCPP_HIDE_FROM_ABI_PER_TU_BY_DEFAULT` to the test build
 doesn't make a difference, but I think it stands to reason that
 libLLVM.dylib should also have been built with it.

 BTW, here's an interesting manifestation of what could be the same
 problem:

 {{{
 > sudo install_name_tool -change {/usr,/opt/local}/lib/libc++.1.dylib
 /opt/local/libexec/llvm-12/lib/libLLVM.dylib ; build-libcxx-test.sh
 clang++-mp-12 -I/opt/local/libexec/llvm-12/include/
 -Wl,-rpath,/opt/local/libexec/llvm-12/lib -L/opt/local/libexec/llvm-12/lib
 -v
 clang version 12.0.1
 Target: x86_64-apple-darwin13.4.0
 Thread model: posix
 InstalledDir: /opt/local/libexec/llvm-12/bin
 clang: warning: -Wl,-rpath,/opt/local/libexec/llvm-12/lib: 'linker' input
 unused [-Wunused-command-line-argument]
 clang: warning: argument unused during compilation:
 '-L/opt/local/libexec/llvm-12/lib' [-Wunused-command-line-argument]
  (in-process)
  "/Volumes/Debian/MP9/libexec/llvm-12/bin/clang" -cc1 -triple x86_64
 -apple-macosx10.9.0 -Wundef-prefix=TARGET_OS_ -Werror=undef-prefix
 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj
 -mrelax-all --mrelax-relocations -disable-free -disable-llvm-verifier
 -discard-value-names -main-file-name libcxx-test.cpp -mrelocation-model
 pic -pic-level 2 -mframe-pointer=all -fno-rounding-math -munwind-tables
 -faligned-alloc-unavailable -fcompatibility-qualified-id-block-type-
 checking -fvisibility-inlines-hidden-static-local-var -target-cpu core2
 -tune-cpu generic -debugger-tuning=lldb -target-linker-version 450.3 -v
 -resource-dir /Volumes/Debian/MP9/libexec/llvm-12/lib/clang/12.0.1 -D
 __STDC_CONSTANT_MACROS -D __STDC_FORMAT_MACROS -D __STDC_LIMIT_MACROS -I
 /opt/local/libexec/llvm-12/include/ -stdlib=libc++ -internal-isystem
 /opt/local/libexec/llvm-12/bin/../include/c++/v1 -internal-isystem
 /usr/local/include -internal-isystem
 /Volumes/Debian/MP9/libexec/llvm-12/lib/clang/12.0.1/include -internal-
 externc-isystem /usr/include -std=c++17 -fdeprecated-macro -fdebug-
 compilation-dir /Volumes/Debian/Users/bertin/work/src/new -ferror-limit 19
 -fmessage-length=132 -stack-protector 1 -fblocks -fencode-extended-block-
 signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fcxx-
 exceptions -fexceptions -fmax-type-align=16 -fcolor-diagnostics -o libcxx-
 test.o -x c++ libcxx-test.cpp
 clang -cc1 version 12.0.1 based upon LLVM 12.0.1 default target x86_64
 -apple-darwin13.4.0
 #include "..." search starts here:
 #include <...> search starts here:
  /opt/local/libexec/llvm-12/include
  /opt/local/libexec/llvm-12/bin/../include/c++/v1
  /usr/local/include
  /Volumes/Debian/MP9/libexec/llvm-12/lib/clang/12.0.1/include
  /usr/include
  /System/Library/Frameworks (framework directory)
  /Library/Frameworks (framework directory)
 End of search list.
 libcxx-test.cpp:1:10: fatal error: cannot open file
 './llvm/Support/Errc.h': No such file or directory
 #include "llvm/Support/Errc.h"
          ^
 1 error generated.
 clang version 12.0.1
 Target: x86_64-apple-darwin13.4.0
 Thread model: posix
 InstalledDir: /opt/local/libexec/llvm-12/bin
 clang: error: no such file or directory: 'libcxx-test.o'
 Exit 1
 }}}

 {{{
 > sudo install_name_tool -change {/opt/local,/usr}/lib/libc++.1.dylib
 /opt/local/libexec/llvm-12/lib/libLLVM.dylib ; build-libcxx-test.sh
 clang++-mp-12 -I/opt/local/libexec/llvm-12/include/
 -Wl,-rpath,/opt/local/libexec/llvm-12/lib -L/opt/local/libexec/llvm-12/lib
 clang: warning: -Wl,-rpath,/opt/local/libexec/llvm-12/lib: 'linker' input
 unused [-Wunused-command-line-argument]
 clang: warning: argument unused during compilation:
 '-L/opt/local/libexec/llvm-12/lib' [-Wunused-command-line-argument]

 }}}

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


More information about the macports-tickets mailing list