Closed glysbaysb closed 4 years ago
The patch being:
$ cat 0001-link-order-matters.patch
From 1cce2cfd176414770f3c2d6cf6920562c77c508e Mon Sep 17 00:00:00 2001
From: Geert Ijewski <gm.ijewski@web.de>
Date: Tue, 21 Apr 2020 19:04:25 +0200
Subject: [PATCH] link order matters
---
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 0964497..72f2f50 100644
--- a/Makefile
+++ b/Makefile
@@ -14,12 +14,12 @@ libschrift.a: schrift.o
schrift.o: schrift.h
sftdemo: sftdemo.o libschrift.a
- $(LD) $(LDFLAGS) $< -o $@ -L$(X11LIB) -L. -lX11 -lXrender -lschrift
+ $(LD) $(LDFLAGS) $< -o $@ -L$(X11LIB) -L. -lX11 -lXrender -lschrift -lm
sftdemo.o: sftdemo.c schrift.h arg.h
$(CC) -c $(CFLAGS) $< -o $@ $(CPPFLAGS) -I$(X11INC)
stress: stress.o libschrift.a
- $(LD) $(LDFLAGS) $< -o $@ -L. -lschrift
+ $(LD) $(LDFLAGS) $< -o $@ -L. -lschrift -lm
stress.o: stress.c schrift.h arg.h
$(CC) -c $(CFLAGS) $< -o $@ $(CPPFLAGS)
--
2.20.1
Interesting. I'm basically using the same toolchain but I never hit this problem. I don't have time to do this right now, but I'll apply the patch to master ASAP. Thank you very much!
The order libraries are passed to the linker matters, more specfially all external libraries should be at the end.
The current master can not be built
After applying a simple patch it does build.
For completness sake my toolchain is: