[mw-devel] [Git][arthur/mw][master] Link with --as-needed

Andrew Price welshbyte at sucs.org
Tue Nov 28 10:52:39 GMT 2017


Andrew Price pushed to branch master at Justin Mitchell / mw


Commits:
dd30057e by Andrew Price at 2017-11-28T10:36:44+00:00
Link with --as-needed

- - - - -


3 changed files:

- Makefile.common
- src/server/Makefile
- src/webclient/Makefile


Changes:

=====================================
Makefile.common
=====================================
--- a/Makefile.common
+++ b/Makefile.common
@@ -72,6 +72,8 @@ MWCFLAGS = -std=gnu99 -g $(DEFS) $(CCSEC) $(WARNINGS)
 ifeq ($(UNAME),FreeBSD)
 MWCFLAGS += -I/usr/local/include
 MWLDFLAGS = -L/usr/local/lib
+else
+MWLDFLAGS += -Wl,--as-needed
 endif
 ifneq ($(RELEASE_BUILD),0)
 MWCFLAGS += -O2


=====================================
src/server/Makefile
=====================================
--- a/src/server/Makefile
+++ b/src/server/Makefile
@@ -16,7 +16,7 @@ LDLIBS += -ljansson -lsqlite3
 build: mwserv
 
 mwserv: $(CODE:.c=.o) ../libmw.a
-	$(CC) $(LDFLAGS) $(LDLIBS) -o $@ $^
+	$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS)
 
 clean:
 	-rm -f *.o .*.d *.d mwserv


=====================================
src/webclient/Makefile
=====================================
--- a/src/webclient/Makefile
+++ b/src/webclient/Makefile
@@ -8,7 +8,7 @@ CFLAGS+= -I.. -I/usr/include/postgresql
 build: mwpoll
 
 mwpoll: mwpoll.o import.o comms.o mwstring.o ../libmw.a
-	$(CC) $(LDFLAGS) $(LDLIBS) -o $@ $^
+	$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS)
 
 clean:
 	-rm -f *.o .*.d *.d mwpoll



View it on GitLab: https://projects.sucs.org/arthur/mw/commit/dd30057ea44a61e72cff71e0cae17239d1815f04

---
View it on GitLab: https://projects.sucs.org/arthur/mw/commit/dd30057ea44a61e72cff71e0cae17239d1815f04
You're receiving this email because of your account on projects.sucs.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sucs.org/pipermail/mw-devel/attachments/20171128/bad561aa/attachment-0001.html>


More information about the mw-devel mailing list