LLVM Discussion Forums

Compression_encode_buffer from libcompression on ARM target

Hi,

I am trying to natively build llvm-11 on ARM target. And at configure step I have the following error (extracted from CMakeError.log):

   Performing C++ SOURCE FILE Test CXX_SUPPORTS_NO_NESTED_ANON_TYPES_FLAG failed with the following output:
    Change Dir: /tmp/aki/llvm-11.0.0/build/CMakeFiles/CMakeTmp
    Run Build Command:"/usr/bin/ninja" "cmTC_10a59"
    [1/2] Building CXX object CMakeFiles/cmTC_10a59.dir/src.cxx.o
    FAILED: CMakeFiles/cmTC_10a59.dir/src.cxx.o
    /usr/bin/g++    -std=c++11 -march=armv7-a -mfpu=neon -mfloat-abi=softfp -mthumb -fPIC -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -DCXX_SUPPORTS_NO_NESTED_ANON_TYPES_FLAG   -Werror
-Wnested-anon-types -o CMakeFiles/cmTC_10a59.dir/src.cxx.o -c src.cxx
g++: error: unrecognized command line option '-Wnested-anon-types'
ninja: build stopped: subcommand failed.

Source file was:
int main() { return 0; }
Determining if files sys/types.h;sys/event.h exist failed with the following output:
Change Dir: /tmp/aki/llvm-11.0.0/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/ninja" "cmTC_e3591"
[1/2] Building C object CMakeFiles/cmTC_e3591.dir/CheckIncludeFiles.c.o
FAILED: CMakeFiles/cmTC_e3591.dir/CheckIncludeFiles.c.o
/usr/bin/gcc   -march=armv7-a -fPIC -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-comment -fdiagnostics-color -ffunction-sections -fdata-sections -o CMakeFiles/cmTC_e3591.dir/CheckIncludeFiles.c.o   -c CheckIncludeFiles.c
CheckIncludeFiles.c:3:23: fatal error: sys/event.h: No such file or directory
compilation terminated.
ninja: build stopped: subcommand failed.

Source:
/* */
#include <sys/types.h>
#include <sys/event.h>


int main(void){return 0;}

Determining if the function compression_encode_buffer exists in the compression failed with the following output:
Change Dir: /tmp/aki/llvm-11.0.0/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/ninja" "cmTC_2cbdf"
[1/2] Building C object CMakeFiles/cmTC_2cbdf.dir/CheckFunctionExists.c.o
[2/2] Linking C executable cmTC_2cbdf
FAILED: cmTC_2cbdf
: && /usr/bin/gcc -march=armv7-a -fPIC -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-comment -fdiagnostics-color -ffunction-sections -fdata-sections -DCHECK_FUNCTION_EXISTS=compression_encode_buffer  -Wl,-allow-shlib-undefined CMakeFiles/cmTC_2cbdf.dir/CheckFunctionExists.c.o  -o cmTC_2cbdf  -lcompression && :                                                                                
/usr/lib/gcc/arm-slackware-linux-gnueabi/5.5.0/../../../../arm-slackware-linux-gnueabi/bin/ld: error: cannot find -lcompression
CMakeFiles/cmTC_2cbdf.dir/CheckFunctionExists.c.o:CheckFunctionExists.c:function main: error: undefined reference to 'compression_encode_buffer'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

Where this libcompression come from ? is there a way to disable the checking ? Also, I would like to know how can I disable fortran and go ?

Some information about how I am building llvm:

cmake -G "$BUILD_OPT" ..                        \
      -DCMAKE_BUILD_TYPE=Release                \
      -DCMAKE_INSTALL_PREFIX=/usr               \
      -DCMAKE_C_FLAGS=-march=armv7-a            \                                      
      -DCMAKE_C_COMPILER=gcc           \
      -DCMAKE_CXX_COMPILER=g++       \                 
      -DCMAKE_SYSTEM_NAME="Linux"               \
      -DCMAKE_CXX_FLAGS=" -std=c++11 -march=armv7-a -mfpu=neon -mfloat-abi=softfp -mthumb"    \
      -DBUILD_SHARED_LIBS=ON                    \
      -DPYTHON_EXECUTABLE=/usr/bin/python2.7            \
      -DLLVM_TARGETS_TO_BUILD="ARM"                     \
      -DLLVM_PARALLEL_LINK_JOBS="2"             \
      -DLLVM_OPTIMIZED_TABLEGEN=ON              \
      -DLLVM_BUILD_TESTS=OFF                    \                                   
      -DLLVM_BUILD_BENCHMARKS=OFF               \
      -DLLVM_INCLUDE_BENCHMARKS=OFF             \
      -DLLVM_INCLUDE_TESTS=OFF                  \
      -DLLVM_ENABLE_LIBCXX=OFF         \               
      -DLLVM_ENABLE_RTTI=ON                     \
      -DLLVM_ENABLE_FFI=ON                      \
      -DLLVM_ENABLE_PIC=ON                      \                                            
      -DLLVM_ENABLE_PEDANTIC=ON                 \            
      -DLLVM_ENABLE_ASSERTIONS=OFF              \                             
      -DLLVM_ENABLE_Z3_SOLVER=ON                \
      -DLLVM_ENABLE_BINDINGS=OFF                \
      -DLLVM_ENABLE_COMPRESSION=ON              \
      -DLLVM_USE_PERF=ON                        \
      -DLLVM_BUILD_TOOLS=OFF                    \
      -DLLVM_BUILD_INSTRUMENTED_COVERAGE=OFF    \
      -DCOMPILER_RT_DEFAULT_TARGET_ONLY=OFF                     \
      -DCOMPILER_RT_BUILD_BUILTINS=ON                                   \
      -DCOMPILER_RT_BUILD_SANITIZERS=OFF                                \
      -DCOMPILER_RT_BUILD_XRAY=OFF                                          \
      -DCOMPILER_RT_BUILD_LIBFUZZER=OFF                                 \
      -DCOMPILER_RT_BUILD_PROFILE=OFF           \
      -DENABLE_VALGRIND=0                       \
      -DHAVE_CXX_FLAG_COVERAGE=0                \
      -DHAVE_CXX_FLAG_WD654=0              \
      -DHAVE_POSIX_REGEX=0                      \
      -DHAVE_GNU_POSIX_REGEX=0                  \
      -DRUN_HAVE_POSIX_REGEX=0                  \
      -DHAVE_STEADY_CLOCK=0                     \
      -DBENCHMARK_ENABLE_LTO=OFF                \
      -DBENCHMARK_ENABLE_TESTING=OFF

Thanks