This is an archive of the discontinued LLVM Phabricator instance.

Fix -gz=zlib options for linker for FreeBSD too
ClosedPublic

Authored by emaste on Mar 1 2021, 6:30 PM.

Details

Summary

ccb4124a4172 fixed translating -gz=zlib for linker invocations for
several toolchains but omitted FreeBSD.

Fixes: ccb4124a4172b ("Fix -gz=zlib options for linker")

Diff Detail

Event Timeline

emaste created this revision.Mar 1 2021, 6:30 PM
emaste requested review of this revision.Mar 1 2021, 6:30 PM
emaste retitled this revision from Fix -gz=zlib options for linker to Fix -gz=zlib options for linker for FreeBSD too.
MaskRay accepted this revision.Mar 1 2021, 6:43 PM

Fixes: ccb4124a4172b ("Fix -gz=zlib options for linker")

I think "Fixes:" is not appropriate because that patch only intended to change the behavior on Gnu.cpp.

I think see the rationale for -gz=zlib affecting linking: clang -gz=zlib a.o b.o will provide --compress-debug-sections=zlib.

However, for clang -gz=zlib a.c b.c, -gz=zlib affecting assembly may be unnecessary: the object files are compressed just to be uncompressed immediately by the linker.

This revision is now accepted and ready to land.Mar 1 2021, 6:43 PM
emaste added a comment.Mar 1 2021, 7:31 PM

I can drop the Fixes trailer (I added it as we've adopted it in FreeBSD from Linux). That said, the referenced patch changed Gnu, AMDGPU, and HIP. My main goal here is to get the final library / executable artifacts to have compressed debug, we can look more at the intermediate bits later.

As an aside I'd like to see how we can prevent this kind of divergence; I would expect (what is currently) FreeBSD to be approximately equal to Gnu.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMar 2 2021, 5:45 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
yaxunl added a comment.Mar 2 2021, 7:17 AM

I can drop the Fixes trailer (I added it as we've adopted it in FreeBSD from Linux). That said, the referenced patch changed Gnu, AMDGPU, and HIP. My main goal here is to get the final library / executable artifacts to have compressed debug, we can look more at the intermediate bits later.

As an aside I'd like to see how we can prevent this kind of divergence; I would expect (what is currently) FreeBSD to be approximately equal to Gnu.

When we see an issue on Linux, it is hard to know whether it also happens to FreeBSD because we do not use FreeBSD on a daily basis. I think a reasonable solution is to add you as reviewer when we encounter similar issues on Linux in the future.