203-opt_flags.patch 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. build: Move optimization flags into a separate variable
  2. Isolate optimization related compiler flags from CFLAGS and move them into a
  3. separate COPTS variable so that it is easier to override optimizations from
  4. the environment.
  5. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
  6. --- a/pppd/plugins/radius/Makefile.linux
  7. +++ b/pppd/plugins/radius/Makefile.linux
  8. @@ -12,7 +12,8 @@ VERSION = $(shell awk -F '"' '/VERSION/
  9. INSTALL = install
  10. PLUGIN=radius.so radattr.so radrealms.so
  11. -CFLAGS=-I. -I../.. -I../../../include -O2 -fPIC -DRC_LOG_FACILITY=LOG_DAEMON
  12. +COPTS = -O2
  13. +CFLAGS=-I. -I../.. -I../../../include $(COPTS) -fPIC -DRC_LOG_FACILITY=LOG_DAEMON
  14. # Uncomment the next line to include support for Microsoft's
  15. # MS-CHAP authentication protocol.
  16. @@ -43,13 +44,13 @@ install: all
  17. $(INSTALL) -c -m 444 pppd-radattr.8 $(MANDIR)
  18. radius.so: radius.o libradiusclient.a
  19. - $(CC) $(LDFLAGS) -o radius.so -shared radius.o libradiusclient.a
  20. + $(CC) $(LDFLAGS) -fPIC -o radius.so -shared radius.o libradiusclient.a
  21. radattr.so: radattr.o
  22. - $(CC) $(LDFLAGS) -o radattr.so -shared radattr.o
  23. + $(CC) $(LDFLAGS) -fPIC -o radattr.so -shared radattr.o
  24. radrealms.so: radrealms.o
  25. - $(CC) $(LDFLAGS) -o radrealms.so -shared radrealms.o
  26. + $(CC) $(LDFLAGS) -fPIC -o radrealms.so -shared radrealms.o
  27. CLIENTOBJS = avpair.o buildreq.o config.o dict.o ip_util.o \
  28. clientid.o sendserver.o lock.o util.o md5.o
  29. --- a/pppdump/Makefile.linux
  30. +++ b/pppdump/Makefile.linux
  31. @@ -2,7 +2,8 @@ DESTDIR = $(INSTROOT)@DESTDIR@
  32. BINDIR = $(DESTDIR)/sbin
  33. MANDIR = $(DESTDIR)/share/man/man8
  34. -CFLAGS= -O -I../include/net
  35. +COPTS = -O
  36. +CFLAGS= $(COPTS) -I../include/net
  37. OBJS = pppdump.o bsd-comp.o deflate.o zlib.o
  38. INSTALL= install
  39. --- a/pppd/plugins/rp-pppoe/Makefile.linux
  40. +++ b/pppd/plugins/rp-pppoe/Makefile.linux
  41. @@ -39,7 +39,7 @@ debug.o: debug.c
  42. $(CC) $(CFLAGS) -c -o debug.o debug.c
  43. rp-pppoe.so: plugin.o discovery.o if.o common.o
  44. - $(CC) $(LDFLAGS) -o rp-pppoe.so -shared plugin.o discovery.o if.o common.o
  45. + $(CC) $(LDFLAGS) -fPIC -o rp-pppoe.so -shared plugin.o discovery.o if.o common.o
  46. install: all
  47. $(INSTALL) -d -m 755 $(LIBDIR)