Opened 17 months ago
Last modified 14 months ago
#67671 new defect
gdb @13.1: opportunistic use of zstd
Reported by: | tcwan (TC Wan) | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.8.1 |
Keywords: | Cc: | ||
Port: | gdb |
Description
When attempting to build gdb +multiarch 13.1 on Apple M2 Mac Mini running Ventura 13.4, the build with fail. The build succeeded on Apple iMac with Intel processor running Monterey 12.6.7.
The previous version gdb +multiarch 12.1 can be built successfully on Apple M2 Mac Mini.
Attachments (1)
Change History (7)
Changed 17 months ago by tcwan (TC Wan)
Attachment: | gdb-13.1-main.log added |
---|
comment:1 follow-up: 2 Changed 17 months ago by tcwan (TC Wan)
I realize that the gdb version built on Apple Silicon Macs will be x86_64. However, the failure stems from:
:info:build ld: warning: ignoring file /opt/local/lib/libzstd.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
Fix: I had to force uninstall zstd, and
$ sudo port install zstd +universal
After that gdb 13.1 can be built. The portfile should be updated to reflect the dependency on zstd +universal
Edit 2: It might be necessary to flag all dependencies as requiring +universal for arm64 platform. Some of the dependencies were rebuilt as universal previously due to enabling gdb+multiarch+python310, which triggered rebuilds of some dependent libraries by the python rebuild.
comment:2 Changed 17 months ago by ryandesign (Ryan Carsten Schmidt)
Replying to tcwan:
The portfile should be updated to reflect the dependency on zstd +universal
Only a dependency on zstd needs to be added to gdb. (Or gdb needs to be told not to use zstd even if it is installed.)
MacPorts will automatically handle rebuilding dependencies universal if that is needed.
There is no way in MacPorts to declare a dependency on a variant of another port. See #126.
comment:3 Changed 17 months ago by ryandesign (Ryan Carsten Schmidt)
Summary: | Build of gdb 13.1 on Mac Mini M2 with Ventura 13.4 fails → gdb @13.1: opportunistic use of zstd |
---|
comment:4 Changed 17 months ago by kencu (Ken)
gcc started using zstd last year, so no surprise gdb uses it now too…
comment:5 Changed 14 months ago by tcwan (TC Wan)
Now I'm getting the following error when building gdb 13.1 on M2 Mini macOS Ventura 13.6, gdb +multiarch +python311
:info:build CXXLD gdb :info:build ld: warning: ignoring file /opt/local/lib/libxxhash.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64 :info:build Undefined symbols for architecture x86_64: :info:build "_XXH64", referenced from: :info:build gdb::bcache::hash(void const*, int) in bcache.o :info:build minimal_symbol_reader::install()::$_0::operator()(minimal_symbol*, minimal_symbol*) const in minsyms.o :info:build psymbol_bcache::hash(void const*, int) in psymtab.o :info:build hashname(char const*) in stabsread.o :info:build common_block_end(objfile*) in stabsread.o :info:build scan_file_globals(objfile*) in stabsread.o :info:build general_symbol_info::compute_and_set_names(gdb::basic_string_view<char, std::__1::char_traits<char>>, bool, objfile_per_bfd_storage*, gdb::optional<unsigned int>) in symtab.o :info:build ... :info:build ld: symbol(s) not found for architecture x86_64 :info:build clang: error: linker command failed with exit code 1 (use -v to see invocation)
% port echo installed|fgrep xxhashlib xxhashlib @0.8.2_3
comment:6 Changed 14 months ago by tcwan (TC Wan)
I had to add 'xxhashlib +unviersal' to fix the build.
Build log of gdb +mulitarch for 13,1