Skip to content

makefile: let it build dump_syms_mac on other architectures than x86 - #41

Merged
illwieckz merged 1 commit into
masterfrom
illwieckz/macos-more-than-x86
Oct 12, 2026
Merged

illwieckz merged 1 commit into
masterfrom
illwieckz/macos-more-than-x86

Conversation

@illwieckz

Copy link
Copy Markdown
Member

Let it build dump_syms_mac on other architectures than x86.

It builds ans runs properly on linux-arm64.

Picked from:


As far as I know it also cross-builds properly from linux to windows-arm64 and runs properly on windows-arm64. It probably builds one Windows too, but the makefile currently only allows the build on linux.

It doesn't build (whatever the architecture) on macos, while it was meant to be (this source had been explicitly converted from Objective C to C++ by some Mozilla people in the past on that purpose).

So instead of doing a temporary if linux and windows (which requires an autoreconf change), I will likely investigate the fixing of the macos build so we would remove all system restrictions instead, once for all.

Doing that is outside the scope of this PR.

@illwieckz

Copy link
Copy Markdown
Member Author

Here are some symbolization runs of macos-amd64 and macos-arm64 binary samples on an Orange Pi 5 board sporting some Cortex-A76 and running a Debian Bookworm-based ArmBian:

illwieckz@orangepi5:breakpad$ ./src/tools/mac/dump_syms/dump_syms_mac tests/test-math_macos10.12-amd64-appleclang21-dynamic 
MODULE mac x86_64 BA0CCAD8245E4283B63CB8209188A8A30 test-math_macos10.12-amd64-appleclang21-dynamic
FUNC 5a0 70 0 __Z18calculate_identityd
FUNC 610 60 0 __Z18calculate_distancedddd
FUNC 670 30 0 __Z12print_resultPKcd
FUNC 6a0 170 0 _main
FUNC 810 30 0 __ZNSt3__16__math3powB9nqe210106IdiLi0EEEDTcmcvNS_9enable_ifIXaasr13is_arithmeticIT_EE5valuesr13is_arithmeticIT0_EE5valueEvE4typeELi0Eplclsr3stdE14__promote_implcvS3__EEclsr3stdE14__promote_implcvS4__EEES3_S4_
FUNC 840 27 0 __ZNSt3__16__math3powB9nqe210106IiEEddd
PUBLIC 0 0 _mh_execute_header
PUBLIC 1028 0 _dyld_private
illwieckz@orangepi5:breakpad$ ./src/tools/mac/dump_syms/dump_syms_mac tests/test-math_macos11.7-arm64-appleclang21-dynamic 
MODULE mac arm64 706477065B5E41F6AC5083C74103AC230 test-math_macos11.7-arm64-appleclang21-dynamic
FUNC 5b8 60 0 __Z18calculate_identityd
FUNC 618 58 0 __Z18calculate_distancedddd
FUNC 670 40 0 __Z12print_resultPKcd
FUNC 6b0 150 0 _main
FUNC 800 38 0 __ZNSt3__16__math3powB9nqe210106IdiLi0EEEDTcmcvNS_9enable_ifIXaasr13is_arithmeticIT_EE5valuesr13is_arithmeticIT0_EE5valueEvE4typeELi0Eplclsr3stdE14__promote_implcvS3__EEclsr3stdE14__promote_implcvS4__EEES3_S4_
FUNC 838 1c 0 __ZNSt3__16__math3powB9nqe210106IiEEddd
PUBLIC 0 0 _mh_execute_header
PUBLIC 8020 0 _dyld_private

@slipher

slipher commented Oct 12, 2026

Copy link
Copy Markdown
Member

LGTM I guess

Of course we never implemented Breakpad for Mac, so I haven't tested dump_syms_mac.

@illwieckz

Copy link
Copy Markdown
Member Author

Thanks for the review. It's funny that the Makefile doesn't build dump_syms_mac on macOS to begin with (and that if we enable it, the build fails).

This commit is funny: 8079ae1

Author: Ted Mielczarek
Date:   Wed Sep 16 06:46:55 2015 -0400

    Fix Mac Breakpad host tools to build in Linux cross-compile
    
    We're working on building our Firefox Mac builds as a Linux cross-compile
    (https://bugzilla.mozilla.org/show_bug.cgi?id=921040) and we need symbol
    dumping to work. This change ports the Mac dump_syms tool to build and work
    on Linux. I've tested it and it produces identical output to running the
    tool on Mac.
    
    The bulk of the work here was converting src/common/mac/dump_syms.mm and
    src/tools/mac/dump_syms/dump_syms_tool.mm from ObjC++ to C++ and removing
    their use of Foundation classes in favor of standard C/C++.
    
    This won't compile out-of-the-box on Linux, it requires some Mac system
    headers that are not included in this patch. I have those tentatively in
    a separate patch to land in Gecko
    (http://hg.mozilla.org/users/tmielczarek_mozilla.com/mc/rev/5fb8da23c83c),
    but I wasn't sure if you'd be interested in having them in the Breakpad tree.
    We could almost certainly pare down the set of headers included there, I
    didn't spend too much time trying to minimize them (we primarily just need
    the Mach-O structs and a few associated bits).
    
    I just realized that this patch is missing updating the XCode project files
    (ugh). I'll fix that up in a bit.

It was previously a macOS-only binary, then made to be running on both Linux and macOS, and now that is macOS that is broken… I will probably fix that by the way.

@illwieckz
illwieckz merged commit 38c7def into master Oct 12, 2026
@illwieckz
illwieckz deleted the illwieckz/macos-more-than-x86 branch October 12, 2026 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants