[quickjs-devel] [PATCH] Makefile: allow linking with extra libraries

  • From: Peter Seiderer <ps.report@xxxxxxx>
  • To: quickjs-devel@xxxxxxxxxxxxx
  • Date: Sat, 9 Jan 2021 20:43:46 +0100

With some toolchains, it is neede to link with extra libraries, for
example with -latomic, to fix:

  .../build/quickjs-2020-11-08/quickjs.c:12229: undefined reference to 
`__atomic_fetch_xor_1'

Fixes:
  
http://autobuild.buildroot.net/results/e0766eef95a2559d51e58d1a81a9c40df84ae509

Signed-off-by: Peter Seiderer <ps.report@xxxxxxx>
[yann.morin.1998@xxxxxxx:
  - make it a generic variable, not tied to -latomic
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@xxxxxxx>
---
Notes:

  - see [1] for details of usage in buildroot

  [1] 
https://git.buildroot.net/buildroot/commit/?id=ac992501e36aa1747d8633658f08694c6600b78e
---
 Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Makefile b/Makefile
index e6ae827..147dcb3 100644
--- a/Makefile
+++ b/Makefile
@@ -179,6 +179,7 @@ LIBS=-lm
 ifndef CONFIG_WIN32
 LIBS+=-ldl -lpthread
 endif
+LIBS+=$(EXTRA_LIBS)
 
 $(OBJDIR):
        mkdir -p $(OBJDIR) $(OBJDIR)/examples $(OBJDIR)/tests
-- 
2.29.2

Other related posts:

  • » [quickjs-devel] [PATCH] Makefile: allow linking with extra libraries - Peter Seiderer