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
Support building on arm64 macOS #1460
Conversation
lib/rpmrc.c
Outdated
@@ -1039,6 +1039,8 @@ static void defaultMachine(rpmrcCtx ctx, const char ** arch, const char ** os) | |||
strcpy(un.machine, "i386"); | |||
#elif defined(__x86_64__) | |||
strcpy(un.machine, "x86_64"); | |||
#elif defined(__arm64__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The preferred define from ARM is __aarch64__
, can you change to that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, done.
@digitalagedragon The change looks good, could you squash the new commit into the original one and add in the body of the commit why this is being done? |
Previously, trying to run rpmbuild on a M1 machine returns "error: No compatible architectures found for build". Since RPM detects its architecture on macOS just by looking at what architecture flags are defined at compile time, this adds a clause to detect aarch64.
How's that look? |
Looks fine to me as such. But just out of curiosity, what does uname return on these systems? The OSX detection code originates from sometime 2005, which is a long long time ago... |
It returns Honestly, I'm not sure why rpm doesn't just use |
Semi related: For enabling NDB you would need a small amount of patching. |
Fair enough. The arch detection in rpm is just crazy, but that's not your fault... |
What it says on the tin.
As it stands right now building
rpm
natively on a M1 box just gets youerror: No compatible architectures found for build
if you try torpmbuild
anything, so we need to detect when__arm64__
is defined and set the build architecture toaarch64
.