Re: Unable to build Gforth 0.7.9 on GNU/Linux ARM

Bernd Paysan <[email protected]> Fri, 20 Dec 2024 00:08:07 +0100
Newsgroups gmane.comp.lang.forth.gforth
Message-ID <4761209.UPlyArG6xL@wukong>
--nextPart6023459.ZASKD2KPVS
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="utf-8"; protected-headers="v1"
From: Bernd Paysan <[email protected]>
To: "gforth-mXXj517/[email protected]" <gforth-mXXj517/[email protected]>
Cc: shtps <shtps-g/[email protected]>
Subject: Re: Unable to build Gforth 0.7.9 on GNU/Linux ARM
Date: Fri, 20 Dec 2024 00:08:07 +0100
Message-ID: <4761209.UPlyArG6xL@wukong>
MIME-Version: 1.0

Am Donnerstag, 19. Dezember 2024, 21:57:15 Mitteleurop=C3=A4ische Normalzei=
t=20
schrieb shtps via Gforth discussion and announcements:
> Hello
>=20
> I am unable to build gforth-0.7.9_20241211 on GNU/Linux (Debian 12) with a
> Samsung's Exynos 5422 8-core 32bit ARMv7 CPU.
>=20
> $ uname -a
> Linux odroid 6.3.1-armmp-lpae #exynos5 SMP PREEMPT Mon May 8 15:27:00 UTC
> 2023 armv7l GNU/Linux
>=20
> I've followed the instructions in INSTALL.md for the tarball build with t=
he
> default options. ./configure succeeds but make fails with:
>=20
> make[1]: Entering directory '/home/shtps/gforth-0.7.9_20241211/engine'
> CC -o io.o io.c
> cc1: error: =E2=80=98-mfloat-abi=3Dhard=E2=80=99: selected architecture l=
acks an FPU
> make[1]: *** [Makefile:142: io.o] Error 1
> make[1]: Leaving directory '/home/shtps/gforth-0.7.9_20241211/engine'
> make: *** [Makefile:1457: engine/io.o] Error 2
>=20
> I've attempted to solve this by modifying configure.ac. I've changed the
> $host_cpu switch statement with the CFLAGS for gnueabihf from
>=20
> CFLAGS=3D"$CFLAGS -marm -march=3Darmv6"
>=20
> to
>=20
> CFLAGS=3D"$CFLAGS -mcpu=3Dgeneric-armv7-a"
>=20
> With this I was able to get it to proceed the build, however I now get a
> segfault during what seems to be the image generation for gforth-light.fi.
> I also tried various other flags, like -mcpu=3Dnative and various flags w=
ith
> and without hard floating point and also soft floating point. If the build
> proceeds without compiler errors the same image generation part always
> segfaults.
>=20
> Attached you will find the logs for both the defaults and with my custom
> CFLAGS listed above.
>=20
> Any idea what the issue may be?

=46rom the configure script, which modifies the CFLAGS for Android (but not=
=20
Linux), I would suggest:

CFLAGS=3D"$CFLAGS -march=3Darmv7-a -mfloat-abi=3Dsoftfp -mfpu=3Dvfp"

This works on a wide range of Android phone CPUs, of which that Exynos is o=
ne.

That snapshot (20241211) had a problem with an uninitialized variable, so t=
ry=20
the latest one (20241218).

=2D-=20
Bernd Paysan
"If you want it done right, you have to do it yourself"
net2o id: kQusJzA;7*?t=3Duy@X}1GWr!+0qqp_Cn176t4(dQ*
https://net2o.de/

--nextPart6023459.ZASKD2KPVS
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part.
Content-Transfer-Encoding: 7Bit

-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEERJ1NDqPQRwYnwBjr9y2Uk5MtoGcFAmdkp1cACgkQ9y2Uk5Mt
oGc4/w//Um9eTqxGYm2G8iZyQfuUz0cteMrXwBjW894JjsBjvQRxbTf5oiv+LzuM
Hb1b91nG+UXHeYT3NOlm9ItXVoKflyVWdDDcQ8IL+BWQE/8iuICs5giutRYCD10C
TMzw4xbwjM/D5I8shvi4niqp0hE3bySjGdONjVOBt24cJMRhW2DLImhjlNJbs9lc
ZxIIyBX1K4slphmMkpX3lgtPp6lEXKuY9DppbspfCznyuI0BgqkY8pk6tNp7f9Q9
S/ZzMzAEfzJZgM0r78AwebqAxv4gzZRFm54Io9wT0YcPotvAlDf49m+mrUGbzfyI
heqkiQ2wtcRxmIgdRI92GJowSEmPezbE50NPoTDp7H+CiR7XkwwKolQGfsTfB0Ro
Y1sPajxJJRlaqvWhn/FsJIXzzlTWiYZwkNKHm8gzY4D2yz6dO4Kq1L47EVe1DZX6
39BlzZONqGkMiXL/13NaTSyzbyzH2Js73fgdrhN7Vb47G/rcDWwLPYCVulzh1wMh
5MkzUDbP0QMVmjm0TjoqD8DuskTT3HkX3TXTWmhF6ZLiLxcjgdYd88zD5OjijnFp
2dcaQ3bZR/oxu+lOjfEJFH4J61AzHQsAExG6dSiygCVaB3jPCHh0MBelH8a1wPMm
1u1xDNYsYJTlK7p9YdK7uwva3MV7omb6mVwZYlooRCC/cnmX634=
=EjvQ
-----END PGP SIGNATURE-----

--nextPart6023459.ZASKD2KPVS--