Ask Your Question
0

How do you build wireshark for Apple silicon (arm64) on an Intel Mac?

asked 2023-01-12 01:22:01 +0000

mbuc gravatar image

What are the commands to configure/make a wireshark dmg package for Apple silicon Macs from an Intel Mac? The Wireshark Developer's Guide (version 4.1.0) doesn't specify how.

I need to build and deploy wireshark with custom dissectors for both Intel and ARM Macs but I only have an Intel Mac to use as a build machine.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-01-12 03:40:17 +0000

Guy Harris gravatar image

There isn't one.

The first thing you'd need would be ARM64 versions of the libraries that Wireshark requires.

If you're building and installing support libraries from source, using the tools/macos-setup.sh script, you'd have to be able to do a cross-build of them, and I don't know whether they'd all support that with, for example, CFLAGS forced to include -arch arm64 - I think GLib, for example, might not do a very good job of handling cross-builds (it couldn't be convinced to do a universal build, back in the days when we supported both PowerPC and x86 builds, and couldn't do 32-bit/64-bit universal, either).

If you're installing them from Homebrew, that might be tricky as well, as Apple doesn't support cross-builds by having a separate set of header and library directories, it supports them by having headers that test the target processor with '#if' when necessary and having universal libraries. I don't think Homebrew does universal binaries - perhaps because the code they're packaging doesn't support them - so you might have to use lipo to glue together the x86-64 and ARM64 library binaries into a universal binary.

Once you've done that, you might be able to run CMake with CFLAGS=-arch arm64 and LDFLAGS=-arch arm64 to do a cross build. However, that might cause it to build tools such as Lemon as ARM64 binaries, which means those tools will fail when run as part of the build process.

If you have universal libraries, you might as well run CMake with CFLAGS=-arch x86_64 -arch arm64 and LDFLAGS=-arch x86_64 -arch arm64 and build universal binaries. That will avoid the tools problem and give you a Wireshark dmg that will install and run either on x86-64 or ARM64 Macs.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2023-01-12 01:22:01 +0000

Seen: 271 times

Last updated: Jan 12