[PATCH] D87321: Fix -gz=zlib options for linker

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 8 12:05:10 PDT 2020


yaxunl created this revision.
yaxunl added reviewers: tra, MaskRay.
Herald added subscribers: kerbowa, nhaehnle, jvesely.
yaxunl requested review of this revision.

gcc translates -gz=zlib to --compress-debug-options=zlib for both assembler and linker
but clang only does this for assembler.

The linker needs --compress-debug-options=zlib option to compress the debug sections
in the generated executable or shared library.

Due to this bug, -gz=zlib has no effect on the generated executable or shared library.

This patch fixes that.


https://reviews.llvm.org/D87321

Files:
  clang/lib/Driver/ToolChains/AMDGPU.cpp
  clang/lib/Driver/ToolChains/CommonArgs.cpp
  clang/lib/Driver/ToolChains/CommonArgs.h
  clang/lib/Driver/ToolChains/Gnu.cpp
  clang/lib/Driver/ToolChains/HIP.cpp
  clang/test/Driver/gz.c
  clang/test/Driver/hip-gz-options.hip

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87321.290560.patch
Type: text/x-patch
Size: 5659 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200908/9a363547/attachment.bin>


More information about the cfe-commits mailing list