Page MenuHomeFreeBSD

Fix libfifolog dependency on libz
ClosedPublic

Authored by emaste on Apr 10 2015, 8:44 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, May 4, 1:14 PM
Unknown Object (File)
Sat, Apr 27, 5:08 AM
Unknown Object (File)
Mar 12 2024, 2:01 AM
Unknown Object (File)
Mar 12 2024, 1:57 AM
Unknown Object (File)
Mar 12 2024, 1:57 AM
Unknown Object (File)
Mar 8 2024, 4:22 AM
Unknown Object (File)
Feb 25 2024, 1:04 AM
Unknown Object (File)
Jan 4 2024, 7:20 PM
Subscribers

Details

Summary

libfifolog.a consumers should not need to specify libz explicitly.

Discovered due to an lld bug.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

emaste retitled this revision from to Fix libfifolog dependency on libz.
emaste updated this object.
emaste edited the test plan for this revision. (Show Details)
emaste added a reviewer: bapt.
bapt edited edge metadata.
This revision is now accepted and ready to land.Apr 10 2015, 9:12 PM
emaste updated this revision to Diff 4786.

Closed by commit rS281384 (authored by @emaste).

head/share/mk/src.libnames.mk
262โ€“263

I'm reworking stuff here and I think this should be '_DP_fifolog= z'. This would cause anything having LIBADD+=fifolog to effectively add LIBADD+=z and get the proper DPADD/LDADD on libz. I'm not sure why this DPADD_*/LDADD_* section came about. It seems like it was all for the special case of atf naming being different and now we've been adding more here rather than the proper _DP_ place.

I also think there should be a LIBADD=z in usr.sbin/fifolog/lib/Makefile. Even though it is static and won't use the LDADD, the information of it being a dependency is valuable for meta mode bootstrapping, rebuilds, and in case this ever is converted to not be an INTERNALLIB (talking about best practices, not this specific case).

head/share/mk/src.libnames.mk
262โ€“263

rS281332 is another example that seems wrong too. lib/libmt depends on both bsdxml and sbuf. So why is the dependency split up and not just _DP_mt= sbuf bsdxml?

~/git/freebsd # tools/build/check-links.sh /usr/lib/libmt.so
checking if libsbuf.so.6 is needed: yes... sbuf_bcat
checking if libbsdxml.so.4 is needed: yes... XML_Parse
checking if libc.so.7 is needed: yes... __error

Both are needed directly.

head/share/mk/src.libnames.mk
272

There's also no DPADD_pthread or LDADD_pthread defined anywhere. These should just be _DP_<LIB>=pthread in the _DP_* list. If the idea was to use MK_LIBTHR then we can do that in the _DP_ list as well.

I see the distinction now. The _DP_* are only used with NO_SHARED and not for INTERNALLIB consumers. I think the right fix here is using the _DP_* vars without NO_SHARED, but not recursing on them like NO_SHARED does. This fixes broken libs like INTERNALLIBS and reduces seemingly redundant and confusing logic.

Sorry for the noise. I cleaned it up.