This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Pass -fPIC flag even when DYLIB_ONLY is set
ClosedPublic

Authored by teemperor on May 29 2020, 5:25 AM.

Details

Summary

It seems that when we rewrite a few rules to only build a dylib (i.e., when DYLIB_ONLY is set),
the rule for setting the CFLAGS for the dylib's object file compilation will no longer work. From what I can
see this is because in DYLIB_ONLY mode we pretend to compile the main executable so
the DYLIB_OBJECTS scope is actually never used.

This patch makes -fPIC unstopped if DYLIB_ONLY is set so that -fPIC actually ends up in the
CFLAGS for the dylib object file compilation.

The test for this is D80798 which only compiles on Linux with this patch.

Diff Detail

Event Timeline

teemperor created this revision.May 29 2020, 5:25 AM
friss accepted this revision.May 29 2020, 7:33 AM

LGTM

This revision is now accepted and ready to land.May 29 2020, 7:33 AM
This revision was automatically updated to reflect the committed changes.
teemperor marked an inline comment as done.
Herald added a project: Restricted Project. · View Herald TranscriptMay 30 2020, 9:31 AM