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

shtps via Gforth discussion and announcements <gforth-mXXj517/[email protected]> Fri, 20 Dec 2024 21:13:04 +0000
Newsgroups gmane.comp.lang.forth.gforth
Message-ID <o0fVMeakCWF-eoUtN-tHHnUzd2vgK2CDEU3impsqn31MGBrUUPqY8pldywKgPr8onJ-D00cp641VITgD3TT6vVs_MVXHPN7A8_7FQYcOaXY=@protonmail.com>
On Friday, December 20th, 2024 at 12:08 AM, Bernd Paysan <[email protected]> w=
rote:

> Am Donnerstag, 19. Dezember 2024, 21:57:15 Mitteleurop=C3=A4ische Normalz=
eit
> schrieb shtps via Gforth discussion and announcements:
>=20
> > Hello
> >=20
> > I am unable to build gforth-0.7.9_20241211 on GNU/Linux (Debian 12) wit=
h 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 U=
TC
> > 2023 armv7l GNU/Linux
> >=20
> > I've followed the instructions in INSTALL.md for the tarball build with=
 the
> > 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=
 lacks 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 th=
e
> > $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=
 with
> > and without hard floating point and also soft floating point. If the bu=
ild
> > 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 custo=
m
> > CFLAGS listed above.
> >=20
> > Any idea what the issue may be?
>=20
>=20
> From the configure script, which modifies the CFLAGS for Android (but not
> Linux), I would suggest:
>=20
> CFLAGS=3D"$CFLAGS -march=3Darmv7-a -mfloat-abi=3Dsoftfp -mfpu=3Dvfp"
>=20
> This works on a wide range of Android phone CPUs, of which that Exynos is=
 one.
>=20
> That snapshot (20241211) had a problem with an uninitialized variable, so=
 try
> the latest one (20241218).
>=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/

Thank you, I was able to build it with that snapshot and the following opti=
ons:

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

Best Regards