Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
08-17-2025, 07:55 PM
|
#1
|
|
LQ Newbie
Registered: Jun 2010
Posts: 20
Rep:
|
Sendmail-8.18.1 build undefined reference
I have seen this problem posted on LinuxQuestions in reference to an earlier Sendmail build but the solution is not available due to an insecure link. I believe the solution is in the configuration of site.config.m4 but I am stumped.
Below is the error I get attempting to build Sendmail-8.18.1:
/bin/ld: domain.o: in function `getmxrr':
domain.c.text+0x156): undefined reference to `__res_search'
/bin/ld: domain.c.text+0x240): undefined reference to `__dn_skipname'
/bin/ld: domain.c.text+0x378): undefined reference to `__res_query'
/bin/ld: domain.c.text+0x536): undefined reference to `__dn_expand'
/bin/ld: domain.c.text+0x59f): undefined reference to `__dn_expand'
/bin/ld: domain.o: in function `dns_getcanonname':
domain.c.text+0x113e): undefined reference to `__res_querydomain'
/bin/ld: domain.c.text+0x1327): undefined reference to `__dn_skipname'
/bin/ld: domain.c.text+0x1437): undefined reference to `__dn_expand'
/bin/ld: domain.c.text+0x155a): undefined reference to `__dn_expand'
/bin/ld: sm_resolve.o: in function `dns_lookup_int':
sm_resolve.c.text+0x246): undefined reference to `__res_search'
/bin/ld: sm_resolve.c.text+0x433): undefined reference to `__res_search'
/bin/ld: sm_resolve.c.text+0x54a): undefined reference to `__dn_expand'
/bin/ld: sm_resolve.c.text+0x5f7): undefined reference to `__dn_expand'
/bin/ld: sm_resolve.c.text+0x829): undefined reference to `__dn_expand'
/bin/ld: sm_resolve.c.text+0x8a8): undefined reference to `__dn_expand'
/bin/ld: sm_resolve.c.text+0x998): undefined reference to `__dn_expand'
My site.conf.m4:
dnl # SASL2 (smtp authentication)
APPENDDEF(`confENVDEF', `-DGSASL -DHASFLOCK')
APPENDDEF(`conf_sendmail_LIBS', `-lgsasl -lresolv')
dnl #
dnl # STARTTLS (smtp + tls/ssl)
APPENDDEF(`conf_sendmail_ENVDEF', `-DSTARTTLS')
APPENDDEF(`conf_ENVDEF', `-D_FFR_SMTP_SSL')
APPENDDEF(`conf_sendmail_LIBS', `-lssl -lcrypto -L/usr/lib64')
APPENDDEF(`confLIBDIRS', `-L/usr/lib64')
APPENDDEF(`confINCDIRS', `-I -L/usr/include')
|
|
|
|
08-17-2025, 11:33 PM
|
#2
|
|
Senior Member
Registered: Mar 2010
Distribution: Slackware
Posts: 2,412
|
I haven't built since 8.17.2. I get:
Quote:
cc -O2 -I. -I../../include -I/usr/local/include -I/usr/local/ssl/include -DCDB -UNIS -DSTARTTLS -DUSE_EAI -c -o vfscanf.o vfscanf.c
vfscanf.c: In function 'scanalrm':
vfscanf.c:88:1: warning: old-style function definition [-Wold-style-definition]
88 | scanalrm(sig)
| ^~~~~~~~
vfscanf.c: In function 'sm_vfscanf':
vfscanf.c:109:1: warning: old-style function definition [-Wold-style-definition]
109 | sm_vfscanf(fp, timeout, fmt0, ap)
| ^~~~~~~~~~
vfscanf.c:243:30: error: assignment to 'ULONGLONG_T (*)(const char *, char **, int)' {aka 'long long unsigned int (*)(const char *, char **, int)'} from incompatible pointer type 'ULONGLONG_T (*)(void)' {aka 'long long unsigned int (*)(void)'} [-Wincompatible-pointer-types]
243 | ccfn = (ULONGLONG_T (*)())sm_strtoll;
| ^
vfscanf.c:249:30: error: assignment to 'ULONGLONG_T (*)(const char *, char **, int)' {aka 'long long unsigned int (*)(const char *, char **, int)'} from incompatible pointer type 'ULONGLONG_T (*)(void)' {aka 'long long unsigned int (*)(void)'} [-Wincompatible-pointer-types]
249 | ccfn = (ULONGLONG_T (*)())sm_strtoll;
| ^
vfscanf.c:327:30: error: assignment to 'ULONGLONG_T (*)(const char *, char **, int)' {aka 'long long unsigned int (*)(const char *, char **, int)'} from incompatible pointer type 'ULONGLONG_T (*)(void)' {aka 'long long unsigned int (*)(void)'} [-Wincompatible-pointer-types]
327 | ccfn = (ULONGLONG_T (*)()) sm_strtoll;
| ^
vfscanf.c: In function 'sm_sccl':
vfscanf.c:776:1: warning: old-style function definition [-Wold-style-definition]
776 | sm_sccl(tab, fmt)
| ^~~~~~~
make[1]: *** [<builtin>: vfscanf.o] Error 1
make[1]: Leaving directory '/usr/src/sendmail-8.18.1/obj.Linux.6.16.1.x86_64/libsm'
make: *** [Makefile:409: /usr/src/sendmail-8.18.1/obj.Linux.6.16.1.x86_64/libsm/libsm.a] Error 2
|
I get the same with 8.17.2 - which I have successfully built. Don't know.
|
|
|
|
08-18-2025, 04:23 AM
|
#3
|
|
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,277
|
Quote:
Originally Posted by scp
I have seen this problem posted on LinuxQuestions in reference to an earlier Sendmail build but the solution is not available due to an insecure link. I believe the solution is in the configuration of site.config.m4 but I am stumped.
Below is the error I get attempting to build Sendmail-8.18.1:
/bin/ld: domain.o: in function `getmxrr':
domain.c.text+0x156): undefined reference to `__res_search'
/bin/ld: domain.c.text+0x240): undefined reference to `__dn_skipname'
/bin/ld: domain.c.text+0x378): undefined reference to `__res_query'
/bin/ld: domain.c.text+0x536): undefined reference to `__dn_expand'
/bin/ld: domain.c.text+0x59f): undefined reference to `__dn_expand'
/bin/ld: domain.o: in function `dns_getcanonname':
domain.c.text+0x113e): undefined reference to `__res_querydomain'
/bin/ld: domain.c.text+0x1327): undefined reference to `__dn_skipname'
/bin/ld: domain.c.text+0x1437): undefined reference to `__dn_expand'
/bin/ld: domain.c.text+0x155a): undefined reference to `__dn_expand'
/bin/ld: sm_resolve.o: in function `dns_lookup_int':
sm_resolve.c.text+0x246): undefined reference to `__res_search'
/bin/ld: sm_resolve.c.text+0x433): undefined reference to `__res_search'
/bin/ld: sm_resolve.c.text+0x54a): undefined reference to `__dn_expand'
/bin/ld: sm_resolve.c.text+0x5f7): undefined reference to `__dn_expand'
/bin/ld: sm_resolve.c.text+0x829): undefined reference to `__dn_expand'
/bin/ld: sm_resolve.c.text+0x8a8): undefined reference to `__dn_expand'
/bin/ld: sm_resolve.c.text+0x998): undefined reference to `__dn_expand'
My site.conf.m4:
dnl # SASL2 (smtp authentication)
APPENDDEF(`confENVDEF', `-DGSASL -DHASFLOCK')
APPENDDEF(`conf_sendmail_LIBS', `-lgsasl -lresolv')
dnl #
dnl # STARTTLS (smtp + tls/ssl)
APPENDDEF(`conf_sendmail_ENVDEF', `-DSTARTTLS')
APPENDDEF(`conf_ENVDEF', `-D_FFR_SMTP_SSL')
APPENDDEF(`conf_sendmail_LIBS', `-lssl -lcrypto -L/usr/lib64')
APPENDDEF(`confLIBDIRS', `-L/usr/lib64')
APPENDDEF(`confINCDIRS', `-I -L/usr/include')
|
Hi,
FYI, using your site.conf.m4, replacing just gsasl with sasl2 as I use cyrus-sasl, sendmail-8.18.1 was compiled successfully on Slackware64-current:
Code:
dnl # SASL2 (smtp authentication)
APPENDDEF(`confENVDEF', `-DSASL2 -DHASFLOCK')
APPENDDEF(`conf_sendmail_LIBS', `-lsasl2 -lresolv')
dnl #
dnl # STARTTLS (smtp + tls/ssl)
APPENDDEF(`conf_sendmail_ENVDEF', `-DSTARTTLS')
APPENDDEF(`conf_ENVDEF', `-D_FFR_SMTP_SSL')
APPENDDEF(`conf_sendmail_LIBS', `-lssl -lcrypto -L/usr/lib64')
APPENDDEF(`confLIBDIRS', `-L/usr/lib64')
APPENDDEF(`confINCDIRS', `-I -L/usr/include')
|
|
|
|
08-18-2025, 11:01 AM
|
#4
|
|
LQ Newbie
Registered: Jun 2010
Posts: 20
Original Poster
Rep:
|
Quote:
Originally Posted by bathory
Hi,
FYI, using your site.conf.m4, replacing just gsasl with sasl2 as I use cyrus-sasl, sendmail-8.18.1 was compiled successfully on Slackware64-current
|
Thank you for responding. I went over to Cyrus SASL but still get the same error. I see others have encountered this problem, too. Perhaps it has to do with Build not finding libresolv?
Last edited by scp; 08-18-2025 at 11:03 AM.
|
|
|
|
08-18-2025, 12:15 PM
|
#5
|
|
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,277
|
Quote:
Originally Posted by scp
Thank you for responding. I went over to Cyrus SASL but still get the same error. I see others have encountered this problem, too. Perhaps it has to do with Build not finding libresolv?
|
The sasl package is irrelevant in your case...
The problem is with resolv.h that cannot be found by the compiler.
You didn't mention your distro, but for Slackware libresolv and the header resolv.h are provided by glibc
On a different distro you need to install the glibc development package.
|
|
|
|
08-18-2025, 02:10 PM
|
#6
|
|
LQ Newbie
Registered: Jun 2010
Posts: 20
Original Poster
Rep:
|
Quote:
|
The problem is with resolv.h that cannot be found by the compiler.
|
I use Fedora. Slackware was the first Linux distro I used eons ago. You may be right but both the header and the library of libresolv is installed and loaded in the LDCache. Also, it is in /usr/include so Sendmail Build should be able to find it the path is stated in site.conf.m4
Last edited by scp; 08-18-2025 at 02:29 PM.
|
|
|
|
08-18-2025, 04:09 PM
|
#7
|
|
LQ Newbie
Registered: Jun 2010
Posts: 20
Original Poster
Rep:
|
The fix was to add -lresolv to the LIBS variable in the makefile in the object/sendmail directory - then Build completes. (Important to use only ./Build when doing this and not, of course ./Build -c .) The mystifying thing is that resolv.h is in the /usr/include directory which is referenced by confINCDIRS in my site.conf.m4 file. So it is odd that the Build program was not able to locate it.
|
|
|
1 members found this post helpful.
|
08-20-2025, 12:11 PM
|
#8
|
|
LQ Newbie
Registered: Jun 2010
Posts: 20
Original Poster
Rep:
|
In the end I did not have to use -lresolv either in the makefile or in site.config.m4. It may have been changing DSASL2 to DSASL=2 or using -DHASFLOCK=1 instead of DHASFLOCK (though the latter should not have made a difference) - or adding -ldb to conf_sendmail_LIBS. But this is what worked in the end with Berkley db correctly accessing flock:
dnl # SASL2 (smtp authentication)
APPENDDEF(`confENVDEF', `-DSASL=2 -DHASFLOCK=1')
APPENDDEF(`conf_sendmail_LIBS', `-lsasl2')
dnl # STARTTLS (smtp + tls/ssl)
APPENDDEF(`conf_sendmail_ENVDEF', `-DSTARTTLS')
APPENDDEF(`conf_ENVDEF', `-D_FFR_SMTP_SSL')
APPENDDEF(`conf_sendmail_LIBS', `-lssl -lcrypto -ldb -L/usr/lib64')
APPENDDEF(`confLIBDIRS', `-L/usr/lib64')
APPENDDEF(`confINCDIRS', `-I/usr/include')
Last edited by scp; 08-20-2025 at 12:15 PM.
|
|
|
|
All times are GMT -5. The time now is 06:09 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|