doodlewind / react-ssd1306

📟 A React Renderer for SSD1306 OLED chip on Raspberry Pi.

Home Page:https://github.com/doodlewind/react-ssd1306/blob/master/docs/tutorial.md

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compiling QuickJS

doodlewind opened this issue · comments

If you have trouble compiling QuickJS on Raspberry Pi, just link the atomic lib as seem in this discussion, this following patch should work:

diff --git a/Makefile b/Makefile
index efd3a32..3150f80 100644
--- a/Makefile
+++ b/Makefile
@@ -33,6 +33,10 @@ CONFIG_LTO=y
 #CONFIG_WERROR=y
 # force 32 bit build for some utilities
 #CONFIG_M32=y
+# compilation on ARM Linux
+ifeq ($(shell uname -m),armv7l)
+CONFIG_ARMV7=y
+endif
 ifdef CONFIG_DARWIN
 # use clang instead of gcc

@@ -167,6 +171,9 @@ LIBS=-lm
 ifndef CONFIG_WIN32
 LIBS+=-ldl
 endif
+ifdef CONFIG_ARMV7
+LIBS+=-latomic
+endif
 $(OBJDIR):
 	mkdir -p $(OBJDIR) $(OBJDIR)/examples $(OBJDIR)/tests

You can also simply change LIBS=-lm to LIBS=-lm -latomic in makefile :D