• torgil's avatar
    Make dependency on LLVM native target optional (#2080) · 61c063ae
    torgil authored
    * Make dependency on LLVM native target optional
    
    Adds an option ENABLE_LLVM_NATIVECODEGEN with default value ON.
    If set to off the "nativecodegen" llvm will not be enabled, thus
    reducing dependencies on needed libraries (reduced text size when
    building with statically linked libraries).
    
    Code that uses native target will not be compiled reducing text size.
    Currently this affects the rw_engine which needs the native target.
    
    BPF api "rw_engine_enabled" will have default value "true" if
    ENABLE_LLVM_NATIVECODEGEN="ON" and "false" if
    ENABLE_LLVM_NATIVECODEGEN="OFF"
    
    Not needed for BCC to work. It somehow brought in the interpreter and
    executionengine which is needed. Those features are added instead.
    
    * Remove garbage in code making it compile again
    
    * Remove interpreter and executionengine LLVM dependencies
    
    These doesn't seem to be needed on a Ubuntu 18.04 system (although
    executionengine is heavily used).
    
    Interpreter was added due to runtime dependency on ARM64. It brings in
    a dependency on ffi library.
    
    (.text._ZL10ffiTypeForPN4llvm4TypeE+0x3a): undefined reference to `ffi_type_float'
    (.text._ZL10ffiTypeForPN4llvm4TypeE+0x43): undefined reference to `ffi_type_void'
    (.text._ZL10ffiTypeForPN4llvm4TypeE+0x53): undefined reference to `ffi_type_pointer'
    (.text._ZL10ffiTypeForPN4llvm4TypeE+0x63): undefined reference to `ffi_type_double'
    (.text._ZL10ffiTypeForPN4llvm4TypeE+0x78): undefined reference to `ffi_type_sint8'
    (.text._ZL10ffiTypeForPN4llvm4TypeE+0x83): undefined reference to `ffi_type_sint16'
    (.text._ZL10ffiTypeForPN4llvm4TypeE+0x93): undefined reference to `ffi_type_sint64'
    (.text._ZL10ffiTypeForPN4llvm4TypeE+0xb3): undefined reference to `ffi_type_sint32'
    /usr/lib/llvm-6.0/lib/libLLVMInterpreter.a
    61c063ae
bpf_module_rw_engine.cc 15.1 KB