Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building of v0.19.0 libsignal-jni.so on CentOS #479

Closed
LFrank2021 opened this issue Jul 25, 2022 · 6 comments
Closed

Building of v0.19.0 libsignal-jni.so on CentOS #479

LFrank2021 opened this issue Jul 25, 2022 · 6 comments

Comments

@LFrank2021
Copy link

LFrank2021 commented Jul 25, 2022

Hi,
I am trying to build the latest libsignal-jni.so according to https://github.com/AsamK/signal-cli/wiki/Provide-native-lib-for-libsignal.
But I am running into several errors:

  1. running: "cmake" "/root/.cargo/git/checkouts/boring-b37daebd62069023/879ffef/boring-sys/deps/boringssl"
    is "cmake" not installed?
  2. after installing cmake this changed to
    CMake 3.5 or higher is required. You are running version 2.8.12.2
  3. after installing cmake3 and uninstalling cmake and linking cmake -> cmake3
running: "cmake" "/root/.cargo/git/checkouts/boring-b37daebd62069023/879ffef/boring-sys/deps/boringssl" "-DCMAKE_INSTALL_PREFIX=/data/src/libsignal-client/libsignal-0.19.0/target/release/build/boring-sys-9747273ddd65b7a8/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_CXX_COMPILER=c++" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_ASM_COMPILER=/usr/bin/cc" "-DCMAKE_BUILD_TYPE=MinSizeRel"
 -- The C compiler identification is GNU 4.8.5
 -- The CXX compiler identification is unknown
 -- Check for working C compiler: /usr/bin/cc
 -- Check for working C compiler: /usr/bin/cc - works
 -- Detecting C compiler ABI info
 -- Detecting C compiler ABI info - done
 -- Detecting C compile features
 -- Detecting C compile features - done
 -- Configuring incomplete, errors occurred!
 See also "/data/src/libsignal-client/libsignal-0.19.0/target/release/build/boring-sys-9747273ddd65b7a8/out/build/CMakeFiles/CMakeOutput.log".
 See also "/data/src/libsignal-client/libsignal-0.19.0/target/release/build/boring-sys-9747273ddd65b7a8/out/build/CMakeFiles/CMakeError.log".

 --- stderr
 CMake Error at CMakeLists.txt:9 (project):
   The CMAKE_CXX_COMPILER:

     c++

   is not a full path and was not found in the PATH.

   Tell CMake where to find the compiler by setting either the environment
   variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
   to the compiler, or to the compiler name if it is in the PATH.

The last version I was able to compile was v0.11.1.
Any help is greatly appreciated.
Kind regards
Frank

@jrose-signal
Copy link
Contributor

jrose-signal commented Jul 25, 2022

Oops! I meant to update the build instructions before the release. We'll be doing another one soon because the Docker build is broken, and I'll try to put instructions in there once we've worked it out. You'll need a C/C++ compiler installed in addition to cmake3; either clang or gcc (EDIT: maybe g++? I forget what the package is called) should work, plus libclang-dev (used later in the boring-sys compilation).

@jrose-signal
Copy link
Contributor

Verified: it looks like clang libclang-dev cmake(3) and make (which you probably already have) are enough to compile libsignal 0.19.0 on a Debian host. If that isn't sufficient for you, please let me know your target!

@LFrank2021
Copy link
Author

LFrank2021 commented Jul 26, 2022

My compile host is a CentOS 7 (formerly OracleLinux).
I only need the libsignal-client.jni for a new version of signal-cli.

I installed clang, which brought its dependency libstdc++-devel.
To get past the previous error I needed to export CXX=/usr/bin/clang.

But that results in:

   Compiling boring-sys v2.0.0 (https://github.com/signalapp/boring?branch=libsignal#879ffef1)
error: failed to run custom build command for `boring-sys v2.0.0 (https://github.com/signalapp/boring?branch=libsignal#879ffef1)`

Caused by:
  process didn't exit successfully: `/data/src/libsignal-client/libsignal-0.19.0/target/release/build/boring-sys-5cb31e1094dc61a4/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=BORING_BSSL_PATH
  CMAKE_TOOLCHAIN_FILE_x86_64-unknown-linux-gnu = None
  CMAKE_TOOLCHAIN_FILE_x86_64_unknown_linux_gnu = None
  HOST_CMAKE_TOOLCHAIN_FILE = None
  CMAKE_TOOLCHAIN_FILE = None
  CMAKE_GENERATOR_x86_64-unknown-linux-gnu = None
  CMAKE_GENERATOR_x86_64_unknown_linux_gnu = None
  HOST_CMAKE_GENERATOR = None
  CMAKE_GENERATOR = None
  CMAKE_PREFIX_PATH_x86_64-unknown-linux-gnu = None
  CMAKE_PREFIX_PATH_x86_64_unknown_linux_gnu = None
  HOST_CMAKE_PREFIX_PATH = None
  CMAKE_PREFIX_PATH = None
  CMAKE_x86_64-unknown-linux-gnu = None
  CMAKE_x86_64_unknown_linux_gnu = None
  HOST_CMAKE = None
  CMAKE = None
  running: "cmake" "/root/.cargo/git/checkouts/boring-b37daebd62069023/879ffef/boring-sys/deps/boringssl" "-DCMAKE_INSTALL_PREFIX=/data/src/libsignal-client/libsignal-0.19.0/target/release/build/boring-sys-9747273ddd65b7a8/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC --target=x86_64-unknown-linux-gnu" "-DCMAKE_CXX_COMPILER=/usr/bin/clang" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_ASM_COMPILER=/usr/bin/cc" "-DCMAKE_BUILD_TYPE=MinSizeRel"
  -- The CXX compiler identification is Clang 3.4.2
  -- Check for working CXX compiler: /usr/bin/clang
  -- Check for working CXX compiler: /usr/bin/clang - works
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  -- The ASM compiler identification is GNU
  -- Found assembler: /usr/bin/cc
  -- Configuring done
  -- Generating done
  -- Build files have been written to: /data/src/libsignal-client/libsignal-0.19.0/target/release/build/boring-sys-9747273ddd65b7a8/out/build
  running: "cmake" "--build" "." "--target" "crypto" "--config" "MinSizeRel" "--parallel" "4"
  Scanning dependencies of target crypto
  [  0%] Building ASM object CMakeFiles/crypto.dir/linux-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.S.o
  [  0%] Building ASM object CMakeFiles/crypto.dir/linux-x86_64/crypto/cipher_extra/chacha20_poly1305_x86_64.S.o
  [  1%] Building ASM object CMakeFiles/crypto.dir/linux-x86_64/crypto/chacha/chacha-x86_64.S.o
  [  2%] Building ASM object CMakeFiles/crypto.dir/linux-x86_64/crypto/fipsmodule/aesni-gcm-x86_64.S.o
  [  2%] Building ASM object CMakeFiles/crypto.dir/linux-x86_64/crypto/fipsmodule/aesni-x86_64.S.o
  [  2%] Building ASM object CMakeFiles/crypto.dir/linux-x86_64/crypto/fipsmodule/ghash-ssse3-x86_64.S.o
  [  3%] Building ASM object CMakeFiles/crypto.dir/linux-x86_64/crypto/fipsmodule/ghash-x86_64.S.o
  [  3%] Building ASM object CMakeFiles/crypto.dir/linux-x86_64/crypto/fipsmodule/md5-x86_64.S.o
  [  3%] Building ASM object CMakeFiles/crypto.dir/linux-x86_64/crypto/fipsmodule/p256-x86_64-asm.S.o
  [  4%] Building ASM object CMakeFiles/crypto.dir/linux-x86_64/crypto/fipsmodule/p256_beeu-x86_64-asm.S.o
  [  4%] Building ASM object CMakeFiles/crypto.dir/linux-x86_64/crypto/fipsmodule/rdrand-x86_64.S.o
  [  4%] Building ASM object CMakeFiles/crypto.dir/linux-x86_64/crypto/fipsmodule/rsaz-avx2.S.o
  [  6%] Building ASM object CMakeFiles/crypto.dir/linux-x86_64/crypto/fipsmodule/sha1-x86_64.S.o
  [  6%] Building ASM object CMakeFiles/crypto.dir/linux-x86_64/crypto/fipsmodule/sha256-x86_64.S.o
  [  6%] Building ASM object CMakeFiles/crypto.dir/linux-x86_64/crypto/fipsmodule/sha512-x86_64.S.o
  [  7%] Building ASM object CMakeFiles/crypto.dir/linux-x86_64/crypto/fipsmodule/vpaes-x86_64.S.o
  [  7%] Building ASM object CMakeFiles/crypto.dir/linux-x86_64/crypto/fipsmodule/x86_64-mont.S.o
  [  7%] Building ASM object CMakeFiles/crypto.dir/linux-x86_64/crypto/fipsmodule/x86_64-mont5.S.o
  [  8%] Building ASM object CMakeFiles/crypto.dir/linux-x86_64/crypto/test/trampoline-x86_64.S.o
  [  8%] Building ASM object CMakeFiles/crypto.dir/src/crypto/hrss/asm/poly_rq_mul.S.o
  [  8%] Building C object CMakeFiles/crypto.dir/err_data.c.o
  [  8%] Building C object CMakeFiles/crypto.dir/src/crypto/asn1/a_bitstr.c.o
  [  9%] Building C object CMakeFiles/crypto.dir/src/crypto/asn1/a_bool.c.o
  [  9%] Building C object CMakeFiles/crypto.dir/src/crypto/asn1/a_d2i_fp.c.o
  [  9%] Building C object CMakeFiles/crypto.dir/src/crypto/asn1/a_dup.c.o
  [ 10%] Building C object CMakeFiles/crypto.dir/src/crypto/asn1/a_enum.c.o
  [ 10%] Building C object CMakeFiles/crypto.dir/src/crypto/asn1/a_gentm.c.o
  [ 10%] Building C object CMakeFiles/crypto.dir/src/crypto/asn1/a_i2d_fp.c.o
  [ 12%] Building C object CMakeFiles/crypto.dir/src/crypto/asn1/a_int.c.o
  [ 12%] Building C object CMakeFiles/crypto.dir/src/crypto/asn1/a_mbstr.c.o
  [ 12%] Building C object CMakeFiles/crypto.dir/src/crypto/asn1/a_object.c.o
  [ 13%] Building C object CMakeFiles/crypto.dir/src/crypto/asn1/a_octet.c.o
  [ 13%] Building C object CMakeFiles/crypto.dir/src/crypto/asn1/a_print.c.o
  [ 13%] Building C object CMakeFiles/crypto.dir/src/crypto/asn1/a_strex.c.o
  [ 14%] Building C object CMakeFiles/crypto.dir/src/crypto/asn1/a_strnid.c.o
  [ 14%] Building C object CMakeFiles/crypto.dir/src/crypto/asn1/a_time.c.o
  [ 14%] Building C object CMakeFiles/crypto.dir/src/crypto/asn1/a_type.c.o
  [ 15%] Building C object CMakeFiles/crypto.dir/src/crypto/asn1/a_utctm.c.o
  [ 15%] Building C object CMakeFiles/crypto.dir/src/crypto/asn1/a_utf8.c.o
  [ 15%] Building C object CMakeFiles/crypto.dir/src/crypto/asn1/asn1_lib.c.o
  [ 17%] Building C object CMakeFiles/crypto.dir/src/crypto/asn1/asn1_par.c.o
  [ 17%] Building C object CMakeFiles/crypto.dir/src/crypto/asn1/asn_pack.c.o
  [ 17%] Building C object CMakeFiles/crypto.dir/src/crypto/asn1/f_enum.c.o
  [ 18%] Building C object CMakeFiles/crypto.dir/src/crypto/asn1/f_int.c.o
  [ 18%] Building C object CMakeFiles/crypto.dir/src/crypto/asn1/f_string.c.o
  [ 18%] Building C object CMakeFiles/crypto.dir/src/crypto/asn1/tasn_dec.c.o
  [ 19%] Building C object CMakeFiles/crypto.dir/src/crypto/asn1/tasn_enc.c.o
  [ 19%] Building C object CMakeFiles/crypto.dir/src/crypto/asn1/tasn_fre.c.o
  [ 19%] Building C object CMakeFiles/crypto.dir/src/crypto/asn1/tasn_new.c.o
  [ 20%] Building C object CMakeFiles/crypto.dir/src/crypto/asn1/tasn_typ.c.o
  [ 20%] Building C object CMakeFiles/crypto.dir/src/crypto/asn1/tasn_utl.c.o
  [ 20%] Building C object CMakeFiles/crypto.dir/src/crypto/asn1/time_support.c.o
  [ 21%] Building C object CMakeFiles/crypto.dir/src/crypto/base64/base64.c.o
  [ 21%] Building C object CMakeFiles/crypto.dir/src/crypto/bio/bio.c.o
  [ 21%] Building C object CMakeFiles/crypto.dir/src/crypto/bio/bio_mem.c.o
  [ 23%] Building C object CMakeFiles/crypto.dir/src/crypto/bio/connect.c.o
  [ 23%] Building C object CMakeFiles/crypto.dir/src/crypto/bio/fd.c.o
  [ 23%] Building C object CMakeFiles/crypto.dir/src/crypto/bio/file.c.o
  [ 24%] Building C object CMakeFiles/crypto.dir/src/crypto/bio/hexdump.c.o
  [ 24%] Building C object CMakeFiles/crypto.dir/src/crypto/bio/pair.c.o
  [ 24%] Building C object CMakeFiles/crypto.dir/src/crypto/bio/printf.c.o
  [ 24%] Building C object CMakeFiles/crypto.dir/src/crypto/bio/socket.c.o
  [ 25%] Building C object CMakeFiles/crypto.dir/src/crypto/bio/socket_helper.c.o
  [ 25%] Building C object CMakeFiles/crypto.dir/src/crypto/blake2/blake2.c.o
  [ 25%] Building C object CMakeFiles/crypto.dir/src/crypto/bn_extra/bn_asn1.c.o
  [ 26%] Building C object CMakeFiles/crypto.dir/src/crypto/bn_extra/convert.c.o
  [ 26%] Building C object CMakeFiles/crypto.dir/src/crypto/buf/buf.c.o
  [ 26%] Building C object CMakeFiles/crypto.dir/src/crypto/bytestring/asn1_compat.c.o
  [ 28%] Building C object CMakeFiles/crypto.dir/src/crypto/bytestring/ber.c.o
  [ 28%] Building C object CMakeFiles/crypto.dir/src/crypto/bytestring/cbb.c.o
  [ 28%] Building C object CMakeFiles/crypto.dir/src/crypto/bytestring/cbs.c.o
  [ 29%] Building C object CMakeFiles/crypto.dir/src/crypto/bytestring/unicode.c.o
  [ 29%] Building C object CMakeFiles/crypto.dir/src/crypto/chacha/chacha.c.o
  [ 29%] Building C object CMakeFiles/crypto.dir/src/crypto/cipher_extra/cipher_extra.c.o
  [ 30%] Building C object CMakeFiles/crypto.dir/src/crypto/cipher_extra/derive_key.c.o
  [ 30%] Building C object CMakeFiles/crypto.dir/src/crypto/cipher_extra/e_aesccm.c.o
  [ 30%] Building C object CMakeFiles/crypto.dir/src/crypto/cipher_extra/e_aesctrhmac.c.o
  [ 31%] Building C object CMakeFiles/crypto.dir/src/crypto/cipher_extra/e_aesgcmsiv.c.o
  [ 31%] Building C object CMakeFiles/crypto.dir/src/crypto/cipher_extra/e_chacha20poly1305.c.o
  [ 31%] Building C object CMakeFiles/crypto.dir/src/crypto/cipher_extra/e_null.c.o
  [ 32%] Building C object CMakeFiles/crypto.dir/src/crypto/cipher_extra/e_rc2.c.o
  [ 32%] Building C object CMakeFiles/crypto.dir/src/crypto/cipher_extra/e_rc4.c.o
  [ 32%] Building C object CMakeFiles/crypto.dir/src/crypto/cipher_extra/e_tls.c.o
  [ 34%] Building C object CMakeFiles/crypto.dir/src/crypto/cipher_extra/tls_cbc.c.o
  [ 34%] Building C object CMakeFiles/crypto.dir/src/crypto/cmac/cmac.c.o
  [ 34%] Building C object CMakeFiles/crypto.dir/src/crypto/conf/conf.c.o
  [ 35%] Building C object CMakeFiles/crypto.dir/src/crypto/cpu-aarch64-win.c.o
  [ 35%] Building C object CMakeFiles/crypto.dir/src/crypto/cpu-aarch64-fuchsia.c.o
  [ 35%] Building C object CMakeFiles/crypto.dir/src/crypto/cpu-aarch64-linux.c.o
  [ 36%] Building C object CMakeFiles/crypto.dir/src/crypto/cpu-arm-linux.c.o
  [ 36%] Building C object CMakeFiles/crypto.dir/src/crypto/cpu-intel.c.o
  [ 36%] Building C object CMakeFiles/crypto.dir/src/crypto/cpu-arm.c.o
  [ 37%] Building C object CMakeFiles/crypto.dir/src/crypto/cpu-ppc64le.c.o
  [ 37%] Building C object CMakeFiles/crypto.dir/src/crypto/crypto.c.o
  [ 37%] Building C object CMakeFiles/crypto.dir/src/crypto/curve25519/curve25519.c.o
  [ 39%] Building C object CMakeFiles/crypto.dir/src/crypto/curve25519/spake25519.c.o
  [ 39%] Building C object CMakeFiles/crypto.dir/src/crypto/dh_extra/dh_asn1.c.o
  [ 39%] Building C object CMakeFiles/crypto.dir/src/crypto/dh_extra/params.c.o
  [ 39%] Building C object CMakeFiles/crypto.dir/src/crypto/digest_extra/digest_extra.c.o
  [ 40%] Building C object CMakeFiles/crypto.dir/src/crypto/dsa/dsa.c.o
  [ 40%] Building C object CMakeFiles/crypto.dir/src/crypto/dsa/dsa_asn1.c.o
  [ 40%] Building C object CMakeFiles/crypto.dir/src/crypto/ec_extra/ec_asn1.c.o
  [ 41%] Building C object CMakeFiles/crypto.dir/src/crypto/ec_extra/ec_derive.c.o
  [ 41%] Building C object CMakeFiles/crypto.dir/src/crypto/ec_extra/hash_to_curve.c.o
  [ 41%] Building C object CMakeFiles/crypto.dir/src/crypto/ecdh_extra/ecdh_extra.c.o
  [ 42%] Building C object CMakeFiles/crypto.dir/src/crypto/ecdsa_extra/ecdsa_asn1.c.o
  [ 42%] Building C object CMakeFiles/crypto.dir/src/crypto/engine/engine.c.o
  [ 42%] Building C object CMakeFiles/crypto.dir/src/crypto/err/err.c.o
  [ 43%] Building C object CMakeFiles/crypto.dir/src/crypto/evp/digestsign.c.o
  [ 43%] Building C object CMakeFiles/crypto.dir/src/crypto/evp/evp.c.o
  [ 43%] Building C object CMakeFiles/crypto.dir/src/crypto/evp/evp_asn1.c.o
  [ 45%] Building C object CMakeFiles/crypto.dir/src/crypto/evp/evp_ctx.c.o
  [ 45%] Building C object CMakeFiles/crypto.dir/src/crypto/evp/p_ec.c.o
  [ 45%] Building C object CMakeFiles/crypto.dir/src/crypto/evp/p_dsa_asn1.c.o
  [ 46%] Building C object CMakeFiles/crypto.dir/src/crypto/evp/p_ec_asn1.c.o
  [ 46%] Building C object CMakeFiles/crypto.dir/src/crypto/evp/p_ed25519.c.o
  [ 46%] Building C object CMakeFiles/crypto.dir/src/crypto/evp/p_ed25519_asn1.c.o
  [ 47%] Building C object CMakeFiles/crypto.dir/src/crypto/evp/p_rsa.c.o
  [ 47%] Building C object CMakeFiles/crypto.dir/src/crypto/evp/p_rsa_asn1.c.o
  [ 47%] Building C object CMakeFiles/crypto.dir/src/crypto/evp/p_x25519.c.o
  [ 48%] Building C object CMakeFiles/crypto.dir/src/crypto/evp/p_x25519_asn1.c.o
  [ 48%] Building C object CMakeFiles/crypto.dir/src/crypto/evp/print.c.o
  [ 48%] Building C object CMakeFiles/crypto.dir/src/crypto/evp/pbkdf.c.o
  [ 50%] Building C object CMakeFiles/crypto.dir/src/crypto/evp/scrypt.c.o
  [ 50%] Building C object CMakeFiles/crypto.dir/src/crypto/evp/sign.c.o
  [ 50%] Building C object CMakeFiles/crypto.dir/src/crypto/ex_data.c.o
  [ 51%] Building C object CMakeFiles/crypto.dir/src/crypto/fipsmodule/bcm.c.o
  [ 51%] Building C object CMakeFiles/crypto.dir/src/crypto/fipsmodule/fips_shared_support.c.o
  [ 51%] Building C object CMakeFiles/crypto.dir/src/crypto/hkdf/hkdf.c.o
  [ 52%] Building C object CMakeFiles/crypto.dir/src/crypto/hpke/hpke.c.o
  [ 52%] Building C object CMakeFiles/crypto.dir/src/crypto/hrss/hrss.c.o
  [ 52%] Building C object CMakeFiles/crypto.dir/src/crypto/lhash/lhash.c.o
  [ 53%] Building C object CMakeFiles/crypto.dir/src/crypto/mem.c.o
  [ 53%] Building C object CMakeFiles/crypto.dir/src/crypto/obj/obj.c.o
  [ 53%] Building C object CMakeFiles/crypto.dir/src/crypto/obj/obj_xref.c.o
  [ 54%] Building C object CMakeFiles/crypto.dir/src/crypto/pem/pem_all.c.o
  [ 54%] Building C object CMakeFiles/crypto.dir/src/crypto/pem/pem_info.c.o
  [ 54%] Building C object CMakeFiles/crypto.dir/src/crypto/pem/pem_lib.c.o
  [ 54%] Building C object CMakeFiles/crypto.dir/src/crypto/pem/pem_oth.c.o
  [ 56%] Building C object CMakeFiles/crypto.dir/src/crypto/pem/pem_pk8.c.o
  [ 56%] Building C object CMakeFiles/crypto.dir/src/crypto/pem/pem_pkey.c.o
  [ 56%] Building C object CMakeFiles/crypto.dir/src/crypto/pem/pem_x509.c.o
  [ 57%] Building C object CMakeFiles/crypto.dir/src/crypto/pem/pem_xaux.c.o
  [ 57%] Building C object CMakeFiles/crypto.dir/src/crypto/pkcs7/pkcs7.c.o
  [ 57%] Building C object CMakeFiles/crypto.dir/src/crypto/pkcs7/pkcs7_x509.c.o
  [ 58%] Building C object CMakeFiles/crypto.dir/src/crypto/pkcs8/p5_pbev2.c.o
  [ 58%] Building C object CMakeFiles/crypto.dir/src/crypto/pkcs8/pkcs8.c.o
  [ 58%] Building C object CMakeFiles/crypto.dir/src/crypto/pkcs8/pkcs8_x509.c.o
  [ 59%] Building C object CMakeFiles/crypto.dir/src/crypto/poly1305/poly1305.c.o
  [ 59%] Building C object CMakeFiles/crypto.dir/src/crypto/poly1305/poly1305_arm.c.o
  [ 59%] Building C object CMakeFiles/crypto.dir/src/crypto/poly1305/poly1305_vec.c.o
  [ 60%] Building C object CMakeFiles/crypto.dir/src/crypto/pool/pool.c.o
  [ 60%] Building C object CMakeFiles/crypto.dir/src/crypto/rand_extra/deterministic.c.o
  [ 60%] Building C object CMakeFiles/crypto.dir/src/crypto/rand_extra/forkunsafe.c.o
  [ 62%] Building C object CMakeFiles/crypto.dir/src/crypto/rand_extra/fuchsia.c.o
  [ 62%] Building C object CMakeFiles/crypto.dir/src/crypto/rand_extra/passive.c.o
  [ 62%] Building C object CMakeFiles/crypto.dir/src/crypto/rand_extra/rand_extra.c.o
  [ 63%] Building C object CMakeFiles/crypto.dir/src/crypto/rand_extra/windows.c.o
  [ 63%] Building C object CMakeFiles/crypto.dir/src/crypto/rc4/rc4.c.o
  [ 64%] Building C object CMakeFiles/crypto.dir/src/crypto/refcount_lock.c.o
  [ 64%] Building C object CMakeFiles/crypto.dir/src/crypto/refcount_c11.c.o
  [ 64%] Building C object CMakeFiles/crypto.dir/src/crypto/rsa_extra/rsa_asn1.c.o
  [ 64%] Building C object CMakeFiles/crypto.dir/src/crypto/rsa_extra/rsa_print.c.o
  [ 65%] Building C object CMakeFiles/crypto.dir/src/crypto/siphash/siphash.c.o

  --- stderr
  gmake: warning: -jN forced in submake: disabling jobserver mode.
  /root/.cargo/git/checkouts/boring-b37daebd62069023/879ffef/boring-sys/deps/boringssl/src/crypto/refcount_c11.c:22:23: fatal error: stdatomic.h: No such file or directory
   #include <stdatomic.h>
                         ^
  compilation terminated.
  gmake[3]: *** [CMakeFiles/crypto.dir/src/crypto/refcount_c11.c.o] Error 1
  gmake[3]: *** Waiting for unfinished jobs....
  gmake[2]: *** [CMakeFiles/crypto.dir/all] Error 2
  gmake[1]: *** [CMakeFiles/crypto.dir/rule] Error 2
  gmake: *** [crypto] Error 2
  thread 'main' panicked at '
  command did not execute successfully, got: exit status: 2

  build script failed, must exit now', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.48/src/lib.rs:975:5
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I am rather unexperienced with git and compile processes, sorry.
Prior to this version, I never had a dedicated compile environment. Do I need to export more than CXX?

I tried setting CC=/usr/bin/clang

  You have changed variables that require your cache to be deleted.
  Configure will be re-run and you may have to reset some variables.
  The following variables have changed:
  CMAKE_C_COMPILER= /usr/bin/clang
  CMAKE_ASM_COMPILER= /usr/bin/clang

  gmake: warning: -jN forced in submake: disabling jobserver mode.
  /root/.cargo/git/checkouts/boring-b37daebd62069023/879ffef/boring-sys/deps/boringssl/src/crypto/hrss/asm/poly_rq_mul.S:304:13: error: invalid instruction mnemonic 'prefix'
  .att_syntax prefix
              ^
  gmake[3]: *** [CMakeFiles/crypto.dir/src/crypto/hrss/asm/poly_rq_mul.S.o] Error 1
  gmake[3]: *** Waiting for unfinished jobs....
  gmake[2]: *** [CMakeFiles/crypto.dir/all] Error 2
  gmake[1]: *** [CMakeFiles/crypto.dir/rule] Error 2
  gmake: *** [crypto] Error 2
  thread 'main' panicked at '
  command did not execute successfully, got: exit status: 2

  build script failed, must exit now', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.48/src/lib.rs:975:5

@jrose-signal
Copy link
Contributor

So I'm happy to continue helping to puzzle out errors here, but CentOS might be close enough to Debian/Ubuntu for you to use the prebuilt library attached to the release (now v0.19.1).

Failing that, it sounds like Clang fixed this a long time ago (Clang 3.4.2 is quite old), so the problem might be in the packages available to you. I'm not super familiar with CentOS, unfortunately, so I don't know the best recommendations for going beyond what's in the default package repository.

@jrose-signal jrose-signal changed the title Building of v0.19.0 libsignal-jni.so Building of v0.19.0 libsignal-jni.so on CentOS Jul 26, 2022
@LFrank2021
Copy link
Author

LFrank2021 commented Jul 27, 2022

I think I managed now.
Maybe documenting for others:

yum remove cmake
yum install cmake3 gcc gcc-c++ centos-release-scl.noarch devtoolset-9
ln -s /usr/bin/cmake3 /usr/bin/cmake


git clone https://github.com/llvm/llvm-project.git llvm-project
cd llvm-project/
git checkout origin/release/9.x
mkdir build; cd build
cmake3 -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=1 -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" ../llvm
make
export PATH=/root/src/llvm-project/build/bin:$PATH
clang --help


git clone https://github.com/signalapp/libsignal libsignal-client-git
cd libsignal-client-git
git pull
git checkout v0.19.1
cd java/
ls -la
sed -i "s/include ':android'//" settings.gradle
scl enable devtoolset-9 bash
export LD_LIBRARY_PATH=/opt/rh/devtoolset-9/root/usr/lib64:/opt/rh/devtoolset-9/root/usr/lib:/opt/rh/devtoolset-9/root/usr/lib64/dyninst:/opt/rh/devtoolset-9/root/usr/lib/dyninst:/opt/rh/devtoolset-9/root/usr/lib64:/opt/rh/devtoolset-9/root/usr/lib
export PATH=/root/src/llvm-project/build/bin/:$PATH
export LIBCLANG_PATH=/root/src/llvm-project/build/lib/
export C_INCLUDE_PATH=/opt/rh/devtoolset-9/root/usr/include:/opt/rh/devtoolset-9/root/usr/lib/gcc/x86_64-redhat-linux/9/include/:/opt/rh/devtoolset-9/root/usr/local/include:/usr/include
./build_jni.sh desktop

I hope I got all the commands and in the right order.
Just now I realize with the 'scl enable' most likely one could even go higher with clang.
Without it, v9 is the last one supporting gcc <5.1.

Now I will try to compile signal-cli and test it.

So far, thank you for the support.

@jrose-signal
Copy link
Contributor

Oh man, building your own Clang. I'm glad it seems to be working for you, though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants