Opened 15 months ago

Last modified 12 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)

gdb-13.1-main.log (652.8 KB) - added by tcwan (TC Wan) 15 months ago.
Build log of gdb +mulitarch for 13,1

Download all attachments as: .zip

Change History (7)

Changed 15 months ago by tcwan (TC Wan)

Attachment: gdb-13.1-main.log added

Build log of gdb +mulitarch for 13,1

comment:1 Changed 15 months ago by tcwan (TC Wan)

I realize that the gdb version built on Apple Silicon Macs will be x86. 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.

Version 1, edited 15 months ago by tcwan (TC Wan) (previous) (next) (diff)

comment:2 in reply to:  1 Changed 15 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 15 months ago by ryandesign (Ryan Carsten Schmidt)

Summary: Build of gdb 13.1 on Mac Mini M2 with Ventura 13.4 failsgdb @13.1: opportunistic use of zstd

comment:4 Changed 15 months ago by kencu (Ken)

gcc started using zstd last year, so no surprise gdb uses it now too…

comment:5 Changed 12 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
Last edited 12 months ago by tcwan (TC Wan) (previous) (diff)

comment:6 Changed 12 months ago by tcwan (TC Wan)

I had to add 'xxhashlib +unviersal' to fix the build.

Note: See TracTickets for help on using tickets.