sendmail: link with gcc instead of ld 7565/head
authorEneas U de Queiroz <cote2004-github@yahoo.com>
Thu, 18 Jan 2018 11:28:03 +0000 (09:28 -0200)
committerRosen Penev <rosenp@gmail.com>
Mon, 17 Dec 2018 22:57:01 +0000 (14:57 -0800)
If ld is used directly to link libmilter.so, linking is not done
correctly with glibc, and produces a library that can't be used.
Linking with the bad library produces a strange error:
ld: conftest: hidden symbol `stat' in [...]libc_nonshared.a(stat.oS)
is referenced by DSO

Using ld with musl works fine, but using gcc is a more portable way of
linking the shared library anyway.

Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
mail/sendmail/files/OpenWrt
mail/sendmail/files/sharedlibrary.m4

index 00865f01881b44eef36b9e2a68bd44127cd4ec40..c0a01a95bc4c2c4c2b28e0ad97045239d6e755e8 100644 (file)
@@ -13,7 +13,7 @@ APPENDDEF(`confLIBSEARCH', `crypt')
 define(`confMTCCOPTS', `-D_REENTRANT')
 define(`confMTLDOPTS', `-lpthread')
 define(`confLDOPTS_SO', `-shared')
-define(`confSONAME',`-soname')
+define(`confSONAME',`-Wl,-soname')
 
 define(`currentuser', esyscmd(`id -nu'))
 define(`currentgroup', esyscmd(`id -ng'))
index 2c131be8085560af58a081b3ac35f9336c621c71..6096f9016bf0a71f03b9966c9f88428fb0156e38 100644 (file)
@@ -9,7 +9,7 @@ include(confBUILDTOOLSDIR`/M4/'bldM4_TYPE_DIR`/defines.m4')
 divert(bldTARGETS_SECTION)
 
 bldCURRENT_PRODUCT.so.confSOVER: ${BEFORE} ${bldCURRENT_PRODUCT`OBJS'}
-       ${LD} ${LDOPTS_SO} -o bldCURRENT_PRODUCT.so.confSOVER confSONAME bldCURRENT_PRODUCT.so.confSOVER ${bldCURRENT_PRODUCT`OBJS'}
+       ${CC} ${LDOPTS_SO} -o bldCURRENT_PRODUCT.so.confSOVER confSONAME,bldCURRENT_PRODUCT.so.confSOVER ${bldCURRENT_PRODUCT`OBJS'}
 ifdef(`bldLINK_SOURCES', `bldMAKE_SOURCE_LINKS(bldLINK_SOURCES)')
 
 install-`'bldCURRENT_PRODUCT: bldCURRENT_PRODUCT.so.confSOVER