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

Cannot build for armhf (32bit) target on Debian 64bit host #9392

Closed
bimonsubio1984 opened this issue Oct 1, 2019 · 7 comments
Closed

Cannot build for armhf (32bit) target on Debian 64bit host #9392

bimonsubio1984 opened this issue Oct 1, 2019 · 7 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

@bimonsubio1984
Copy link

bimonsubio1984 commented Oct 1, 2019

System information

Type Version/Name
Distribution Name Debian
Distribution Version 9.x
Linux Kernel 5.3.1
Architecture armhf
ZFS Version 0.8.2
SPL Version

Describe the problem you're observing

Cannot build using following commands:

++ SrcDir=/usr/src
++ Version=0.8.2
++ LinuxHeadersDir=/usr/src/linux-headers-5.3.1-gnu
++ LinuxHeadersOptions=' --with-linux=/usr/src/linux-headers-5.3.1-gnu --with-linux-obj=/usr/src/linux-headers-5.3.1-gnu '
++ Toolchain=CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf-
++ CommonOptions=' ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf- '
++ BuildOptions=' -j4 '
++ build zfs
++ What=zfs
++ cd /usr/src/zfs
++ git checkout zfs-0.8.2
HEAD is now at 1222e92 Tag zfs-0.8.2
++ sh autogen.sh

++ ./configure ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf- --with-linux=/usr/src/linux-headers-5.3.1-gnu --with-linux-obj=/usr/src/linux-headers-5.3.1-gnu --disable-pyzfs

++make ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf- --with-linux=/usr/src/linux-headers-5.3.1-gnu --with-linux-obj=/usr/src/linux-headers-5.3.1-gnu

Describe how to reproduce the problem

Include any warning/errors/backtraces from the system logs

make[1]: Leaving directory '/usr/src/zfs/module'
make[1]: Entering directory '/usr/src/zfs'
rm -rf .libs _libs
rm -f *.lo
test -z "module/Makefile module/avl/Makefile module/nvpair/Makefile module/unicode/Makefile module/zcommon/Makefile module/zfs/Makefile module/lua/Makefile module/icp/Makefile module/spl/Makefile zfs.release" || rm -f module/Makefile module/avl/Makefile module/nvpair/Makefile module/unicode/Makefile module/zcommon/Makefile module/zfs/Makefile module/lua/Makefile module/icp/Makefile module/spl/Makefile zfs.release
test . = "." || test -z "" || rm -f 
rm -f zfs_config.h stamp-h1
rm -f libtool config.lt
rm -f -R autom4te*.cache
find . \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS \
        -o -name .pc -o -name .hg -o -name .git \) -prune -o \
        \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
        -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
        -o -name '.*.rej' -o -size 0 -o -name '*%' -o -name '.*.cmd' \
        -o -name 'core' -o -name 'Makefile' -o -name 'Module.symvers' \
        -o -name '*.order' -o -name '*.markers' -o -name '*.gcda' \
        -o -name '*.gcno' \) \
        -type f -print | xargs rm -f
rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
rm -f cscope.out cscope.in.out cscope.po.out cscope.files
make[1]: Leaving directory '/usr/src/zfs'
rm -f config.status config.cache config.log configure.lineno config.status.lineno
rm -f Makefile
++ make -s ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf- -j4
make: *** No targets specified and no makefile found.  Stop.

@behlendorf behlendorf added Type: Architecture Indicates an issue is specific to a single processor architecture Type: Building Indicates an issue related to building binaries labels Oct 1, 2019
@bimonsubio1984
Copy link
Author

bimonsubio1984 commented Oct 2, 2019

Following script was used:


set -x;

#apt-get install build-essential autoconf libtool gawk alien fakeroot zlib1g-dev uuid-dev libattr1-dev libblkid-dev libselinux-dev libudev-dev parted lsscsi ksh libssl-dev libelf-dev linux-headers-$(uname -r) 


#       https://github.com/zfsonlinux/zfs/wiki/Building-ZFS

#Dir=/usr/src/zfs-0.7.13;
SrcDir=/usr/src;
#Version=0.7.13;
Version=0.8.2;

#LinuxHeadersDir="/usr/src/linux-5.2.14";
LinuxHeadersDir="/usr/src/linux-headers-5.3.1-gnu";
#LinuxHeadersDir=/usr/src/linux-headers-4.19.36-gnu;
LinuxHeadersOptions=" --with-linux=$LinuxHeadersDir --with-linux-obj=$LinuxHeadersDir ";

Toolchain="CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf-";
CommonOptions=" ARCH=arm $Toolchain ";
BuildOptions=" -j4 "; #-j$(nproc)

build()
{
        What=$1;
        cd $SrcDir/$What;
       git checkout $What-$Version;

       sh autogen.sh && \
       ./configure $CommonOptions $LinuxHeadersOptions --disable-pyzfs && \
        ( make clean; make distclean; make -s $CommonOptions $BuildOptions ) && \
        make deb;

}

#build spl;
build zfs;

@stale
Copy link

stale bot commented Oct 1, 2020

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 Oct 1, 2020
@stale stale bot closed this as completed Dec 30, 2020
@behlendorf
Copy link
Contributor

There were several fixes in #10538 to resolve various cross-compiler issues. It would be helpful if someone with access to an armhf system could retest this with the 2.0 release.

@igorpecovnik
Copy link

No luck, doesn't build while we would really like to get it working. Can try again and supply some logs if there is an interest to fix this?

@behlendorf behlendorf removed the Status: Stale No recent activity for issue label Jan 21, 2021
@behlendorf
Copy link
Contributor

@iamjamestl thanks for the feedback. I've reopened the issue until we can get it resolved.

@behlendorf behlendorf reopened this Jan 22, 2021
@stale
Copy link

stale bot commented Jan 22, 2022

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 22, 2022
@szubersk
Copy link
Contributor

szubersk commented Apr 6, 2022

@bimonsubio1984 I just tried reproducing the issue and I was not successful.

Debian project currently recommends using chroots instead of multilib for crossbuilding: https://wiki.debian.org/CrossCompiling

Following that advice and steps you provided (except the crossbuilding part) made me reproduce #11097 which is not really related at all to what we are talking about here.

# debootstrap --arch=armhf sid ./armhf
...
# chroot ./armhf
# apt-get install build-essential autoconf libtool gawk alien fakeroot zlib1g-dev uuid-dev libattr1-dev libblkid-dev libselinux-dev libudev-dev parted lsscsi ksh libssl-dev libelf-dev linux-headers-5.16.0-6
...
# sh autogen.sh && ./configure --disable-pyzfs && make -j8 -l3
...
/bin/sh: 1: /usr/src/linux-headers-5.16.0-6-common-rt/scripts/pahole-flags.sh: not found
/bin/sh: 1: /usr/src/linux-headers-5.16.0-6-common-rt/scripts/pahole-flags.sh: not found
  MODPOST /zfs/module/Module.symvers
ERROR: modpost: GPL-incompatible module zfs.ko uses GPL-only symbol 'migrate_enable'
ERROR: modpost: GPL-incompatible module zfs.ko uses GPL-only symbol 'migrate_disable'
make[4]: *** [/usr/src/linux-headers-5.16.0-6-common-rt/scripts/Makefile.modpost:134: /zfs/module/Module.symvers] Error 1

OpenZFS version used

commit ed715283de8e65a30d777e9576399ab75014b6fe (HEAD -> master)
Author: наб <[email protected]>
Date:   Tue Apr 5 22:50:55 2022 +0200

Please let us know if switching to chroot-based crossbuilding and using OpenZFS 2.0+ solved the compilation problem.

@stale stale bot closed this as completed Jul 10, 2022
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