Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nettle7 fix for Apple Silicon #952

Closed
TheSin- opened this issue Jan 24, 2023 · 19 comments
Closed

nettle7 fix for Apple Silicon #952

TheSin- opened this issue Jan 24, 2023 · 19 comments
Assignees
Labels
arm64 Build issues and fixes for Apple Silicon

Comments

@TheSin-
Copy link
Member

TheSin- commented Jan 24, 2023

Just needs UpdateConfigGuess: true

That's all.

@sth0
Copy link
Contributor

sth0 commented Jan 25, 2023

so does nettle8 and libid3tag. I can't get my GitHub version to sync with the master and submit a PR. But these additions fix all three packages to build on Apple Silicon.

@TheSin-
Copy link
Member Author

TheSin- commented Jan 25, 2023

nettle7 works fine on Apple Silicon, I even built gnutls3 with it just fine. Not saying we shouldn't update, but it's not required to support Apple Silicon is all.

Trying to fix db53 and db60 for Apple Silicon is way more important IMHO cause of the depth of depends is has and it's all Mutex issues.

@sth0
Copy link
Contributor

sth0 commented Jan 25, 2023

It did not build for me on Apple Silicon. Both nettle7 and nettle8 failed until I edited the dot-info files. They were complaining about an unknown architecture. What updated config.guess? Is that autoconf? Do you have a different version of autoconf than I do? I can't think of what the difference would be.

Since UpdateConfigGuess: True worked for builiding the libid3tags package when it complained about an architecture problem I tried it with the nettle series.

@TheSin-
Copy link
Member Author

TheSin- commented Jan 25, 2023

you have to be using my PR and make sure it's up to date. UpdateConfigGuess is a fink info file param, it updates the config.guess and config.sub commands in the build so that it returns aarch64-apple-darwin22.x

That's the only change I made the nettle7 and it works perfectly.

@TheSin-
Copy link
Member Author

TheSin- commented Jan 25, 2023

@nieder are you okay if I commit this? My M2 is in today and I'd like to be able to install gnupg2 and git right away on it

@TheSin- TheSin- added the arm64 Build issues and fixes for Apple Silicon label Jan 25, 2023
@TheSin-
Copy link
Member Author

TheSin- commented Jan 26, 2023

@nieder I'm not sure if you had time to look at this, but I'd really like to add it today, as I want to get python27 updated so I can switch to my new laptop which I can't do without gnupg2 and git for commits ;)

@nieder
Copy link
Member

nieder commented Jan 27, 2023

Sorry about the delay. If I add UpdateConfigGuess: true on 10.14.6 using not-dpkg1.16, the build fails:

/sw/bin/m4 ./asm.m4 machine.m4 config.m4 aes-encrypt-internal.asm >aes-encrypt-internal.s
aes-decrypt-internal.s:66:2: error: instruction requires: Not 64-bit mode
 pushl %ebx
 ^
aes-decrypt-internal.s:67:2: error: instruction requires: Not 64-bit mode

and many more like it.

@nieder
Copy link
Member

nieder commented Jan 27, 2023

Would running autoreconf -vfi work instead of using UpdateConfigGuess ?

@TheSin-
Copy link
Member Author

TheSin- commented Jan 27, 2023

Well that sucks, I assume the old fink update.guess is too old?? I can't test now till Monday, which really sucks cause I really wanted to get my new system setup for Monday :(

@dhomeier
Copy link
Contributor

Would running autoreconf -vfi work instead of using UpdateConfigGuess ?

Identifies as arm-apple-darwin22.3.0, which pulls in various unsupported assembly code.
Adding

 	("%m" = "arm64") --host=aarch64-apple-darwin`uname -r` 

to ConfigureParams works without any further changes
(--host=%m-apple-darwinuname -r is not supported and fails to build even after patching config.sub).

@TheSin-
Copy link
Member Author

TheSin- commented Jan 27, 2023

sadly as ugly as it is, it might be the best option

@nieder
Copy link
Member

nieder commented Jan 27, 2023

I'm OK with an arm64 conditional like that added to %c and whatever string is needed to satisfy it. Don't put it as the last line of ConfigureParams because it'll break ./configure for not-arm64 because the line before it will end in a \ with nothing following. Put it first to avoid any issues.

@nieder
Copy link
Member

nieder commented Jan 31, 2023

Build failure on x86_64:

	perl -pi -e 's|libnettle.so|libnettle.dylib|g' testsuite/dlopen-test.c
sudo -u fink-bld [ENV] sh -c /tmp/fink.0g6Ju
./configure --prefix=/sw -r` --enable-shared --disable-openssl
sh: -c: line 0: unexpected EOF while looking for matching ``'

Looks like some of the `uname -r` is not being parsed correctly when sent through the %c parser.

@nieder nieder reopened this Jan 31, 2023
@TheSin-
Copy link
Member Author

TheSin- commented Jan 31, 2023

well that sucks, I don't have x86 anymore to test on and I assumed it was tested, that is on me, I'll come up with a proper fix cause this has been used more then once, seems the space is braking the parser :. Back it needs to be quoted?

@nieder
Copy link
Member

nieder commented Jan 31, 2023

An option is to use a variable in %c, the populate the variable in CompileScript.
Something like this (not yet tested):

ConfigureParams: <<
	("%m" = "arm64") --host=aarch64-apple-darwin${UNAME_R} \
	--enable-shared \
	--disable-openssl
<<
CompileScript: <<
	#!/bin/sh -ev
	UNAME_R=`uname -r`
	%{default_script}
	fink-package-precedence --depfile-ext='\.d' .
<<

@nieder
Copy link
Member

nieder commented Jan 31, 2023

OK, that lets x86_64 build again, and a simple test suggests that it will get passed correctly on arm64

@TheSin-
Copy link
Member Author

TheSin- commented Jan 31, 2023

oh that's a neat way, have you tested that? I'll give it a shot!

@TheSin-
Copy link
Member Author

TheSin- commented Feb 1, 2023

Confirmed it works on arm, I'll swap it and go through all the others I did over this week like that. Thanks @nieder

TheSin- added a commit that referenced this issue Feb 1, 2023
@TheSin- TheSin- closed this as completed Feb 1, 2023
@dhomeier
Copy link
Contributor

dhomeier commented Feb 1, 2023

Or just put it in quotes...

ConfigureParams: <<
	("%m" = "arm64") --host=aarch64-apple-darwin"`uname -r`" \
	--enable-shared \
	--disable-openssl
<<

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arm64 Build issues and fixes for Apple Silicon
Projects
None yet
Development

No branches or pull requests

4 participants