Clozure / ccl

Clozure Common Lisp
http://ccl.clozure.com
Apache License 2.0
850 stars 103 forks source link

Debian 12.1 based Raspberry Pi needs `-mfpu=vfp` to build lisp kernel #463

Closed xrme closed 10 months ago

xrme commented 10 months ago

From a user on the mailing list:

There is a tiny patch needed for the ARM32 version of RapsberryPI OS based on Debian 12.1.

-mfpu=vfp

needs to be added to the CC rule.

diff --git a/lisp-kernel/linuxarm/Makefile b/lisp-kernel/linuxarm/Makefile
index f92ebd09..40b9aaf7 100644
--- a/lisp-kernel/linuxarm/Makefile
+++ b/lisp-kernel/linuxarm/Makefile
@@ -62,7 +62,7 @@ A32 = $(shell ($(AS) --help -v 2>&1 | grep -q -e "-a32") && /bin/echo "-a32")
.s.o:
        $(M4) $(M4FLAGS) -I../ $< | $(AS) $(A32) $(ASFLAGS) -o $@
.c.o:
-       $(CC) -include ../$(PLATFORM_H) -c $< $(CDEFINES) $(CDEBUG) $(COPT) -marm -march=armv7-a $(FLOAT_ABI_OPTION) $(WFORMAT)  -o $@
+       $(CC) -include ../$(PLATFORM_H) -c $< $(CDEFINES) $(CDEBUG) $(COPT) -marm -march=armv7-a -mfpu=vfp $(FLOAT_ABI_OPTION) $(WFORMAT)  -o $@

SPOBJ = pad.o  arm-spentry.o
ASMOBJ = arm-asmutils.o imports.o
xrme commented 10 months ago

I tried it on a Debian 12 "bookworm" system, and the lisp kernel built successfully.

Apparently -march=armv7-a doesn't imply the presence of an fpu,

I did get a new warning:

/usr/bin/ld: warning: imports.o: missing .note.GNU-stack section implies executable stack
/usr/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker

but that's a separate problem.