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

aur-chroot: confusion between armv7h and armv7l #810

Closed
Kernald opened this issue Mar 18, 2021 · 4 comments
Closed

aur-chroot: confusion between armv7h and armv7l #810

Kernald opened this issue Mar 18, 2021 · 4 comments
Labels

Comments

@Kernald
Copy link

Kernald commented Mar 18, 2021

When running on a Raspberry Pi 4 with a 32 bits kernel, uname -m reports armv7l. Despite that, the packages are built for armv7h - and that's the architecture set in the pacman.conf.

With that said, running this command:

aur sync --no-view --no-confirm --chroot --database=aurto --makepkg-conf=/etc/aurto/makepkg-chroot.conf --pacman-conf=/etc/aurto/pacman-chroot.conf yay

With in the makepkg-chroot.conf:

CARCH="armv7h"
CHOST="armv7l-unknown-linux-gnueabihf"

And in the pacman-chroot.conf:

Architecture = armv7h

(Both taken from the base Archlinux installation)

This gives:

==> Using [aurto] repository
  -> yay: (none) -> 10.2.0-1
==> Retrieving package files
From https://aur.archlinux.org/yay
 = [up to date]      master     -> origin/master
Running aur chroot --create --makepkg-conf /etc/aurto/makepkg-chroot.conf --pacman-conf /etc/aurto/pacman-chroot.conf
Running aur chroot --update --makepkg-conf /etc/aurto/makepkg-chroot.conf --pacman-conf /etc/aurto/pacman-chroot.conf
setarch: armv7h: Unrecognized architecture

setarch --list:

uname26
linux32
linux64
armv7l
armv8l
armh
arm
arm64
aarch64

If in the makepkg-chroot.conf I set CARCH="armv7l", it works - but the packages end up being built for the wrong architecture.

I'm not really sure what's calling setarch, but I'm not sure the CARCH value is the proper reference here. Maybe CHOST would be better?

@AladW
Copy link
Member

AladW commented Mar 26, 2021

There's nothing I can do about this with the current aur-chroot implementation, because CARCH is hardcoded in arch-nspawn: https://git.archlinux.org/devtools.git/tree/arch-nspawn.in#n130

It could be done differently in a standalone aur-chroot which is WIP.

@AladW AladW added the devtools label Mar 26, 2021
@ingrinder
Copy link

ingrinder commented Apr 16, 2021

This is a dirty hack, but I personally solve this on my Pi 1B (same issue but with armv6) with this patch to arch-nspawn, using a pacman hook to apply it every update:

--- /usr/bin/arch-nspawn        2021-02-08 20:33:41.000000000 +0000
+++ /usr/bin/arch-nspawn.new    2021-03-17 14:13:17.127975831 +0000
@@ -374,6 +374,10 @@
 
 [[ -z $nosetarch ]] || unset CARCH
 
+if [[ $CARCH = "armv6h" ]]; then
+       CARCH="armv6l"
+fi
+
 exec ${CARCH:+setarch "$CARCH"} systemd-nspawn -q \
        -D "$working_dir" \
        -E "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin" \

@AladW AladW changed the title Confusion between armv7h and armv7l aur-chroot: confusion between armv7h and armv7l Nov 16, 2021
@AladW
Copy link
Member

AladW commented Dec 6, 2021

@AladW
Copy link
Member

AladW commented Dec 22, 2021

https://archlinux.org/packages/extra/any/devtools/ is now at 20211129-1. ALARM still seems to be at the previous version.

As far as I understand the commit message, one would have to create

setarch-aliases.d/armv6h

in the devtools source directory, with contents

armv6l

then set the basename in the Makefile

SETARCH_ALIASES = \
   armv6h

Then do the same for other architectures as required. All this would ideally be adopted by ALARM when they update their devtools package.

@AladW AladW closed this as completed Dec 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants