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

ZFS Build Failure on aarch64 #8345

Closed
gordan-bobic opened this issue Jan 27, 2019 · 12 comments
Closed

ZFS Build Failure on aarch64 #8345

gordan-bobic opened this issue Jan 27, 2019 · 12 comments
Labels
Status: Stale No recent activity for issue Type: Building Indicates an issue related to building binaries

Comments

@gordan-bobic
Copy link
Contributor

System information

Type Version/Name
Distribution Name CentOS
Distribution Version 7
Linux Kernel 4.9.153
Architecture aarch64
ZFS Version 0.7.12
SPL Version 0.7.12

Describe the problem you're observing

SPL ./configure fails to guess the architecture. It has to be invoked with:
./configure --build=aarch64-unknown-linux-gnu

That succeeds,. and the make step succeeds, but make rpms then fails with:
checking build system type... Invalid configuration aarch64-redhat-linux-gnu': machine aarch64-redhat' not recognized

What fixes it is changing /usr/lib/rpm/macros entry from
%_host aarch64-redhat-linux-gnu
to
%_host aarch64-unknown-linux-gnu

This works correctly on x86-64, and x86_64-redhat-linux-gnu seems to get recognized.

With updated config.guess it still fails:

checking for gawk... gawk
checking metadata... META file
checking build system type... aarch64-unknown-linux-gnu
checking host system type... aarch64-unknown-linux-gnu
checking target system type... aarch64-unknown-linux-gnu
checking whether to enable maintainer-specific portions of Makefiles... no
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking whether make sets $(MAKE)... yes
checking for a BSD-compatible install... /bin/install -c
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /bin/ld
checking if the linker (/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /bin/nm -B
checking the name lister (/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /bin/nm -B output from gcc object... ok
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking dependency style of gcc... gcc3
checking whether gcc and cc understand -c and -o together... yes
checking whether to build with code coverage support... no
checking zfs author... OpenZFS on Linux
checking zfs license... CDDL
checking linux distribution... redhat
checking default package type... rpm
checking default init directory... ${prefix}/etc/init.d
checking default init script type... redhat
checking default init config direectory... /etc/sysconfig
checking whether initramfs-tools is available... no
checking whether rpm is available... yes (4.11.3)
checking whether rpmbuild is available... yes (4.11.3)
checking whether spec files are available... yes (rpm/generic/*.spec.in)
checking whether dpkg is available... no
checking whether dpkg-buildpackage is available... no
checking whether alien is available... no
checking zfs config... all
checking for -Wno-unused-but-set-variable support... yes
checking for -Wno-bool-compare support... no
checking for target asm dir... asm-generic
checking for udev directories... /lib/udev;/lib/udev/rules.d
checking for systemd support... yes
checking for dracut directory... /usr/lib/dracut
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for library containing compress2... -lz
checking for library containing uncompress... none required
checking for library containing crc32... none required
checking uuid/uuid.h usability... yes
checking uuid/uuid.h presence... yes
checking for uuid/uuid.h... yes
checking for library containing uuid_generate... -luuid
checking for library containing uuid_is_null... none required
checking for xdrmem_create in -ltirpc... no
checking for library containing xdrmem_create... none required
checking blkid/blkid.h usability... yes
checking blkid/blkid.h presence... yes
checking for blkid/blkid.h... yes
checking libudev.h usability... yes
checking libudev.h presence... yes
checking for libudev.h... yes
checking for library containing udev_device_get_is_initialized... -ludev
checking for -Wframe-larger-than=<size> support... yes
checking libaio.h usability... no
checking libaio.h presence... no
checking for libaio.h... no
checking makedev() is declared in sys/sysmacros.h... yes
checking makedev() is declared in sys/mkdev.h... no
checking for -Wno-format-truncation support... yes
checking for mlockall... yes
checking kernel source directory... /usr/src/kernels/4.9.153-6.el7.aarch64
checking kernel build directory... /usr/src/kernels/4.9.153-6.el7.aarch64
checking kernel source version... 4.9.153-6.el7.aarch64
checking kernel file name for module symbols... Module.symvers
checking spl source directory... /usr/src/spl-0.7.12
checking spl build directory... /var/lib/dkms/spl/0.7.12
configure: error:
	*** Please make sure the kmod spl devel <kernel> package for your
	*** distribution is installed then try again.  If that fails you
	*** can specify the location of the spl objects with the
	*** '--with-spl-obj=PATH' option.  Failed to find spl_config.h in
	*** any of the following:
	/usr/src/spl-0.7.12/4.9.153-6.el7.aarch64
	/usr/src/spl-0.7.12
./0.7.12/4.9.153-6.el7.aarch64/aarch64/spl_config.h
checking for gawk... gawk
checking metadata... META file
checking build system type... aarch64-unknown-linux-gnu
checking host system type... aarch64-unknown-linux-gnu
checking target system type... aarch64-unknown-linux-gnu
checking whether to enable maintainer-specific portions of Makefiles... no
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking whether make sets $(MAKE)... yes
checking for a BSD-compatible install... /bin/install -c
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /bin/ld
checking if the linker (/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /bin/nm -B
checking the name lister (/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /bin/nm -B output from gcc object... ok
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking dependency style of gcc... gcc3
checking whether gcc and cc understand -c and -o together... yes
checking whether to build with code coverage support... no
checking zfs author... OpenZFS on Linux
checking zfs license... CDDL
checking linux distribution... redhat
checking default package type... rpm
checking default init directory... ${prefix}/etc/init.d
checking default init script type... redhat
checking default init config direectory... /etc/sysconfig
checking whether initramfs-tools is available... no
checking whether rpm is available... yes (4.11.3)
checking whether rpmbuild is available... yes (4.11.3)
checking whether spec files are available... yes (rpm/generic/*.spec.in)
checking whether dpkg is available... no
checking whether dpkg-buildpackage is available... no
checking whether alien is available... no
checking zfs config... all
checking for -Wno-unused-but-set-variable support... yes
checking for -Wno-bool-compare support... no
checking for target asm dir... asm-generic
checking for udev directories... /lib/udev;/lib/udev/rules.d
checking for systemd support... yes
checking for dracut directory... /usr/lib/dracut
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for library containing compress2... -lz
checking for library containing uncompress... none required
checking for library containing crc32... none required
checking uuid/uuid.h usability... yes
checking uuid/uuid.h presence... yes
checking for uuid/uuid.h... yes
checking for library containing uuid_generate... -luuid
checking for library containing uuid_is_null... none required
checking for xdrmem_create in -ltirpc... no
checking for library containing xdrmem_create... none required
checking blkid/blkid.h usability... yes
checking blkid/blkid.h presence... yes
checking for blkid/blkid.h... yes
checking libudev.h usability... yes
checking libudev.h presence... yes
checking for libudev.h... yes
checking for library containing udev_device_get_is_initialized... -ludev
checking for -Wframe-larger-than=<size> support... yes
checking libaio.h usability... no
checking libaio.h presence... no
checking for libaio.h... no
checking makedev() is declared in sys/sysmacros.h... yes
checking makedev() is declared in sys/mkdev.h... no
checking for -Wno-format-truncation support... yes
checking for mlockall... yes
checking kernel source directory... /usr/src/kernels/4.9.153-6.el7.aarch64
checking kernel build directory... /usr/src/kernels/4.9.153-6.el7.aarch64
checking kernel source version... 4.9.153-6.el7.aarch64
checking kernel file name for module symbols... Module.symvers
checking spl source directory... /usr/src/spl-0.7.12
checking spl build directory... Not found
configure: error:
	*** Please make sure the kmod spl devel <kernel> package for your
	*** distribution is installed then try again.  If that fails you
	*** can specify the location of the spl objects with the
	*** '--with-spl-obj=PATH' option.  Failed to find spl_config.h in
	*** any of the following:
	/usr/src/spl-0.7.12/4.9.153-6.el7.aarch64
	/usr/src/spl-0.7.12
[mock@orcone ~/zfs/zfs-0.7.12]$ make distclean
make: *** No rule to make target `distclean'.  Stop.
[mock@orcone ~/zfs/zfs-0.7.12]$ make clean
make: *** No rule to make target `clean'.  Stop.
[mock@orcone ~/zfs/zfs-0.7.12]$ make distclean
make: *** No rule to make target `distclean'.  Stop.
[mock@orcone ~/zfs/zfs-0.7.12]$ ./configure --build=aarch64-unknown-linux-gnu
checking for gawk... gawk
checking metadata... META file
checking build system type... aarch64-unknown-linux-gnu
checking host system type... aarch64-unknown-linux-gnu
checking target system type... aarch64-unknown-linux-gnu
checking whether to enable maintainer-specific portions of Makefiles... no
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking whether make sets $(MAKE)... yes
checking for a BSD-compatible install... /bin/install -c
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /bin/ld
checking if the linker (/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /bin/nm -B
checking the name lister (/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /bin/nm -B output from gcc object... ok
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking dependency style of gcc... gcc3
checking whether gcc and cc understand -c and -o together... yes
checking whether to build with code coverage support... no
checking zfs author... OpenZFS on Linux
checking zfs license... CDDL
checking linux distribution... redhat
checking default package type... rpm
checking default init directory... ${prefix}/etc/init.d
checking default init script type... redhat
checking default init config direectory... /etc/sysconfig
checking whether initramfs-tools is available... no
checking whether rpm is available... yes (4.11.3)
checking whether rpmbuild is available... yes (4.11.3)
checking whether spec files are available... yes (rpm/generic/*.spec.in)
checking whether dpkg is available... no
checking whether dpkg-buildpackage is available... no
checking whether alien is available... no
checking zfs config... all
checking for -Wno-unused-but-set-variable support... yes
checking for -Wno-bool-compare support... no
checking for target asm dir... asm-generic
checking for udev directories... /lib/udev;/lib/udev/rules.d
checking for systemd support... yes
checking for dracut directory... /usr/lib/dracut
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for library containing compress2... -lz
checking for library containing uncompress... none required
checking for library containing crc32... none required
checking uuid/uuid.h usability... yes
checking uuid/uuid.h presence... yes
checking for uuid/uuid.h... yes
checking for library containing uuid_generate... -luuid
checking for library containing uuid_is_null... none required
checking for xdrmem_create in -ltirpc... no
checking for library containing xdrmem_create... none required
checking blkid/blkid.h usability... yes
checking blkid/blkid.h presence... yes
checking for blkid/blkid.h... yes
checking libudev.h usability... yes
checking libudev.h presence... yes
checking for libudev.h... yes
checking for library containing udev_device_get_is_initialized... -ludev
checking for -Wframe-larger-than=<size> support... yes
checking libaio.h usability... no
checking libaio.h presence... no
checking for libaio.h... no
checking makedev() is declared in sys/sysmacros.h... yes
checking makedev() is declared in sys/mkdev.h... no
checking for -Wno-format-truncation support... yes
checking for mlockall... yes
checking kernel source directory... /usr/src/kernels/4.9.153-6.el7.aarch64
checking kernel build directory... /usr/src/kernels/4.9.153-6.el7.aarch64
checking kernel source version... 4.9.153-6.el7.aarch64
checking kernel file name for module symbols... Module.symvers
checking spl source directory... /usr/src/spl-0.7.12
checking spl build directory... Not found
configure: error:
	*** Please make sure the kmod spl devel <kernel> package for your
	*** distribution is installed then try again.  If that fails you
	*** can specify the location of the spl objects with the
	*** '--with-spl-obj=PATH' option.  Failed to find spl_config.h in
	*** any of the following:
	/usr/src/spl-0.7.12/4.9.153-6.el7.aarch64
	/usr/src/spl-0.7.12

Workaround is to manually copy spl_config.hfrom the original build directory to /usr/src/spl/0.7.12/, but the spl-dkms package should have brought that with it.

@rageagainstthebugs
Copy link

This duplicate #6820

@gordan-bobic
Copy link
Contributor Author

It's not a duplicate, it's similar. #6820 is about SPL build failure, this is about ZFS build failure. Root causes may be similar.

DKMS build of ZFS from built zfs-dkms rpm also fails, because configure fails with the same error as #6820, but the same workarounds don't seem to help.

@loli10K loli10K added the Type: Building Indicates an issue related to building binaries label Jan 29, 2019
@digitalsanity
Copy link

I think this is a repeat of a 'closed' issue.

openzfs/spl#653

Steps to fix:

https://forum.armbian.com/topic/6789-build-zfs-on-rk3328/?do=findComment&comment=53681

@gordan-bobic
Copy link
Contributor Author

I don't see what wrong detection of the architecture can possibly have to do with selinux.

@gordan-bobic
Copy link
Contributor Author

gordan-bobic commented Jun 15, 2019

I can confirm that this issue persists with kernel 4.9.181 and ZFS 0.8.1 on CentOS 7.6 userspace.

Loading new zfs-0.8.1 DKMS files...
Building for 4.9.181-1.el7.aarch64
Building initial module for 4.9.181-1.el7.aarch64
config/config.guess: unable to guess system type

This script, last modified 2009-11-20, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from

  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
and
  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD

If the version you run (config/config.guess) is already up to date, please
send the following data and any information you think might be
pertinent to <config-patches@gnu.org> in order to provide the needed
information to handle your system.

config.guess timestamp = 2009-11-20

uname -m = aarch64
uname -r = 4.9.181-1.el7.aarch64
uname -s = Linux
uname -v = #1 SMP Sat Jun 15 00:26:34 BST 2019

/usr/bin/uname -p = aarch64
/bin/uname -X     = 

hostinfo               = 
/bin/universe          = 
/usr/bin/arch -k       = 
/bin/arch              = aarch64
/usr/bin/oslevel       = 
/usr/convex/getsysinfo = 

UNAME_MACHINE = aarch64
UNAME_RELEASE = 4.9.181-1.el7.aarch64
UNAME_SYSTEM  = Linux
UNAME_VERSION = #1 SMP Sat Jun 15 00:26:34 BST 2019
configure: error: cannot guess build type; you must specify one

@tonyhutter
Copy link
Contributor

Using the master branch (c1b5801), I'm able to build and load the dkms module with a RHEL 7.6 aarch64 AWS instance:

$ dkms status
zfs, 0.8.0, 4.14.0-115.2.2.el7a.aarch64, aarch64: installed

@gordan-bobic
Copy link
Contributor Author

There may be some discrepancy between RHEL and CentOS that is causing this. @behlendorf also mentioned on the related ticket here that it built on RHEL without issues:
#6820

@gordan-bobic
Copy link
Contributor Author

Confirming that the same issue persists with CentOS 7.7 on aarch64 with ZoL 0.8.2.
Updating config.sub and config.guess to the latest version still fixes it.

@andrius4669
Copy link

running ./autogen.sh (or equivalent autoreconf -fi) before ./configure also fixes it.

@gordan-bobic
Copy link
Contributor Author

Confirming that the same issue persists with CentOS 7.7 on aarch64 with ZoL 0.8.3.
Confirming what @andrius4669 said that running ./autogen.sh first pn aarch64 results in ./configure working.

@stale
Copy link

stale bot commented Jan 24, 2021

This issue has been automatically marked as "stale" because it has not had any activity for a while. It will be closed in 90 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: Stale No recent activity for issue label Jan 24, 2021
@behlendorf
Copy link
Contributor

This should be resolved. All recent release tarballs have been generated with a new enough version of autoconf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Stale No recent activity for issue Type: Building Indicates an issue related to building binaries
Projects
None yet
Development

No branches or pull requests

7 participants