This is an archive of the discontinued LLVM Phabricator instance.

Fix lld standalone build
ClosedPublic

Authored by mceier on Feb 5 2022, 4:04 AM.

Details

Summary

lld/ELF/OutputSections.cpp includes llvm/Config/config.h for
LLVM_ENABLE_ZLIB definition, but llvm/Config/config.h doesn't exist in
standalone build.

To fix this, this patch moves LLVM_ENABLE_ZLIB from config.h to
llvm-config.h and updates OutputSections.cpp to include llvm-config.h
instead of config.h

Diff Detail

Event Timeline

mceier created this revision.Feb 5 2022, 4:04 AM
mceier requested review of this revision.Feb 5 2022, 4:04 AM
MaskRay accepted this revision.Feb 7 2022, 1:03 AM

Thanks!

This revision is now accepted and ready to land.Feb 7 2022, 1:03 AM
mgorny added a comment.Feb 7 2022, 1:28 AM

Thanks. Please give me an hour to test it.

mgorny accepted this revision.Feb 7 2022, 2:18 AM

LGTM! Please request backport to 14.x once you've pushed it.

mceier accepted this revision.Feb 7 2022, 5:19 AM

Not sure who's supposed to push it. I can't since I don't have github account. I can only "Accept Revision".

MaskRay updated this revision to Diff 406494.Feb 7 2022, 9:17 AM

Move LLVM_ENABLE_ZLIB

This revision was landed with ongoing or failed builds.Feb 7 2022, 9:20 AM
Closed by commit rGe8bff9ae54a5: Fix lld standalone build (authored by mceier, committed by MaskRay). · Explain Why
This revision was automatically updated to reflect the committed changes.

Move LLVM_ENABLE_ZLIB

this change breaks lldb builds

/mnt/b/yoe/master/build/tmp/hosttools/ld: lib/liblldbPluginProcessGDBRemote.a(GDBRemoteCommunication.cpp.o): in function `lldb_private::process_gdb_remote::GDBRemoteCommunication::DecompressPacket() [clone .localalias]':
GDBRemoteCommunication.cpp:(.text._ZN12lldb_private18process_gdb_remote22GDBRemoteCommunication16DecompressPacketEv+0x59a): undefined reference to `inflateInit2_'
/mnt/b/yoe/master/build/tmp/hosttools/ld: GDBRemoteCommunication.cpp:(.text._ZN12lldb_private18process_gdb_remote22GDBRemoteCommunication16DecompressPacketEv+0x5af): undefined reference to `inflate'
/mnt/b/yoe/master/build/tmp/hosttools/ld: GDBRemoteCommunication.cpp:(.text._ZN12lldb_private18process_gdb_remote22GDBRemoteCommunication16DecompressPacketEv+0x5bb): undefined reference to `inflateEnd'
collect2: error: ld returned 1 exit status

`
mceier added a comment.Feb 7 2022, 1:49 PM

Move LLVM_ENABLE_ZLIB

this change breaks lldb builds

Created another patch that fixes this: https://reviews.llvm.org/D119186