[MacPorts] #70683: db62 @6.2.32+universal: x86_64 symbols omitted from libdb_cxx.dylib

MacPorts noreply at macports.org
Thu Sep 5 16:22:00 UTC 2024


#70683: db62 @6.2.32+universal: x86_64 symbols omitted from libdb_cxx.dylib
-----------------------+--------------------
 Reporter:  gfiumara   |      Owner:  (none)
     Type:  defect     |     Status:  new
 Priority:  Normal     |  Milestone:
Component:  ports      |    Version:
 Keywords:  universal  |       Port:  db62
-----------------------+--------------------
 Although seemingly a universal library, `libdb_cxx.dylib` appears to not
 have any x86_64 symbols when built on an ARM Mac.

 {{{
 $ file /opt/local/lib/db62/libdb_cxx.dylib
 /opt/local/lib/db62/libdb_cxx.dylib: Mach-O universal binary with 2
 architectures: [x86_64:Mach-O 64-bit dynamically linked shared library
 x86_64] [arm64:Mach-O 64-bit dynamically linked shared library arm64]
 /opt/local/lib/db62/libdb_cxx.dylib (for architecture x86_64):  Mach-O
 64-bit dynamically linked shared library x86_64
 /opt/local/lib/db62/libdb_cxx.dylib (for architecture arm64):   Mach-O
 64-bit dynamically linked shared library arm64

 $ lipo -archs /opt/local/lib/db62/libdb_cxx.dylib
 x86_64 arm64

 $ nm -arch x86_64  /opt/local/lib/db62/libdb_cxx.dylib
 /opt/local/lib/db62/libdb_cxx.dylib: no symbols
 }}}

 This is not the case for the static library.

 {{{
 $ nm -x -arch x86_64 /opt/local/lib/db62/libdb_cxx.a | grep -m 1 DbEnv
 0000000000000000 01 00 0000 0000015f __ZN5DbEnv13runtime_errorEPS_PKcii

 $ nm -x -arch arm64 /opt/local/lib/db62/libdb_cxx.a | grep -m 1 DbEnv
 0000000000000000 01 00 0000 00000166 __ZN5DbEnv13runtime_errorEPS_PKcii
 }}}

 Attaching minimal example that exercises C++ API for BerkeleyDB, which
 will have both sets of symbols. Compile with the following, and uncomment
 the CMakeLists.txt line to force the static lib over the missing symbol
 dynamic lib.

 {{{
 mkdir build
 cd build
 CMAKE_OSX_ARCHITECTURES="x86_64;arm64" cmake ..
 make
 }}}

 Tested on macOS 14.6.1 (23G93), MacPorts 2.10.1, Apple M1 Max CPU

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


More information about the macports-tickets mailing list