Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 866542

Summary: dev-scheme/chez: ~arm keywording request
Product: Gentoo Linux Reporter: Maciej Barć <xgqt>
Component: KeywordingAssignee: Scheme Project <scheme>
Status: RESOLVED FIXED    
Severity: normal CC: arthurzam, matoro_bugzilla_gentoo, matthew
Priority: Normal Keywords: CC-ARCHES, KEYWORDREQ
Version: unspecifiedFlags: nattka: sanity-check+
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
dev-scheme/chez ~arm
Runtime testing required: ---
Attachments:
Description Flags
armv7a-emerge-info
none
arm7-build-log none

Description Maciej Barć gentoo-dev 2022-08-25 16:16:43 UTC
Add missing keywords for two other officially supporte architectures.

https://cisco.github.io/ChezScheme/release_notes/v9.5/release_notes.html

> Linux ARMv6 (32-bit), nonthreaded (arm32le)
> Linux PowerPC (32-bit), nonthreaded (ppc32le) and threaded (tppc32le)
Comment 1 ernsteiswuerfel archtester 2022-10-02 10:30:07 UTC
There may be ppc32le in the wild (?) but not on Gentoo.

 # eselect profile list
Available profile symlink targets:
  [1]   default/linux/powerpc/ppc64/17.0/32bit-userland (stable)
  [2]   default/linux/powerpc/ppc64/17.0/32bit-userland/desktop (stable)
  [3]   default/linux/powerpc/ppc64/17.0/32bit-userland/desktop/gnome (stable)
  [4]   default/linux/powerpc/ppc64/17.0/32bit-userland/desktop/gnome/systemd (stable)
  [5]   default/linux/powerpc/ppc64/17.0/32bit-userland/developer (exp)
  [6]   default/linux/ppc/17.0 (stable)
  [7]   default/linux/ppc/17.0/desktop (stable)
  [8]   default/linux/ppc/17.0/desktop/gnome (stable)
  [9]   default/linux/ppc/17.0/desktop/gnome/systemd (stable) *
  [10]  default/linux/ppc/17.0/desktop/gnome/systemd/merged-usr (dev)
  [11]  default/linux/ppc/17.0/systemd (stable)
  [12]  default/linux/ppc/17.0/systemd/merged-usr (dev)
  [13]  default/linux/ppc/17.0/developer (exp)
  [14]  default/linux/ppc/17.0/musl (exp)
  [15]  default/linux/ppc/17.0/musl/hardened (exp)
Comment 2 Maciej Barć gentoo-dev 2022-10-02 20:14:31 UTC
(In reply to ernsteiswuerfel from comment #1)
> There may be ppc32le in the wild (?) but not on Gentoo.
> 
>  # eselect profile list
> Available profile symlink targets:
>   [1]   default/linux/powerpc/ppc64/17.0/32bit-userland (stable)
>   [2]   default/linux/powerpc/ppc64/17.0/32bit-userland/desktop (stable)
>   [3]   default/linux/powerpc/ppc64/17.0/32bit-userland/desktop/gnome
> (stable)
>   [4]  
> default/linux/powerpc/ppc64/17.0/32bit-userland/desktop/gnome/systemd
> (stable)
>   [5]   default/linux/powerpc/ppc64/17.0/32bit-userland/developer (exp)
>   [6]   default/linux/ppc/17.0 (stable)
>   [7]   default/linux/ppc/17.0/desktop (stable)
>   [8]   default/linux/ppc/17.0/desktop/gnome (stable)
>   [9]   default/linux/ppc/17.0/desktop/gnome/systemd (stable) *
>   [10]  default/linux/ppc/17.0/desktop/gnome/systemd/merged-usr (dev)
>   [11]  default/linux/ppc/17.0/systemd (stable)
>   [12]  default/linux/ppc/17.0/systemd/merged-usr (dev)
>   [13]  default/linux/ppc/17.0/developer (exp)
>   [14]  default/linux/ppc/17.0/musl (exp)
>   [15]  default/linux/ppc/17.0/musl/hardened (exp)


I do not understand Your confusion.

The fact that Chez supports nonthreaded (ppc32le) and threaded (tppc32le) PowerPC 32-bit combinations means that it fully supports the whole PowerPC 32-bit systems.

From "https://wiki.gentoo.org/wiki/Project:PowerPC":

> We often say 'ppc' instead of 'ppc32' (just like with arm).

so... We do have a profile for this - "default/linux/ppc/17.0".
Comment 3 ernsteiswuerfel archtester 2022-10-02 20:37:50 UTC
(In reply to Maciej Barć from comment #2)
> The fact that Chez supports nonthreaded (ppc32le) and threaded (tppc32le)
> PowerPC 32-bit combinations means that it fully supports the whole PowerPC
> 32-bit systems.
> 
> From "https://wiki.gentoo.org/wiki/Project:PowerPC":
> 
> > We often say 'ppc' instead of 'ppc32' (just like with arm).
> 
> so... We do have a profile for this - "default/linux/ppc/17.0".
Yes, we have this profile and yes we often say 'ppc' instead of 'ppc32'. But unlike arm ppc/ppc32 on Gentoo is Big Endian. We only got Little Endian profiles for ppc64, not for ppc32.

So if upstream chez says they support ppc32le I am a bit confused indeed...
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-10-29 21:15:41 UTC Comment hidden (obsolete)
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-10-30 21:40:29 UTC
It turns out it really does support big endian, thanks q66, and "le" is something like "linux environment". Weird...
Comment 6 Maciej Barć gentoo-dev 2022-10-30 22:02:55 UTC
I guess I have to be more descriptive.

What I menat by 

>The fact that Chez supports nonthreaded (ppc32le) and threaded (tppc32le) PowerPC 32-bit combinations means that it fully supports the whole PowerPC 32-bit systems.

was that ppc32le == PPC32 nonthreaded and tppc32le == PPC32 threaded and endianess is not mentioned.
Comment 7 Arthur Zamarin archtester Gentoo Infrastructure gentoo-dev Security 2022-11-22 15:47:16 UTC
I wanted to check that ppc32 (called ppc in gentoo) is indeed wanted here, cause I get failure of:

> >>> Configuring source in /var/tmp/portage/dev-scheme/chez-9.5.8-r1/work/csv9.5.8 ...
> no suitable machine type found
> try rerunning as ./configure -m=<machine type>
> available machine types: a6le, a6nt, a6osx, arm32le, i3le, i3nt, i3osx, ta6le, ta6nt, ta6osx, ti3le, ti3nt, and ti3osx


If irrelevant, please remove ppc from cc :)
Comment 8 Maciej Barć gentoo-dev 2022-11-22 20:59:09 UTC
(In reply to Arthur Zamarin from comment #7)
> I wanted to check that ppc32 (called ppc in gentoo) is indeed wanted here,
> cause I get failure of:
> 
> > >>> Configuring source in /var/tmp/portage/dev-scheme/chez-9.5.8-r1/work/csv9.5.8 ...
> > no suitable machine type found
> > try rerunning as ./configure -m=<machine type>
> > available machine types: a6le, a6nt, a6osx, arm32le, i3le, i3nt, i3osx, ta6le, ta6nt, ta6osx, ti3le, ti3nt, and ti3osx
> 
> 
> If irrelevant, please remove ppc from cc :)

So if...

> available machine types: a6le, a6nt, a6osx, arm32le, i3le, i3nt, i3osx, ta6le, ta6nt, ta6osx, ti3le, ti3nt, and ti3osx

and, well...

> Linux PowerPC (32-bit), nonthreaded (ppc32le) and threaded (tppc32le)

...so no ppc there, weird

Let's drop ppc then :(
Comment 9 matoro archtester 2023-12-07 05:44:01 UTC
arm doesn't work either

>>> Configuring source in /var/tmp/portage/dev-scheme/chez-9.6.4/work/csv9.6.4 ...
no suitable machine type found
try rerunning as ./configure -m=<machine type>
available machine types: a6le, a6nt, a6osx, arm32le, i3le, i3nt, i3osx, ta6le, ta6nt, ta6osx, ti3le, ti3nt, and ti3osx

Per the release notes I also tried armv6j but it also is not detected.
Comment 10 Maciej Barć gentoo-dev 2023-12-07 08:10:47 UTC
(In reply to matoro from comment #9)
> arm doesn't work either
> 
> >>> Configuring source in /var/tmp/portage/dev-scheme/chez-9.6.4/work/csv9.6.4 ...
> no suitable machine type found
> try rerunning as ./configure -m=<machine type>
> available machine types: a6le, a6nt, a6osx, arm32le, i3le, i3nt, i3osx,
> ta6le, ta6nt, ta6osx, ti3le, ti3nt, and ti3osx
> 
> Per the release notes I also tried armv6j but it also is not detected.

arm32le is clearly in the "available machine types", 
this looks different than Racket's configure script btw

can you try running with threads disabled on arm32le?
Comment 11 Maciej Barć gentoo-dev 2023-12-07 08:12:13 UTC
Note: Alpine sets machine type explicitly https://git.alpinelinux.org/aports/tree/community/chez-scheme/APKBUILD#n34
Comment 12 matoro archtester 2023-12-07 15:41:07 UTC
(In reply to Maciej Barć from comment #11)
> Note: Alpine sets machine type explicitly
> https://git.alpinelinux.org/aports/tree/community/chez-scheme/APKBUILD#n34

OK, I'll push up a PR to copy the Alpine logic
Comment 13 Maciej Barć gentoo-dev 2023-12-07 15:57:49 UTC
(In reply to matoro from comment #12)
> (In reply to Maciej Barć from comment #11)
> > Note: Alpine sets machine type explicitly
> > https://git.alpinelinux.org/aports/tree/community/chez-scheme/APKBUILD#n34
> 
> OK, I'll push up a PR to copy the Alpine logic

Do we need more then this?:

	# "t" for threading + arch_map + "le" for Linux (hardcoded for now)
	local -A arch_map=(
		[amd64]=a6
		[arm]=arm32
		[ppc]=ppc32
		[x86]=i3
	)
	local machine="$(usex threads 't' '')${arch_map[${ARCH}]}le"

We will have to restrict USE=threads on arm profile.
Comment 14 Maciej Barć gentoo-dev 2023-12-07 22:08:25 UTC
I updated the ebuild to support chez's --machine translation but compilation fails for me in a arm7 qemu chroot with following:

> /usr/bin/make allx
> rm -f *.arm32le xpatch patch *.patch *.so *.covin *.asm script.all header.tmp *.html
> rm -rf nanopass
> cp -p -f ../boot/arm32le/petite.boot ../boot/arm32le/sbb
> cp -p -f ../boot/arm32le/scheme.boot ../boot/arm32le/scb
> /usr/bin/make all
> echo '(reset-handler abort)'\
>              '(base-exception-handler (lambda (c) (fresh-line) (display-condition c) (newline) (reset)))'\
>              '(keyboard-interrupt-handler (lambda () (display "interrupted---aborting\n") (reset)))'\
>              '(optimize-level 3)'\
>              '(debug-level 0)'\
>              '(commonization-level (commonization-level))'\
>              '(fasl-compressed #t)'\
>              '(compress-format (compress-format))'\
>              '(compress-level (compress-level))'\
>              '(generate-inspector-information #f)'\
>              '(subset-mode (quote system))'\
>              '(compile-file "cmacros.ss" "cmacros.so")'\
>              | ../bin/arm32le/scheme -q
> sizeof(time_t) * 8 [8] != time_t_bits [32]
> make[4]: *** [Mf-base:372: cmacros.so] Error 1
> make[3]: *** [Mf-base:176: allx] Error 2
> make[2]: *** [Mf-base:193: bootstrap] Error 2
> make[1]: *** [Makefile:22: build] Error 2
> make: *** [Makefile:20: build] Error 2


Chroot:
> Portage 3.0.56 (python 3.11.6-final-0, default/linux/arm/17.0/musl/armv7a, gcc-13, musl-1.2.3-r7, 6.1.57-gentoo-magentalane-0-local-workstation-2023.10.11 armv7l)

We will have to either delay stabilization until we have a patch for this or mask it on some other profile, but I do not know if the above error will occur on every ARM profile or this one?

Im going to push the updated ebuild.
Comment 15 Maciej Barć gentoo-dev 2023-12-07 22:12:29 UTC
Created attachment 878184 [details]
armv7a-emerge-info
Comment 16 Maciej Barć gentoo-dev 2023-12-07 22:14:46 UTC
Created attachment 878185 [details]
arm7-build-log
Comment 17 matoro archtester 2024-01-03 02:30:28 UTC
arm done

all arches done