exim-4.88-as-needed-ldflags.patch 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. https://bugs.gentoo.org/show_bug.cgi?id=352265
  2. Make sure LDFLAGS comes first, such that all libraries are considered,
  3. and not discarded when --as-needed is in effect.
  4. https://bugs.gentoo.org/show_bug.cgi?id=391279
  5. Use LDFLAGS for all targets, not just the exim binary, such that
  6. --as-needed works as well.
  7. --- OS/Makefile-Base
  8. +++ OS/Makefile-Base
  9. @@ -346,12 +346,12 @@
  10. buildrouters buildtransports \
  11. $(OBJ_EXIM) version.o
  12. @echo "$(LNCC) -o exim"
  13. - $(FE)$(PURIFY) $(LNCC) -o exim $(LFLAGS) $(OBJ_EXIM) version.o \
  14. + $(FE)$(PURIFY) $(LNCC) -o exim $(LDFLAGS) $(OBJ_EXIM) version.o \
  15. routers/routers.a transports/transports.a lookups/lookups.a \
  16. auths/auths.a pdkim/pdkim.a \
  17. $(LIBRESOLV) $(LIBS) $(LIBS_EXIM) $(IPV6_LIBS) $(EXTRALIBS) \
  18. $(EXTRALIBS_EXIM) $(DBMLIB) $(LOOKUP_LIBS) $(AUTH_LIBS) \
  19. - $(PERL_LIBS) $(TLS_LIBS) $(PCRE_LIBS) $(LDFLAGS)
  20. + $(PERL_LIBS) $(TLS_LIBS) $(PCRE_LIBS) $(LFLAGS)
  21. @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
  22. echo $(STRIP_COMMAND) exim; \
  23. $(STRIP_COMMAND) exim; \
  24. @@ -367,8 +367,8 @@
  25. exim_dumpdb: $(OBJ_DUMPDB)
  26. @echo "$(LNCC) -o exim_dumpdb"
  27. - $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_dumpdb $(LFLAGS) $(OBJ_DUMPDB) \
  28. - $(LIBS) $(EXTRALIBS) $(DBMLIB)
  29. + $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_dumpdb $(LDFLAGS) $(OBJ_DUMPDB) \
  30. + $(LIBS) $(EXTRALIBS) $(DBMLIB) $(LFLAGS)
  31. @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
  32. echo $(STRIP_COMMAND) exim_dumpdb; \
  33. $(STRIP_COMMAND) exim_dumpdb; \
  34. @@ -382,8 +382,8 @@
  35. exim_fixdb: $(OBJ_FIXDB) buildauths
  36. @echo "$(LNCC) -o exim_fixdb"
  37. - $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_fixdb $(LFLAGS) $(OBJ_FIXDB) \
  38. - auths/auths.a $(LIBS) $(EXTRALIBS) $(DBMLIB)
  39. + $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_fixdb $(LDFLAGS) $(OBJ_FIXDB) \
  40. + auths/auths.a $(LIBS) $(EXTRALIBS) $(DBMLIB) $(LFLAGS)
  41. @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
  42. echo $(STRIP_COMMAND) exim_fixdb; \
  43. $(STRIP_COMMAND) exim_fixdb; \
  44. @@ -397,8 +397,8 @@
  45. exim_tidydb: $(OBJ_TIDYDB)
  46. @echo "$(LNCC) -o exim_tidydb"
  47. - $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_tidydb $(LFLAGS) $(OBJ_TIDYDB) \
  48. - $(LIBS) $(EXTRALIBS) $(DBMLIB)
  49. + $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_tidydb $(LDFLAGS) $(OBJ_TIDYDB) \
  50. + $(LIBS) $(EXTRALIBS) $(DBMLIB) $(LFLAGS)
  51. @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
  52. echo $(STRIP_COMMAND) exim_tidydb; \
  53. $(STRIP_COMMAND) exim_tidydb; \
  54. @@ -410,8 +410,8 @@
  55. exim_dbmbuild: exim_dbmbuild.o
  56. @echo "$(LNCC) -o exim_dbmbuild"
  57. - $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_dbmbuild $(LFLAGS) exim_dbmbuild.o \
  58. - $(LIBS) $(EXTRALIBS) $(DBMLIB)
  59. + $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_dbmbuild $(LDFLAGS) exim_dbmbuild.o \
  60. + $(LIBS) $(EXTRALIBS) $(DBMLIB) $(LFLAGS)
  61. @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
  62. echo $(STRIP_COMMAND) exim_dbmbuild; \
  63. $(STRIP_COMMAND) exim_dbmbuild; \
  64. @@ -425,8 +425,8 @@
  65. @echo "$(CC) exim_lock.c"
  66. $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) exim_lock.c
  67. @echo "$(LNCC) -o exim_lock"
  68. - $(FE)$(LNCC) -o exim_lock $(LFLAGS) exim_lock.o \
  69. - $(LIBS) $(EXTRALIBS)
  70. + $(FE)$(LNCC) -o exim_lock $(LDFLAGS) exim_lock.o \
  71. + $(LIBS) $(EXTRALIBS) $(LFLAGS)
  72. @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
  73. echo $(STRIP_COMMAND) exim_lock; \
  74. $(STRIP_COMMAND) exim_lock; \
  75. @@ -462,9 +462,9 @@
  76. $(FE)$(CC) -o em_version.o -c \
  77. $(CFLAGS) $(XINCLUDE) -I. ../exim_monitor/em_version.c
  78. @echo "$(LNCC) -o eximon.bin"
  79. - $(FE)$(PURIFY) $(LNCC) -o eximon.bin em_version.o $(LFLAGS) $(XLFLAGS) \
  80. + $(FE)$(PURIFY) $(LNCC) -o eximon.bin em_version.o $(LDFLAGS) $(XLFLAGS) \
  81. $(OBJ_MONBIN) -lXaw -lXmu -lXt -lXext -lX11 $(PCRE_LIBS) \
  82. - $(LIBS) $(LIBS_EXIMON) $(EXTRALIBS) $(EXTRALIBS_EXIMON) -lc
  83. + $(LIBS) $(LIBS_EXIMON) $(EXTRALIBS) $(EXTRALIBS_EXIMON) -lc $(LFLAGS)
  84. @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
  85. echo $(STRIP_COMMAND) eximon.bin; \
  86. $(STRIP_COMMAND) eximon.bin; \
  87. @@ -779,9 +779,9 @@
  88. test_dbfn: config.h dbfn.c dummies.o sa-globals.o sa-os.o store.o \
  89. string.o tod.o version.o utf8.o
  90. $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE dbfn.c
  91. - $(LNCC) -o test_dbfn $(LFLAGS) dbfn.o \
  92. + $(LNCC) -o test_dbfn $(LDFLAGS) dbfn.o \
  93. dummies.o sa-globals.o sa-os.o store.o string.o \
  94. - tod.o version.o utf8.o $(LIBS) $(DBMLIB) $(LDFLAGS)
  95. + tod.o version.o utf8.o $(LIBS) $(DBMLIB) $(LFLAGS)
  96. rm -f dbfn.o
  97. test_host: config.h child.c host.c dns.c dummies.c sa-globals.o os.o \
  98. @@ -790,29 +790,29 @@
  99. $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST host.c
  100. $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST dns.c
  101. $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST dummies.c
  102. - $(LNCC) -o test_host $(LFLAGS) \
  103. + $(LNCC) -o test_host $(LDFLAGS) \
  104. host.o child.o dns.o dummies.o sa-globals.o os.o store.o string.o \
  105. - tod.o tree.o $(LIBS) $(LIBRESOLV)
  106. + tod.o tree.o $(LIBS) $(LIBRESOLV) $(LFLAGS)
  107. rm -f child.o dummies.o host.o dns.o
  108. test_os: os.h os.c dummies.o sa-globals.o store.o string.o tod.o utf8.o
  109. $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE os.c
  110. - $(LNCC) -o test_os $(LFLAGS) os.o dummies.o \
  111. - sa-globals.o store.o string.o tod.o utf8.o $(LIBS) $(LDFLAGS)
  112. + $(LNCC) -o test_os $(LDFLAGS) os.o dummies.o \
  113. + sa-globals.o store.o string.o tod.o utf8.o $(LIBS) $(LFLAGS)
  114. rm -f os.o
  115. test_parse: config.h parse.c dummies.o sa-globals.o \
  116. store.o string.o tod.o version.o utf8.o
  117. $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE parse.c
  118. - $(LNCC) -o test_parse $(LFLAGS) parse.o \
  119. + $(LNCC) -o test_parse $(LDFLAGS) parse.o \
  120. dummies.o sa-globals.o store.o string.o tod.o version.o \
  121. - utf8.o $(LDFLAGS)
  122. + utf8.o $(LFLAGS)
  123. rm -f parse.o
  124. test_string: config.h string.c dummies.o sa-globals.o store.o tod.o utf8.o
  125. $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE string.c
  126. - $(LNCC) -o test_string $(LFLAGS) -DSTAND_ALONE string.o \
  127. - dummies.o sa-globals.o store.o tod.o utf8.o $(LIBS) $(LDFLAGS)
  128. + $(LNCC) -o test_string $(LDFLAGS) -DSTAND_ALONE string.o \
  129. + dummies.o sa-globals.o store.o tod.o utf8.o $(LIBS) $(LFLAGS)
  130. rm -f string.o
  131. # End