Bug 191290 - mail/sendmail -- link failures when site.config.m4.ssl included
Summary: mail/sendmail -- link failures when site.config.m4.ssl included
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Dirk Meyer
URL:
Keywords:
: 191074 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-06-22 21:06 UTC by Matthew Seaman
Modified: 2014-08-28 19:16 UTC (History)
3 users (show)

See Also:


Attachments
Full build log (40.64 KB, text/plain)
2014-06-22 21:06 UTC, Matthew Seaman
no flags Details
Patch (468 bytes, patch)
2014-06-22 21:07 UTC, Matthew Seaman
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Seaman freebsd_committer freebsd_triage 2014-06-22 21:06:43 UTC
Created attachment 144045 [details]
Full build log

I've been getting build failures in my poudriere with the following config settings:

lucid-nonsense:...ports/mail/sendmail:%	make showconfig
===> The following configuration options are available for sendmail+tls+sasl2-8.14.9:
     SHMEM=on: System V shared memory support
     SEM=on: POSIX semaphores support
     LA=on: load averages support
     NIS=off: Network Information Services/YP support
     IPV6=on: IPv6 protocol support
     TLS=on: SMTP-TLS and SMTPS support
     SASL=on: SASL authentication support
     SASLAUTHD=off: SASLAUTHD support
     LDAP=off: LDAP protocol support
     BDB=off: Berkeley DB version 4 support
     SOCKETMAP=off: Enable socketmap feature
     CYRUSLOOKUP=off: Enable cyruslookup feature
     PICKY_HELO_CHECK=on: Enable picky HELO check
     MILTER=on: Build libmilter
     MILTER_SHARED=on: Build shared libmilter
     MILTER_POOL=on: Enable milter thread pools
===> Use 'make config' to modify these settings

The error is:

cc -o sendmail  -L/usr/local/lib -L/usr/local/lib -rpath=/usr/local/lib main.o alias.o arpadate.o bf.o collect.o conf.o control.o convtime.o daemon.o deliver.o domain.o envelope.o err.o headers.o macro.o map.o mci.o milter.o mime.o parseaddr.o queue.o ratectrl.o readcf.o recipient.o sasl.o savemail.o sfsasl.o shmticklib.o sm_resolve.o srvrsmtp.o stab.o stats.o sysexits.o timers.o tls.o trace.o udb.o usersmtp.o util.o version.o     -lwrap -lsasl2 -lssl -lcrypto /wrkdirs/usr/ports/mail/sendmail/work/sendmail-8.14.9/obj.FreeBSD.10.0-STABLE.amd64/libsmutil/libsmutil.a /wrkdirs/usr/ports/mail/sendmail/work/sendmail-8.14.9/obj.FreeBSD.10.0-STABLE.amd64/libsm/libsm.a  -lutil
cc: error: unknown argument: '-rpath=/usr/local/lib'
*** Error code 1

Full log attached.  Switching that command line to use -Wl,-rpath=/usr/local/lib
fixes the problem.
Comment 1 Matthew Seaman freebsd_committer freebsd_triage 2014-06-22 21:07:29 UTC
Created attachment 144046 [details]
Patch
Comment 2 Matthew Seaman freebsd_committer freebsd_triage 2014-06-22 21:09:10 UTC
Over to maintainer
Comment 3 Dirk Meyer freebsd_committer freebsd_triage 2014-07-05 14:09:04 UTC
Problem is nor reproducible on FreeBSD 10.0 RELEASE.
Comment 4 Dirk Meyer freebsd_committer freebsd_triage 2014-07-05 18:48:10 UTC
*** Bug 191074 has been marked as a duplicate of this bug. ***
Comment 5 Dirk Meyer freebsd_committer freebsd_triage 2014-07-05 18:49:27 UTC
proposed patch rejected.

A cleaner fix has been committed.
Comment 6 redmog 2014-08-21 13:43:53 UTC
sendmail+tls+sasl2+db49-8.4.19_2 is still broken with regard to "-Wl,-rpath" option for me on FreeBSD 9.1 using gcc49 and either m4 or gm4.

gm4 is more helpful about the problem:

===>  Building for sendmail+tls+sasl2+db42-8.14.9_2
Making all in:
/usr/ports/mail/sendmail/work/sendmail-8.14.9/libsm
Configuration: pfx=, os=FreeBSD, rel=9.1-RELEASE-p6, rbase=9, rroot=9.1-RELEASE-p6, arch=amd64, sfx=, variant=optimized
Using M4=/usr/local/bin/gm4
Creating /usr/ports/mail/sendmail/work/sendmail-8.14.9/obj.FreeBSD.9.1-RELEASE-p6.amd64/libsm using /usr/ports/mail/sendmail/work/sendmail-8.14.9/devtools/OS/FreeBSD
Including /usr/ports/mail/sendmail/work/sendmail-8.14.9/devtools/Site/site.config.m4
/usr/local/bin/gm4:stdin:109: Warning: excess arguments to builtin `define' ignored
/usr/local/bin/gm4:stdin:109: Warning: excess arguments to builtin `define' ignored
/usr/local/bin/gm4:stdin:109: Warning: excess arguments to builtin `define' ignored
/usr/local/bin/gm4:stdin:109: Warning: excess arguments to builtin `define' ignored
/usr/local/bin/gm4:stdin:109: Warning: excess arguments to builtin `define' ignored


Which leads to this error:

gcc49 -o sendmail -Wl -L/usr/local/lib -L/usr/local/lib -L/usr/local/lib main.o alias.o arpadate.o bf.o collect.o conf.o control.o convtime.o daemon.o deliver.o domain.o envelope.o err.o headers.o macro.o map.o mci.o milter.o mime.o parseaddr.o queue.o ratectrl.o readcf.o recipient.o sasl.o savemail.o sfsasl.o shmticklib.o sm_resolve.o srvrsmtp.o stab.o stats.o sysexits.o timers.o tls.o trace.o udb.o usersmtp.o util.o version.o     -lwrap -lsasl2 -lssl -lcrypto -ldb-4.2 /usr/ports/mail/sendmail/work/sendmail-8.14.9/obj.FreeBSD.9.1-RELEASE-p6.amd64/libsmutil/libsmutil.a /usr/ports/mail/sendmail/work/sendmail-8.14.9/obj.FreeBSD.9.1-RELEASE-p6.amd64/libsm/libsm.a  -lutil
gcc49: error: unrecognized command line option '-Wl'


As you can see, the arg to APPENDDEF in .../devtools/Site/site.config.m4 is incorrectly converted from:

APPENDDEF(`confLDOPTS', `-Wl,-rpath=/usr/local/lib')

ending up in the work/sendmail.../obj.../*/Makefiles as:

LDOPTS=       -Wl


As a work-around, I did the "make configure" stage first then edited work/sendmail.../devtools/Site/site.config.m4 and changed that line to:

APPENDDEF(`confLDOPTS', ``-Wl,-rpath=/usr/local/lib'')

(i.e. double-quoting)

Following the edit with the usual "make build", etc. seems to then work.
Comment 7 Dirk Meyer freebsd_committer freebsd_triage 2014-08-28 19:16:34 UTC
I can not reproduce your problem

even with 9.1, gcc49 and gm4 installed the ports builds fine.

Please check your enviroment, /etc/make.conf.