[Bug 44690] New: Include guards missing for compression.h

Bug ID 44690
Summary Include guards missing for compression.h
Product lldb
Version 10.0
Hardware All
OS All
Status NEW
Severity normal
Priority P
Component All Bugs
Assignee lldb-dev@lists.llvm.org
Reporter ggreif@gmail.com
CC jdevlieghere@apple.com, llvm-bugs@lists.llvm.org

See:

llvm-project/lldb/tools/debugserver/source/RNBRemote.cpp
Lines 43 to 45 in f15b60b
>  
> #include <compression.h> 
>  

Include protection is missing (HAVE_LIBCOMPRESSION).

How it should be:

llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
Lines 49 to 51 in f15b60b
> #if defined(HAVE_LIBCOMPRESSION) 
> #include <compression.h> 
> #endif 

This was detected while updating the nixpkgs for llvm-10.

This change would imply more changes around lines 715 to 761.

Originally filed as [https://github.com/llvm/llvm-project/issues/112](https://github.com/llvm/llvm-project/issues/112)

I suggest back porting from master to release-10.0 branch.

Jonas Devlieghere changed bug 44690

What Removed Added
Status NEW RESOLVED
Resolution INVALID

Comment # 1 on bug 44690 from Jonas Devlieghere

This code is in debugserver which is macOS-only. We always have libcompresion
there. Furthermore it entirely separate from the rest of LLDB and doesn't read
the header that defines HAVE_LIBCOMPRESSION. 

I don't think you want to build debugserver for NixOS. It should only be a
target on Darwin. See tools/CMakeLists.txt:

 13 if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
 14   add_lldb_tool_subdirectory(darwin-debug)
 15   if(NOT LLDB_USE_SYSTEM_DEBUGSERVER)
 16     add_lldb_tool_subdirectory(debugserver)
 17   endif()
 18 endif()

Gabor Greif changed bug 44690

What Removed Added
Resolution INVALID
Status RESOLVED REOPENED

Comment # 2 on bug 44690 from Gabor Greif