Opened 10 months ago

Closed 8 months ago

Last modified 8 months ago

#69189 closed defect (fixed)

macports-libcxx does not install universal libraries on Intel

Reported by: barracuda156 Owned by: nobody
Priority: Normal Milestone:
Component: ports Version: 2.9.0
Keywords: x86_64, i386 Cc: catap (Kirill A. Korinsky), mascguy (Christopher Nielsen)
Port: macports-libcxx

Description

Well, the port in its present for is just unusable. I tried to build gtest as +universal on 10.6.8 (Xcode 4.2), it failed to link:

[ 16%] Building CXX object googletest/CMakeFiles/gtest_main.dir/src/gtest_main.cc.o
cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_gtest/gtest/work/build/googletest && /opt/local/bin/clang++-mp-11  -isystem /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_gtest/gtest/work/googletest-1.14.0/googletest/include -isystem /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_gtest/gtest/work/googletest-1.14.0/googletest -pipe -g -DNDEBUG -isystem/opt/local/include/libcxx/v1 -nostdinc++ -isystem/opt/local/include/LegacySupport -stdlib=libc++ -arch x86_64 -arch i386 -mmacosx-version-min=10.6 -Wall -Wshadow -Wconversion -Wundef -DGTEST_HAS_PTHREAD=1 -fexceptions -W -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wunused-parameter -Wcast-align -Winline -Wredundant-decls -Wchar-subscripts -std=c++14 -MD -MT googletest/CMakeFiles/gtest_main.dir/src/gtest_main.cc.o -MF CMakeFiles/gtest_main.dir/src/gtest_main.cc.o.d -o CMakeFiles/gtest_main.dir/src/gtest_main.cc.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_gtest/gtest/work/googletest-1.14.0/googletest/src/gtest_main.cc
clang: warning: argument unused during compilation: '-nostdinc++' [-Wunused-command-line-argument]
ld: warning: ignoring file /opt/local/lib/libcxx/libc++.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
Undefined symbols for architecture i386:
  "std::nothrow", referenced from:
      std::__1::pair<testing::TestInfo**, int> std::__1::get_temporary_buffer<testing::TestInfo*>(int) in gtest-all.cc.o

Notice:

/opt/local/lib/libcxx/libc++.dylib, file was built for unsupported file format which is not the architecture being linked (i386)

Checking that, indeed:

10:~ svacchanda$ port provides /opt/local/lib/libcxx/libc++.dylib
/opt/local/lib/libcxx/libc++.dylib is provided by: macports-libcxx
10:~ svacchanda$ file /opt/local/lib/libcxx/libc++.dylib
/opt/local/lib/libcxx/libc++.dylib: Mach-O 64-bit dynamically linked shared library x86_64

However, it is supposed to be universal:

10:~ svacchanda$ port -v installed macports-libcxx
The following ports are currently installed:
  macports-libcxx @11.1.0_0 requested_variants='' platform='darwin 10' archs='x86_64' date='2023-11-08T05:22:47+0800'
  macports-libcxx @11.1.0_0+universal (active) requested_variants='+universal' platform='darwin 10' archs='i386 x86_64' date='2024-01-26T03:23:04+0800'

macports.conf has x86_64 i386 for universal_archs, nothing exotic.

Change History (4)

comment:1 Changed 10 months ago by kencu (Ken)

Owner: changed from kencu to nobody

comment:2 Changed 8 months ago by mascguy (Christopher Nielsen)

Cc: mascguy added

comment:3 Changed 8 months ago by kencu (Ken)

Resolution: fixed
Status: assignedclosed

In 46b32e2969e2db44495737a9233bf9d99a961089/macports-ports (master):

macports-libcxx: clear configure.compiler so universal is respected

on certain systems.

before:
DEBUG: Starting logging for macports-libcxx @11.1.0_0+universal
DEBUG: Mac OS X 10.6.8 (darwin/10.8.0) arch i386
DEBUG: MacPorts 2.9.1
DEBUG: Xcode 3.2.6, CLT 1.0.0.9000000000.1.1248867338
DEBUG: SDK 10.6
DEBUG: MACOSX_DEPLOYMENT_TARGET: 10.6
DEBUG: epoch: in tree: 0 installed: 0
DEBUG: clang-11 11.1.0_7 exists in the ports tree
DEBUG: clang-11 11.1.0_7 +defaultlibcxx+emulated_tls is the latest installed
DEBUG: clang-11 11.1.0_7 +defaultlibcxx+emulated_tls is active
DEBUG: Merging existing requested variants into variants
DEBUG: new fully merged portvariants:
DEBUG: Opening port in directory: /opt/macportsofficial/macports-ports/lang/llvm-11

after:
DEBUG: Starting logging for macports-libcxx @11.1.0_0+universal
DEBUG: Mac OS X 10.6.8 (darwin/10.8.0) arch i386
DEBUG: MacPorts 2.9.1
DEBUG: Xcode 3.2.6, CLT 1.0.0.9000000000.1.1248867338
DEBUG: SDK 10.6
DEBUG: MACOSX_DEPLOYMENT_TARGET: 10.6
DEBUG: enforcing +universal upgrade for clang-11
DEBUG: epoch: in tree: 0 installed: 0
DEBUG: clang-11 11.1.0_7 exists in the ports tree
DEBUG: clang-11 11.1.0_7 +defaultlibcxx+emulated_tls is the latest installed
DEBUG: clang-11 11.1.0_7 +defaultlibcxx+emulated_tls is active
DEBUG: Merging existing requested variants into variants
DEBUG: new fully merged portvariants: universal +
DEBUG: Opening port in directory: /opt/macportsofficial/macports-ports/lang/llvm-11
D

This port builds by copying files from an installed clang compiler.
If it so happens that the default configure.compiler is the same as the
clang compiler to be used during the installation, macports-base will have
added a depends.skip_archcheck on the designated compiler, and so a universal
variant will be ignored.

see: https://github.com/macports/macports-ports/pull/23230
closes: #69189

This fix is all @jmroot, who spotted this issue right off.

comment:4 in reply to:  3 Changed 8 months ago by barracuda156

Replying to kencu:

Awesome, thank you!

Note: See TracTickets for help on using tickets.