OpenAFS Master Repository branch, master, updated. openafs-devel-1_9_2-122-g6ee12c6
Gerrit Code Review
gerrit@openafs.org
Fri, 7 Feb 2025 10:36:24 -0500
The following commit has been merged in the master branch:
commit 6ee12c6e20d4e37b77610c23de7c580420508d43
Author: Andrew Deason <adeason@sinenomine.net>
Date: Mon Feb 3 11:44:45 2025 -0600
DARWIN: Use 'uname -m' instead of 'arch'
Since commit 9f94892f8d (darwin-x86-and-leopard-20060309),
MakefileProto.DARWIN.in uses the 'arch' command to determine what
architecture to build for if ARCHFLAGS is not given (or doesn't contain
any known architectures). However, the 'arch' command always prints
'i386' on x86-based DARWIN platforms, even on amd64-based platforms that
don't support 32-bit x86 at all.
As a result, trying to build OpenAFS on x86 DARWIN without specifying
ARCHFLAGS fails, because libafs tries to build i386 object files for
libafs. For darwin_200 and newer, we fail to build any kernel object
because our param.h doesn't support i386:
In file included from /.../src/external/heimdal/hcrypto/sha256.c:34:
In file included from /.../src/crypto/hcrypto/kernel/config.h:26:
/.../include/afs/param.h:194:3: error: Unsupported architecture
# error Unsupported architecture
^
For darwin between darwin_120 and darwin_190, our param.h supports i386
so we can build each object, but trying to link the objects into our
final kernel module doesn't work, since 32-bit kernel extensions aren't
supported. The linker shows us warnings like these:
ld: warning: ignoring file afs_vnop_attrs.o, missing required architecture x86_64 in file afs_vnop_attrs.o (1 slices)
and the resulting kernel module contains no object files (effectively
blank).
The easy workaround for this is to always specify ARCHFLAGS when
building on DARWIN. But to make the build not fail for the default case,
use 'uname -m' instead of 'arch' to detect the platform, so we don't try
to build i386 objects on amd64.
On other platforms (including Linux and Solaris), 'arch' is normally the
same as 'uname -m', but presumably the 'arch' command on macOS is
considered obsolete and just has never been updated to reflect the
migration to 64-bit x86.
Future commits may refactor how all of this arch-detection logic is done
to be clearer and less error-prone, but for now, just fix this issue
directly.
Written in collaboration with mvitale@sinenomine.net
mbarbosa@sinenomine.net.
Change-Id: I87cf5b879da28513b7341f625ceb9eaaf91c1326
Reviewed-on: https://gerrit.openafs.org/16203
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
src/libafs/MakefileProto.DARWIN.in | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--
OpenAFS Master Repository