HomeFreeBSD

clang: Fix -gz=zlib options for linker

Description

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

(cherry picked from commit 19587d742264c5caec33d218e9cea6eb78f6c6bb)

Details

Provenance
emasteAuthored on Mar 3 2021, 1:35 AM
dimCommitted on Dec 25 2021, 11:50 AM
Differential Revision
D29028: clang: Fix -gz=zlib options for linker
Parents
rGefe456a0ef00: libllvmminimal: Add missing Support/ABIBreak.cpp
Branches
Unknown
Tags
Unknown