Opened 3 years ago

Closed 3 years ago

#62198 closed defect (fixed)

libgcrypt: @1.9.1 fails to build +universal

Reported by: Gcenx Owned by: Schamschula (Marius Schamschula)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: ryandesign (Ryan Carsten Schmidt)
Port: libgcrypt

Description

Got the following problem when trying to upgrade from 1.9.0 to 1.9.1

:info:build libtool: compile:  /usr/b
in/clang -DHAVE_CONFIG_H -I. -I.. -I../src -I../src -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.13.sdk -pipe -Os -std=gnu89 -fheinous-gnu-extensions -arch i386 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.13.sdk -MT mpih-add1-asm.lo -MD -MP -MF .deps/mpih-add1-asm.Tpo -c mpih-add1-asm.S  -fno-common -DPIC -o .libs/mpih-add1-asm.o
:info:build mpih-add1-asm.S:47:8: error: register %rsi is only available in 64-bit mode
:info:build  leaq (%rsi,%rcx,8), %rsi
:info:build        ^~~~
:info:build mpih-add1-asm.S:48:8: error: register %rdi is only available in 64-bit mode
:info:build  leaq (%rdi,%rcx,8), %rdi
:info:build        ^~~~
:info:build mpih-add1-asm.S:49:8: error: register %rdx is only available in 64-bit mode
:info:build  leaq (%rdx,%rcx,8), %rdx
:info:build        ^~~~
:info:build mpih-add1-asm.S:50:7: error: register %rcx is only available in 64-bit mode
:info:build  negq %rcx
:info:build       ^~~~
:info:build mpih-add1-asm.S:54:14: error: register %rsi is only available in 64-bit mode
:info:build .Loop: movq (%rsi,%rcx,8), %rax
:info:build              ^~~~
:info:build mpih-add1-asm.S:55:8: error: register %rdx is only available in 64-bit mode
:info:build  movq (%rdx,%rcx,8), %r10
:info:build        ^~~~
:info:build mpih-add1-asm.S:56:7: error: register %r10 is only available in 64-bit mode
:info:build  adcq %r10, %rax
:info:build       ^~~~
:info:build mpih-add1-asm.S:57:7: error: register %rax is only available in 64-bit mode
:info:build  movq %rax, (%rdi,%rcx,8)
:info:build       ^~~~
:info:build mpih-add1-asm.S:58:7: error: register %rcx is only available in 64-bit mode
:info:build  incq %rcx
:info:build       ^~~~
:info:build mpih-add1-asm.S:61:7: error: register %rcx is only available in 64-bit mode
:info:build  movq %rcx, %rax
:info:build       ^~~~
:info:build mpih-add1-asm.S:62:7: error: register %rax is only available in 64-bit mode
:info:build  adcq %rax, %rax
:info:build       ^~~~
:info:build make[2]: *** [mpih-add1-asm.lo] Error 1
:info:build make[2]: *** Waiting for unfinished jobs....

Uninstalling and clean installing libgcrypt 1.9.0 +universal I have no issues.

Attachments (2)

main.log (327.5 KB) - added by Gcenx 3 years ago.
0001-libgcrypt-Fix-i386-x86_64-universal-build.patch (1.2 KB) - added by Gcenx 3 years ago.
Here's a patch that fixes the issue on my system

Download all attachments as: .zip

Change History (20)

Changed 3 years ago by Gcenx

Attachment: main.log added

comment:1 Changed 3 years ago by Schamschula (Marius Schamschula)

Owner: set to Schamschula
Status: newassigned

I have little experience with building +universal. Since you are building under macOS 13, universal means 32bit and 64bit.

comment:2 in reply to:  1 Changed 3 years ago by Gcenx

Replying to Schamschula:

I have little experience with building +universal. Since you are building under macOS 13, universal means 32bit and 64bit.

Yes that's correct, I'm forcing the 10.13.sdk and 10.13 deployment target to allow +universal on Mojave (32Bit & 64Bit), the previous version 1.9.0 builds without issue just this update fails.

comment:3 Changed 3 years ago by Schamschula (Marius Schamschula)

The reason may be the fact that I had tor remove --disable-asm to get build 1.9.1 to build. This is an upstream change.

Version 0, edited 3 years ago by Schamschula (Marius Schamschula) (next)

comment:4 Changed 3 years ago by mf2k (Frank Schima)

Cc: Schamschula removed

comment:5 Changed 3 years ago by michaellass (Michael Lass)

Here is the upstream bug report: https://dev.gnupg.org/T5277

It has been added to the 1.9.2 tracking ticket, so let's hope this will get fixed in the next minor version.

Changed 3 years ago by Gcenx

Here's a patch that fixes the issue on my system

comment:6 Changed 3 years ago by Schamschula (Marius Schamschula)

I think we need to deal with universal builds x86_64 + arm64 as well.

comment:7 Changed 3 years ago by Gcenx

I haven’t touched +universal on my M1 Mac Mini yet so though it was best to just attach a patch here to show that’s working.

comment:8 Changed 3 years ago by kencu (Ken)

We have some work to do with this. On BigSur Intel, you can't build libgcrypt +universal unless you first build libgpg-error +universal.

And you can't build libgpg-error +universal on a BigSur intel machine, because is says "merger_must_run_binaries", and it can't run arm64 binaries on BigSur intel.

The port info is confusing:

If you just do a port info, it claims there is a universal variant:

% port info libgpg-error
libgpg-error @1.41 (devel)
Variants:             universal

Description:          libgpg-error is a library that defines common error values for all GnuPG components. Among
                      these are GPG, GPGSM, GPGME, GPG-Agent, libgcrypt, pinentry, SmartCard Daemon and possibly more
                      in the future.
Homepage:             https://www.gnupg.org/

Library Dependencies: libiconv, gettext
Platforms:            darwin
License:              LGPL-2.1+
Maintainers:          Email: mps@macports.org, GitHub: Schamschula
                      Policy: openmaintainer

but there really isn't, and you only see that when you try this (note - no universal variant):

% port info libgpg-error +universal
libgpg-error @1.41 (devel)

Description:          libgpg-error is a library that defines common error values for all GnuPG components. Among
                      these are GPG, GPGSM, GPGME, GPG-Agent, libgcrypt, pinentry, SmartCard Daemon and possibly more
                      in the future.
Homepage:             https://www.gnupg.org/

Library Dependencies: libiconv, gettext
Platforms:            darwin
License:              LGPL-2.1+
Maintainers:          Email: mps@macports.org, GitHub: Schamschula
                      Policy: openmaintainer

and that happens, I guess, because it's not really sorted out whether there is or there isn't a universal variant until you enable the universal variant and do a port info.

Which I guess is a small enough trick so as not to confuse people too much.

comment:9 in reply to:  8 Changed 3 years ago by jmroot (Joshua Root)

Replying to kencu:

If you just do a port info, it claims there is a universal variant: […] but there really isn't, and you only see that when you try this (note - no universal variant): […] and that happens, I guess, because it's not really sorted out whether there is or there isn't a universal variant until you enable the universal variant and do a port info.

That's because it only sets merger_must_run_binaries if the universal variant is set. Moving that outside the if statement would fix it.

comment:10 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign added

comment:11 Changed 3 years ago by kencu (Ken)

gotcha.

I see all the work you've been doing fine-tuning universal builds recently -- thank you!

comment:12 Changed 3 years ago by Schamschula (Marius Schamschula)

comment:13 Changed 3 years ago by epavlica

Hello, I found this ticket because I need to build xmlsec +universal, which requires libgcrypt, which requires libgpg-error, which cannot be build for +universal. Is there maybe a solution to build it on intel so far? Can I help somehow? I can also try to use m1 computer. Will libgpg-error be build on m1 computer (same system)? My system: macOS Big Sur 11.2.3, port version 2.6.4, intel.

Thanks, Egon

comment:14 Changed 3 years ago by Schamschula (Marius Schamschula)

You may be seeing a different issue than the original poster. I your case the +universal is x86_64 and arm64.

comment:15 in reply to:  14 Changed 3 years ago by epavlica

Replying to Schamschula:

You may be seeing a different issue than the original poster. I your case the +universal is x86_64 and arm64.

That is correct. Should I submit a new ticket?

comment:16 Changed 3 years ago by Schamschula (Marius Schamschula)

Yes!

Don't forget to attach the main log.

comment:17 Changed 3 years ago by Gcenx

From 1.9.2 building for +universal (i386 & x86_64) is no longer an issue.

port installed libgcrypt
The following ports are currently installed:
  libgcrypt @1.9.2_0+universal
  libgcrypt @1.9.3_0+universal

comment:18 Changed 3 years ago by Schamschula (Marius Schamschula)

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.