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

SPL Build Failure on aarch64 #6820

Closed
gordan-bobic opened this issue Nov 4, 2017 · 12 comments
Closed

SPL Build Failure on aarch64 #6820

gordan-bobic opened this issue Nov 4, 2017 · 12 comments
Labels
Status: Stale No recent activity for issue Type: Architecture Indicates an issue is specific to a single processor architecture Type: Building Indicates an issue related to building binaries

Comments

@gordan-bobic
Copy link
Contributor

gordan-bobic commented Nov 4, 2017

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.

@loli10K loli10K added the Type: Architecture Indicates an issue is specific to a single processor architecture label Nov 4, 2017
@behlendorf behlendorf added the Type: Building Indicates an issue related to building binaries label Nov 6, 2017
@behlendorf
Copy link
Contributor

SPL ./configure fails to guess the architecture.

What's the error message generated when it fails to detect the architecture?

Also for what it's worth I don't observe this failure locally when building aarch64 packages for RHEL 7.4. I haven't tried this using CentOS.

@gordan-bobic
Copy link
Contributor Author

I don't think it fails to detect the architecture per se, the problem seems to be that it guesses sensibly (aarch64-redhat-linux-gnu), but this then fails to work. Forcing it instead to aarch64-unknown-linux-gnu seems to fix the problem.

I'll get the full error log as soon as possible.
The same problem, predictably, also affects the ZFS package build.

I am on latest CentOS 7.x

@gordan-bobic
Copy link
Contributor Author

make  pkg="spl-kmod" \
	def='--define "build_src_rpm 1" ' srpm-common
make[1]: Entering directory `/home/mock/zfs/spl-0.7.12'
{ test ! -d "spl-0.7.12" || { find "spl-0.7.12" -type d ! -perm -200 -exec chmod u+w {} ';' && rm -fr "spl-0.7.12"; }; }
test -d "spl-0.7.12" || mkdir "spl-0.7.12"
 (cd include && make  top_distdir=../spl-0.7.12 distdir=../spl-0.7.12/include \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[2]: Entering directory `/home/mock/zfs/spl-0.7.12/include'
 (cd fs && make  top_distdir=../../spl-0.7.12 distdir=../../spl-0.7.12/include/fs \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[3]: Entering directory `/home/mock/zfs/spl-0.7.12/include/fs'
make[3]: Leaving directory `/home/mock/zfs/spl-0.7.12/include/fs'
 (cd linux && make  top_distdir=../../spl-0.7.12 distdir=../../spl-0.7.12/include/linux \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[3]: Entering directory `/home/mock/zfs/spl-0.7.12/include/linux'
make[3]: Leaving directory `/home/mock/zfs/spl-0.7.12/include/linux'
 (cd rpc && make  top_distdir=../../spl-0.7.12 distdir=../../spl-0.7.12/include/rpc \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[3]: Entering directory `/home/mock/zfs/spl-0.7.12/include/rpc'
make[3]: Leaving directory `/home/mock/zfs/spl-0.7.12/include/rpc'
 (cd sharefs && make  top_distdir=../../spl-0.7.12 distdir=../../spl-0.7.12/include/sharefs \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[3]: Entering directory `/home/mock/zfs/spl-0.7.12/include/sharefs'
make[3]: Leaving directory `/home/mock/zfs/spl-0.7.12/include/sharefs'
 (cd sys && make  top_distdir=../../spl-0.7.12 distdir=../../spl-0.7.12/include/sys \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[3]: Entering directory `/home/mock/zfs/spl-0.7.12/include/sys'
 (cd fm && make  top_distdir=../../../spl-0.7.12 distdir=../../../spl-0.7.12/include/sys/fm \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[4]: Entering directory `/home/mock/zfs/spl-0.7.12/include/sys/fm'
make[4]: Leaving directory `/home/mock/zfs/spl-0.7.12/include/sys/fm'
 (cd fs && make  top_distdir=../../../spl-0.7.12 distdir=../../../spl-0.7.12/include/sys/fs \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[4]: Entering directory `/home/mock/zfs/spl-0.7.12/include/sys/fs'
make[4]: Leaving directory `/home/mock/zfs/spl-0.7.12/include/sys/fs'
make[3]: Leaving directory `/home/mock/zfs/spl-0.7.12/include/sys'
 (cd util && make  top_distdir=../../spl-0.7.12 distdir=../../spl-0.7.12/include/util \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[3]: Entering directory `/home/mock/zfs/spl-0.7.12/include/util'
make[3]: Leaving directory `/home/mock/zfs/spl-0.7.12/include/util'
 (cd vm && make  top_distdir=../../spl-0.7.12 distdir=../../spl-0.7.12/include/vm \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[3]: Entering directory `/home/mock/zfs/spl-0.7.12/include/vm'
make[3]: Leaving directory `/home/mock/zfs/spl-0.7.12/include/vm'
make[2]: Leaving directory `/home/mock/zfs/spl-0.7.12/include'
 (cd rpm && make  top_distdir=../spl-0.7.12 distdir=../spl-0.7.12/rpm \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[2]: Entering directory `/home/mock/zfs/spl-0.7.12/rpm'
 (cd generic && make  top_distdir=../../spl-0.7.12 distdir=../../spl-0.7.12/rpm/generic \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[3]: Entering directory `/home/mock/zfs/spl-0.7.12/rpm/generic'
make[3]: Leaving directory `/home/mock/zfs/spl-0.7.12/rpm/generic'
 (cd redhat && make  top_distdir=../../spl-0.7.12 distdir=../../spl-0.7.12/rpm/redhat \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[3]: Entering directory `/home/mock/zfs/spl-0.7.12/rpm/redhat'
make[3]: Leaving directory `/home/mock/zfs/spl-0.7.12/rpm/redhat'
make[2]: Leaving directory `/home/mock/zfs/spl-0.7.12/rpm'
 (cd lib && make  top_distdir=../spl-0.7.12 distdir=../spl-0.7.12/lib \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[2]: Entering directory `/home/mock/zfs/spl-0.7.12/lib'
make[2]: Leaving directory `/home/mock/zfs/spl-0.7.12/lib'
 (cd cmd && make  top_distdir=../spl-0.7.12 distdir=../spl-0.7.12/cmd \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[2]: Entering directory `/home/mock/zfs/spl-0.7.12/cmd'
 (cd splat && make  top_distdir=../../spl-0.7.12 distdir=../../spl-0.7.12/cmd/splat \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[3]: Entering directory `/home/mock/zfs/spl-0.7.12/cmd/splat'
make[3]: Leaving directory `/home/mock/zfs/spl-0.7.12/cmd/splat'
 (cd splslab && make  top_distdir=../../spl-0.7.12 distdir=../../spl-0.7.12/cmd/splslab \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[3]: Entering directory `/home/mock/zfs/spl-0.7.12/cmd/splslab'
make[3]: Leaving directory `/home/mock/zfs/spl-0.7.12/cmd/splslab'
make[2]: Leaving directory `/home/mock/zfs/spl-0.7.12/cmd'
 (cd man && make  top_distdir=../spl-0.7.12 distdir=../spl-0.7.12/man \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[2]: Entering directory `/home/mock/zfs/spl-0.7.12/man'
 (cd man1 && make  top_distdir=../../spl-0.7.12 distdir=../../spl-0.7.12/man/man1 \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[3]: Entering directory `/home/mock/zfs/spl-0.7.12/man/man1'
make[3]: Leaving directory `/home/mock/zfs/spl-0.7.12/man/man1'
 (cd man5 && make  top_distdir=../../spl-0.7.12 distdir=../../spl-0.7.12/man/man5 \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[3]: Entering directory `/home/mock/zfs/spl-0.7.12/man/man5'
make[3]: Leaving directory `/home/mock/zfs/spl-0.7.12/man/man5'
make[2]: Leaving directory `/home/mock/zfs/spl-0.7.12/man'
 (cd scripts && make  top_distdir=../spl-0.7.12 distdir=../spl-0.7.12/scripts \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[2]: Entering directory `/home/mock/zfs/spl-0.7.12/scripts'
make[2]: Leaving directory `/home/mock/zfs/spl-0.7.12/scripts'
 (cd module && make  top_distdir=../spl-0.7.12 distdir=../spl-0.7.12/module \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[2]: Entering directory `/home/mock/zfs/spl-0.7.12/module'
list='spl splat'; for subdir in $list; do \
	(find ../module/$subdir -name '*.c' -o -name '*.h' |\
	 xargs /bin/cp -t $distdir/$subdir); \
done
make[2]: Leaving directory `/home/mock/zfs/spl-0.7.12/module'
make  \
  top_distdir="spl-0.7.12" distdir="spl-0.7.12" \
  dist-hook
make[2]: Entering directory `/home/mock/zfs/spl-0.7.12'
sed -i 's/Release:[[:print:]]*/Release:      1/' \
	spl-0.7.12/META
make[2]: Leaving directory `/home/mock/zfs/spl-0.7.12'
test -n "" \
|| find "spl-0.7.12" -type d ! -perm -755 \
	-exec chmod u+rwx,go+rx {} \; -o \
  ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
  ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
  ! -type d ! -perm -444 -exec /bin/sh /home/mock/zfs/spl-0.7.12/config/install-sh -c -m a+r {} {} \; \
|| chmod -R a+r "spl-0.7.12"
tardir=spl-0.7.12 && /bin/sh /home/mock/zfs/spl-0.7.12/config/missing --run tar chof - "$tardir" | GZIP=--best gzip -c >spl-0.7.12.tar.gz
{ test ! -d "spl-0.7.12" || { find "spl-0.7.12" -type d ! -perm -200 -exec chmod u+w {} ';' && rm -fr "spl-0.7.12"; }; }
make[2]: Entering directory `/home/mock/zfs/spl-0.7.12'
make[2]: Leaving directory `/home/mock/zfs/spl-0.7.12'
Wrote: /tmp/spl-build-mock-1ZRjqk4Z/SRPMS/spl-kmod-0.7.12-1.el7.src.rpm
make[1]: Leaving directory `/home/mock/zfs/spl-0.7.12'
make  pkg="spl-kmod" \
	def='--define "_without_debug 1" --define "_without_debug_kmem 1" --define "_without_debug_kmem_tracking 1" --define "kernels 4.9.153-6.el7.aarch64" --define "_wrong_version_format_terminate_build 0"' rpm-common
make[1]: Entering directory `/home/mock/zfs/spl-0.7.12'
make[2]: Entering directory `/home/mock/zfs/spl-0.7.12'
make[2]: Leaving directory `/home/mock/zfs/spl-0.7.12'
Installing spl-kmod-0.7.12-1.el7.src.rpm
Executing(%prep): /bin/sh -e /tmp/spl-build-mock-l7w8XdxE/TMP/rpm-tmp.jEEMfS
+ umask 022
+ cd /tmp/spl-build-mock-l7w8XdxE/BUILD
+ bash /tmp/spl-build-mock-l7w8XdxE/SOURCES/kmodtool --target aarch64 --kmodname spl-kmod --newest --devel --for-kernels 4.9.153-6.el7.aarch64
%package       -n kmod-spl-4.9.153-6.el7.aarch64
Summary:          spl kernel module(s) for 4.9.153-6.el7.aarch64
Group:            System Environment/Kernel
Provides:         kernel-modules-for-kernel = 4.9.153-6.el7.aarch64
Provides:         kmod-spl-uname-r = 4.9.153-6.el7.aarch64
Provides:         spl-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
Requires:         spl-kmod-common >= %{?epoch:%{epoch}:}%{version}
Requires(post):   /sbin/depmod
Requires(postun): /sbin/depmod
Requires:         kernel-uname-r = 4.9.153-6.el7.aarch64
BuildRequires:	  kernel-devel-uname-r = 4.9.153-6.el7.aarch64
%{?KmodsRequires:Requires: %{KmodsRequires}-uname-r = 4.9.153-6.el7.aarch64}
%{?KmodsRequires:BuildRequires: %{KmodsRequires}-uname-r = 4.9.153-6.el7.aarch64}
%post          -n kmod-spl-4.9.153-6.el7.aarch64
/sbin/depmod -aeF /boot/System.map-4.9.153-6.el7.aarch64 4.9.153-6.el7.aarch64 > /dev/null || :
%postun        -n kmod-spl-4.9.153-6.el7.aarch64
/sbin/depmod  -aF /boot/System.map-4.9.153-6.el7.aarch64 4.9.153-6.el7.aarch64 &> /dev/null || :

%description  -n kmod-spl-4.9.153-6.el7.aarch64
This package provides the spl kernel modules built for the Linux
kernel 4.9.153-6.el7.aarch64 for the %{_target_cpu} family of processors.
%files        -n kmod-spl-4.9.153-6.el7.aarch64
%defattr(644,root,root,755)
%dir /lib/modules/4.9.153-6.el7.aarch64/extra
/lib/modules/4.9.153-6.el7.aarch64/extra/spl/


%package       -n kmod-spl-devel
Summary:          spl kernel module(s) devel common
Group:            System Environment/Kernel
Provides:         spl-devel-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
%description  -n kmod-spl-devel
This package provides the common header files to build kernel modules
which depend on the spl kernel module.  It may optionally require
the spl-devel-<kernel> objects for the newest kernel.

%files        -n kmod-spl-devel
%defattr(644,root,root,755)
%{_usrsrc}/spl-%{version}
%exclude %{_usrsrc}/spl-%{version}/4.9.153-6.el7.aarch64


%package       -n kmod-spl-devel-4.9.153-6.el7.aarch64
Summary:          spl kernel module(s) devel for 4.9.153-6.el7.aarch64
Group:            System Environment/Kernel
Provides:         kernel-objects-for-kernel = 4.9.153-6.el7.aarch64
Provides:         spl-devel-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
Provides:         kmod-spl-devel-uname-r = 4.9.153-6.el7.aarch64
Requires:         kernel-devel-uname-r = 4.9.153-6.el7.aarch64
BuildRequires:    kernel-devel-uname-r = 4.9.153-6.el7.aarch64
%{?KmodsDevelRequires:Requires: %{KmodsDevelRequires}-uname-r = 4.9.153-6.el7.aarch64}
%{?KmodsDevelRequires:BuildRequires: %{KmodsDevelRequires}-uname-r = 4.9.153-6.el7.aarch64}
%description  -n kmod-spl-devel-4.9.153-6.el7.aarch64
This package provides objects and symbols required to build kernel modules
which depend on the spl kernel modules built for the Linux
kernel 4.9.153-6.el7.aarch64 for the %{_target_cpu} family of processors.
%files        -n kmod-spl-devel-4.9.153-6.el7.aarch64
%defattr(644,root,root,755)
%{_usrsrc}/spl-%{version}/4.9.153-6.el7.aarch64



%global kmodinstdir_prefix  /lib/modules/
%global kmodinstdir_postfix /extra/spl/
%global kernel_versions     4.9.153-6.el7.aarch64___%{_usrsrc}/kernels/4.9.153-6.el7.aarch64

+ cd /tmp/spl-build-mock-l7w8XdxE/BUILD
+ rm -rf spl-kmod-0.7.12
+ /usr/bin/mkdir -p spl-kmod-0.7.12
+ cd spl-kmod-0.7.12
+ /usr/bin/gzip -dc /tmp/spl-build-mock-l7w8XdxE/SOURCES/spl-0.7.12.tar.gz
+ /usr/bin/tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ for kernel_version in 4.9.153-6.el7.aarch64___/usr/src/kernels/4.9.153-6.el7.aarch64
+ /usr/bin/mkdir _kmod_build_4.9.153-6.el7.aarch64
+ exit 0
Executing(%build): /bin/sh -e /tmp/spl-build-mock-l7w8XdxE/TMP/rpm-tmp.YSCwzD
+ umask 022
+ cd /tmp/spl-build-mock-l7w8XdxE/BUILD
+ cd spl-kmod-0.7.12
+ for kernel_version in 4.9.153-6.el7.aarch64___/usr/src/kernels/4.9.153-6.el7.aarch64
+ cd _kmod_build_4.9.153-6.el7.aarch64
+ CFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches  '
+ export CFLAGS
+ CXXFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches  '
+ export CXXFLAGS
+ FFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -I/usr/lib64/gfortran/modules'
+ export FFLAGS
+ FCFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -I/usr/lib64/gfortran/modules'
+ export FCFLAGS
+ LDFLAGS=
+ export LDFLAGS
+ '[' 1 == 1 ']'
+ '[' aarch64 == ppc64le ']'
++ find . -name config.guess -o -name config.sub
+ ../spl-0.7.12/configure --build=aarch64-redhat-linux-gnu --host=aarch64-redhat-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-config=kernel --with-linux=/usr/src/kernels/4.9.153-6.el7.aarch64 --with-linux-obj=/usr/src/kernels/4.9.153-6.el7.aarch64 --disable-debug --disable-debug-log --disable-debug-kmem --disable-debug-kmem-tracking --disable-atomic-spinlocks
configure: WARNING: unrecognized options: --disable-debug-log
checking for gawk... gawk
checking metadata... META file
checking build system type... Invalid configuration `aarch64-redhat-linux-gnu': machine `aarch64-redhat' not recognized
configure: error: /bin/sh ../spl-0.7.12/config/config.sub aarch64-redhat-linux-gnu failed
error: Bad exit status from /tmp/spl-build-mock-l7w8XdxE/TMP/rpm-tmp.YSCwzD (%build)


RPM build errors:
    Bad exit status from /tmp/spl-build-mock-l7w8XdxE/TMP/rpm-tmp.YSCwzD (%build)
make[1]: *** [rpm-common] Error 1
make[1]: Leaving directory `/home/mock/zfs/spl-0.7.12'
make: *** [rpm-kmod] Error 2

@gordan-bobic
Copy link
Contributor Author

It looks like config.guess is also about 10 years out of date.

@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.

@behlendorf
Copy link
Contributor

Sorry if this has been asked already and answered. But does building with the latest upstream config.guess resolve the issue? Historically, we've relied on the distribution provided version.

https://www.gnu.org/software/gettext/manual/html_node/config_002eguess.html

@digitalsanity
Copy link

digitalsanity commented Jun 21, 2019 via email

@gordan-bobic
Copy link
Contributor Author

@behlendorf, the latest config.guess + config.sub resolve the issue without having to specify the build arch manually on zfs-0.8.1 using --build=aarch64-unknown-linux-gnu

@behlendorf
Copy link
Contributor

@digitalsanity it would be great if you could open a PR with the proposed kuid fix for the Armbian kernel. I'd be happy to review it so we can resolve the build failures.

@gordan-bobic thanks for verifying that. Then let me do a little research to see if we should perhaps be including it.

@digitalsanity
Copy link

There is an issue with arch/arm/include not being packaged with linux header debs for arm64 kernels. arch/arm64/include/asm/opcodes.h tries to include arch/arm/include/asm/opcodes.h, which doesn't exist (because it is an arm64 kernel afterall..)

See more:

ayufan-rock64/linux-build#252 (comment)

@stale
Copy link

stale bot commented Feb 18, 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 Feb 18, 2021
@stale stale bot closed this as completed May 21, 2021
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: Architecture Indicates an issue is specific to a single processor architecture Type: Building Indicates an issue related to building binaries
Projects
None yet
Development

No branches or pull requests

4 participants