Compiling static ARM64 binary for Darwin (macOS)? #1596
Replies: 3 comments
-
I don't have a solution for you, but I confirm the same behavior using the normal Xcode C compiler on an Intel Mac (MacBookPro16,1 and macOS 14.1.1). I'm a little surprised this doesn't work. |
Beta Was this translation helpful? Give feedback.
-
While it might be possible to create static binaries on macOS in theory, in practice it's deliberately NOT supported by Apple. |
Beta Was this translation helpful? Give feedback.
-
Maybe I've got my terminology wrong, but my question is really: is it possible to create a binary for macOS using the latest 3.16 code such that a single monolithic file is all that's needed to run the program? Similar to the ancient 3.1.3 version that's currently listed at iperf.fr |
Beta Was this translation helpful? Give feedback.
-
Is it possible to compile a static binary of iperf3 3.15 for macOS ARM64? I'd like to be able to have a portable binary that I can drop onto a machine with just a single file.
When I downloaded the source and ran
./configure; make
I ended up with a shell wrapper script around a directory full of library files.I read the FAQ but trying to execute
./configure --enable-static-bin
or./configure "LDFLAGS=--static" --disable-shared
on my M1 system resulted inconfig.log excerpt:
I have the latest Xcode, CLT and gcc installed via Homebrew
I also tried putting gcc-13 in my
$PATH
before/usr/bin/gcc
to ensure that the build script used that, by adding a symlink:(No change)
stuck! 🤷♂️
Beta Was this translation helpful? Give feedback.
All reactions