]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
clang: Fix -gz=zlib options for linker
authorEd Maste <emaste@FreeBSD.org>
Wed, 3 Mar 2021 01:35:57 +0000 (20:35 -0500)
committerEd Maste <emaste@FreeBSD.org>
Thu, 4 Mar 2021 20:10:03 +0000 (15:10 -0500)
commit19587d742264c5caec33d218e9cea6eb78f6c6bb
treed0bb509c9f2c2a467d2296a7df45f3fcdb28f92e
parent448732b8e2d9bf4e2656a2e5a9e88cc58b88d4f4
clang: Fix -gz=zlib options for linker

Clang commit ccb4124a4172bf2cb2e1cd7c253f0f1654fce294:

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.

Clang commit 462cf39a5c180621b56f7602270ce33eb7b68d23:

[Driver] Fix -gz=zlib options for linker also on FreeBSD

ccb4124a4172 fixed translating -gz=zlib to --compress-debug-sections for
linker invocation for several ToolChains, but omitted FreeBSD.

Approved by: dim
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D29028
contrib/llvm-project/clang/lib/Driver/ToolChains/AMDGPU.cpp
contrib/llvm-project/clang/lib/Driver/ToolChains/CommonArgs.cpp
contrib/llvm-project/clang/lib/Driver/ToolChains/CommonArgs.h
contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.cpp
contrib/llvm-project/clang/lib/Driver/ToolChains/Gnu.cpp
contrib/llvm-project/clang/lib/Driver/ToolChains/HIP.cpp