[all-commits] [llvm/llvm-project] ccb412: Fix -gz=zlib options for linker

Yaxun (Sam) Liu via All-commits all-commits at lists.llvm.org
Fri Sep 11 14:13:33 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: ccb4124a4172bf2cb2e1cd7c253f0f1654fce294
      https://github.com/llvm/llvm-project/commit/ccb4124a4172bf2cb2e1cd7c253f0f1654fce294
  Author: Yaxun (Sam) Liu <yaxun.liu at amd.com>
  Date:   2020-09-11 (Fri, 11 Sep 2020)

  Changed paths:
    M clang/lib/Driver/ToolChains/AMDGPU.cpp
    M clang/lib/Driver/ToolChains/CommonArgs.cpp
    M clang/lib/Driver/ToolChains/CommonArgs.h
    M clang/lib/Driver/ToolChains/Gnu.cpp
    M clang/lib/Driver/ToolChains/HIP.cpp
    A clang/test/Driver/amdgcn-gz-options.cl
    M clang/test/Driver/compress.c
    A clang/test/Driver/hip-gz-options.hip

  Log Message:
  -----------
  Fix -gz=zlib options for linker

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.

Differential Revision: https://reviews.llvm.org/D87321




More information about the All-commits mailing list