Bug 192730 - [build] make checkdpadd failures with LD* variables being added to LDADD
Summary: [build] make checkdpadd failures with LD* variables being added to LDADD
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: conf (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs mailing list
URL:
Keywords:
: 192757 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-08-17 04:24 UTC by Enji Cooper
Modified: 2014-10-23 00:52 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Enji Cooper freebsd_committer 2014-08-17 04:24:00 UTC
The changes in r269648 broke make checkdpadd in a minor way -- now LDADD includes libraries with .so instead of .a:

(cd lib/libpam/modules/pam_ssh/; env SRCCONF=/dev/null make checkdpadd)
/usr/src/lib/libpam/modules/pam_ssh
DPADD -> /usr/obj/usr/src/secure/lib/libssh/libssh.a -lcrypto -lcrypt -lpam
LDADD -> /usr/obj/usr/src/secure/lib/libssh/libssh.so -lcrypto -lcrypt -lpam
Comment 1 Enji Cooper freebsd_committer 2014-08-17 05:40:50 UTC
This is a bit worse with atf.*.mk and other private libraries as they do similar things (this is with the code from my isilon-atf branch on my github fork -- https://github.com/yaneurabeya/freebsd/commit/1804982cd418df56a7f6713802677a982f2ecb41#diff-d41d8cd98f00b204e9800998ecf8427e ):

% (cd lib/libc/tests/gen; make t_vis.checkdpadd)
(cd /usr/src/lib/libc/tests/gen && make -f /usr/src/lib/libc/tests/gen/Makefile _RECURSING_PROGS=  SUBDIR= PROG=t_vis  checkdpadd)
/usr/src/lib/libc/tests/gen
DPADD -> /usr/obj/usr/src/lib/atf/libatf-c/libatf-c.a
LDADD -> /usr/obj/usr/src/lib/atf/libatf-c/libatf-c.so

Could -rpath be used with LDFLAGS instead with applications that need private libraries to avoid infecting other binaries with this?
Comment 2 Enji Cooper freebsd_committer 2014-08-17 06:17:20 UTC
This is really easy to work around:

diff --git a/share/mk/bsd.dep.mk b/share/mk/bsd.dep.mk
index 14619eb..0299b37 100644
--- a/share/mk/bsd.dep.mk
+++ b/share/mk/bsd.dep.mk
@@ -215,7 +215,7 @@ cleandepend:
 .endif
 
 .if !target(checkdpadd) && (defined(DPADD) || defined(LDADD))
-_LDADD_FROM_DPADD=     ${DPADD:C;^/usr/lib/lib(.*)\.a$;-l\1;}
+_LDADD_FROM_DPADD=     ${DPADD:C;^.*/lib(.*)\.(a|so)$;-l\1;}
 _LDADD_CANONICALIZED=  ${LDADD:S/$//}
 checkdpadd:
 .if ${_LDADD_FROM_DPADD} != ${_LDADD_CANONICALIZED}

I'm not sure if this is the right solution though...
Comment 3 Enji Cooper freebsd_committer 2014-08-17 07:15:28 UTC
I was also playing around with some other patches I had to change LDATF_C to -latf-c for instance. Again, not sure if this is how things were intended, but specifying -rpath or -L with LDFLAGS seems like it might enhance things properly..
Comment 4 Enji Cooper freebsd_committer 2014-08-19 18:36:10 UTC
*** Bug 192757 has been marked as a duplicate of this bug. ***
Comment 5 commit-hook freebsd_committer 2014-09-10 07:56:42 UTC
A commit references this bug:

Author: ngie
Date: Wed Sep 10 07:55:52 UTC 2014
New revision: 271365
URL: http://svnweb.freebsd.org/changeset/base/271365

Log:
  Remove many false positives with make checkdpadd

  - Reduce DPADD and LDADD in checkdpadd to -l<foo>
  - Skip over -Wl,[es]*-group because -Wl,--end-group and
    -Wl,--start-group might be required to properly link objects (see
    usr.bin/clang/lldb as an example)

  This caveat has been present for a while with some components of
  the build. However, these false positives were made more more apparent
  after r269648.

  Phabric: D635
  Reviewed by: jmmv (an earlier version)
  PR: 192730
  MFC after: 2 weeks

Changes:
  head/share/mk/bsd.dep.mk
Comment 6 commit-hook freebsd_committer 2014-10-23 00:52:09 UTC
A commit references this bug:

Author: ngie
Date: Thu Oct 23 00:51:53 UTC 2014
New revision: 273500
URL: https://svnweb.freebsd.org/changeset/base/273500

Log:
  MFC r271365:

    Remove many false positives with make checkdpadd

    - Reduce DPADD and LDADD in checkdpadd to -l<foo>
    - Skip over -Wl,[es]*-group because -Wl,--end-group and
      -Wl,--start-group might be required to properly link objects (see
      usr.bin/clang/lldb as an example)

    This caveat has been present for a while with some components of
    the build. However, these false positives were made more more apparent
    after r269648.

    Phabric: D635
    Reviewed by: jmmv (an earlier version)
    PR: 192730

Changes:
_U  stable/10/
  stable/10/share/mk/bsd.dep.mk