This is an archive of the discontinued LLVM Phabricator instance.

[lldb] [test] Do not link -ldl on NetBSD
ClosedPublic

Authored by mgorny on Feb 21 2019, 9:52 AM.

Details

Summary

Fix the load_* using test Makefiles not to link -ldl on NetBSD.
There is no such a library on NetBSD, and dlopen() is available
without a library. Quoting the manpage:

(These functions are not in a library.  They are included in every
dynamically linked program automatically.)

To resolve this portably, introduce a new USE_LIBDL option. If it set
to 1, Makefile.rules automatically appends -ldl on platforms needing it.

Diff Detail

Repository
rL LLVM

Event Timeline

mgorny created this revision.Feb 21 2019, 9:52 AM

Could you define some variable like DL_LIBS in the main Makefile.rules? Then you could just do LD_EXTRAS := $(DL_LIBS) in the tests.

mgorny updated this revision to Diff 187826.Feb 21 2019, 11:02 AM
mgorny edited the summary of this revision. (Show Details)

Switched to appending -ldl via Makefile.rules, using USE_LIBDL option.

labath accepted this revision.Feb 21 2019, 12:00 PM
This revision is now accepted and ready to land.Feb 21 2019, 12:00 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 21 2019, 12:28 PM