[MacPorts] #63261: cmake @3.20.5_1: rpath error when linking any project on 10.4

MacPorts noreply at macports.org
Mon Jul 19 02:27:51 UTC 2021


#63261: cmake @3.20.5_1: rpath error when linking any project on 10.4
------------------------+-----------------------
 Reporter:  evanmiller  |      Owner:  michaelld
     Type:  defect      |     Status:  assigned
 Priority:  Normal      |  Milestone:
Component:  ports       |    Version:  2.7.1
 Keywords:              |       Port:  cmake
------------------------+-----------------------
 The [https://cmake.org/cmake/help/latest/release/3.20.html#id2 CMake
 3.20.1 notes] indicate:

 > The -rpath linker flag is now specified as supported on all Apple
 platforms, not just macOS. The install_name_dir used for iOS, tvOS and
 watchOS should now default to @rpath instead of using a full absolute path
 and failing at runtime when the library or framework is embedded in an
 application bundle (see XCODE_EMBED_<type>).

 Unfortunately {{{-rpath}}} is not supported on 10.4, and so linking any
 project using CMake 3.20.5 fails with an error such as:

 {{{
 :info:build [ 86%] Linking CXX executable fish_key_reader
 :info:build /opt/local/bin/cmake -E cmake_link_script
 CMakeFiles/fish_key_reader.dir/link.txt --verbose=ON
 :info:build /opt/local/bin/g++-mp-7 -pipe -Os -D__DARWIN_UNIX03 -DNDEBUG
 -I/opt/local/include -I/opt/local/include/LegacySupport
 -D_GLIBCXX_USE_CXX11_ABI=0 -Wall -Wextra -Wno-comment -Wno-address  -arch
 ppc -mmacosx-version-min=10.4 -Wl,-search_paths_first
 -Wl,-headerpad_max_install_names -L/opt/local/lib
 -Wl,-headerpad_max_install_names -lMacportsLegacySupport
 CMakeFiles/fish_key_reader.dir/src/fish_key_reader.cpp.o
 CMakeFiles/fish_key_reader.dir/src/print_help.cpp.o -o fish_key_reader
 -Wl,-rpath,/opt/local/lib libfishlib.a /opt/local/lib/libcurses.dylib
 /opt/local/lib/libpcre2-32.dylib /opt/local/lib/libintl.dylib -latomic
 :info:build ld: -rpath can only be used when targeting Mac OS X 10.5 or
 later
 :info:build collect2: error: ld returned 1 exit status
 }}}

 Reverting to @3.19.8_0 fixes the issue on my system.

-- 
Ticket URL: <https://trac.macports.org/ticket/63261>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list