[hackers] [surf][PATCH] webextension: fix linking with common.o

From: nzl <uruabi_AT_gmail.com>
Date: Sun, 06 Jan 2019 18:37:21 +0000

libsurf-webext.so is not linked with common.o, could test this by calling die
at the entry point of webext, it crashes (died though).
---
 Makefile | 4 ++--
 common.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index cdbd8ad..5f32d4d 100644
--- a/Makefile
+++ b/Makefile
_AT_@ -6,7 +6,7 @@ include config.mk
 
 SRC = surf.c common.c
 OBJ = $(SRC:.c=.o)
-WEBEXTSRC = libsurf-webext.c
+WEBEXTSRC = libsurf-webext.c common.c
 WEBEXTOBJ = $(WEBEXTSRC:.c=.o)
 
 all: options libsurf-webext.so surf
_AT_@ -30,7 +30,7 @@ $(WEBEXTOBJ): $(WEBEXTSRC) config.h common.h config.mk
 	$(CC) $(WEBEXTCFLAGS) $(CFLAGS) -c $(WEBEXTSRC)
 
 libsurf-webext.so: $(WEBEXTOBJ)
-	$(CC) -shared -Wl,-soname,$_AT_ $(LDFLAGS) -o $@ $< $(WEBEXTLIBS) -lc
+	$(CC) -shared -Wl,-soname,$_AT_ $(LDFLAGS) -o $@ $(WEBEXTOBJ) $(WEBEXTLIBS) -lc
 
 surf: $(OBJ)
 	$(CC) $(SURFLDLAGS) $(LDFLAGS) -o $_AT_ $(OBJ) $(LIBS)
diff --git a/common.h b/common.h
index 527c4f7..37f57b3 100644
--- a/common.h
+++ b/common.h
_AT_@ -1,3 +1,3 @@
 #define MSGBUFSZ 32
 
-void die(char *, ...);
+void die(const char *, ...);
-- 
2.19.1
Received on Sun Jan 06 2019 - 19:37:21 CET

This archive was generated by hypermail 2.3.0 : Sun Jan 06 2019 - 19:48:23 CET