Re: Building "Fat" Mac Binary, or Cross-Compiling from ARM arch to x86-64

Viktor Dukhovni <[email protected]>
Newsgroups gmane.comp.encryption.openssl.user
Message-ID <[email protected]>
On Thu, Jan 02, 2025 at 12:24:42PM -0500, Nick wrote:

> The compiler successfully creates "fat" mac binaries which contain both
> the arm64 and x64 binaries for other open source projects, as well as my
> own code.  I accomplish this by passing "-arch x86_64 -arch arm64" to
> the relevant compiler flags (CFLAGS for the open source projects).

Unfortunately, that can't trivially work for OpenSSL, because
architecture-specific assembly targets are included in the build.  You'd
need to build *both* the ARM *and* X86_64 assembly targets, invoking the
appropriate assembler on each one, and producing either object code for
that particular platform for inclusion in the "fat" binary, or somehow
producting a "fat" objec that is "empty" for one of the targets.

How to do that, requires more detailed knowledge of fat binaries than I
can muster.

> I'm trying to do the same for OpenSSL v1.1.1w, but I get the following
> error:
> 
>    crypto/arm_arch.h:55:6: error: "unsupported ARM architecture"
> 
> Even if I try to build OpenSSL only for x64 (by passing CFLAGS=-arch
> x86_64), the OpenSSL compile sets both "-arch arm64 -arch x86_64".  Note
> the order of these params is the opposite from what I pass, so tells me
> something in the configuration script is setting these.
> 
> If I pass no params for CFLAGS, OpenSSL builds successfully, but for
> only ARM64.
> 
> If this issue is already fixed in a newer version of OpenSSL I'm fine
> to upgrade.

I don't expect this is supported or "fixed".

-- 
    Viktor.

-- 
You received this message because you are subscribed to the Google Groups "openssl-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openssl-users+unsubscribe-MCmKBN63+Bmbup2nOX2J7Q@public.gmane.org
To view this discussion visit https://groups.google.com/a/openssl.org/d/msgid/openssl-users/Z3cMP-70yPMV8JuO%40chardros.imrryr.org.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.