You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
git clone -b main ssh://git@github.com/Mizux/cmake-cpp
cd cmake-cpp
# use my "makefile based" script to build inside an ubuntu container using the cross-toolchain
make --directory=ci riscv64_build
...
error
note: to debug inside the container you can do:
# build the container until the devel stage then docker run an instance in it
$ make --directory=ci sh_riscv64_devel
...
# inside the container try to build using the tools/cross_compile.sh script
root@corentinl:/home/project# ./tools/cross_compile.sh riscv64
...
/home/project/build_cross/archives/riscv64/bin/riscv64-linux-ranlib ../../lib/libprotoc.a
gmake[2]: Leaving directory '/home/project/build_cross/riscv64'
[100%] Built target libprotoc
gmake[1]: Leaving directory '/home/project/build_cross/riscv64'
gmake: *** [Makefile:146: all] Error 2
# rerun the cmake build to get the error
root@corentinl:/home/project# cmake --build build_cross/riscv64/ -v
...
[ 79%] Linking CXX executable ../../bin/protoc-gen-upb
cd /home/project/build_cross/riscv64/_deps/protobuf-build && /usr/local/bin/cmake -E cmake_link_script CMakeFiles/protoc-gen-upb.dir/link.txt --verbose=1
/home/project/build_cross/archives/riscv64/bin/riscv64-linux-g++ --sysroot=/home/project/build_cross/archives/riscv64/riscv64-buildroot-linux-gnu/sysroot -L/home/project/build_cross/archives/riscv64/riscv64-buildroot-linux-gnu/sysroot/lib -O3 -DNDEBUG "CMakeFiles/protoc-gen-upb.dir/upb_generator/common.cc.o" "CMakeFiles/protoc-gen-upb.dir/upb_generator/file_layout.cc.o" "CMakeFiles/protoc-gen-upb.dir/upb_generator/mangle.cc.o" "CMakeFiles/protoc-gen-upb.dir/upb_generator/names.cc.o" "CMakeFiles/protoc-gen-upb.dir/upb_generator/protoc-gen-upb.cc.o" "CMakeFiles/protoc-gen-upb.dir/upb_generator/cmake/google/protobuf/compiler/plugin.upb_minitable.c.o" -o ../../bin/protoc-gen-upb-27.2.0 -Wl,-rpath,"\$ORIGIN/../lib" ../../lib/libprotobuf.a ../../lib/libupb.a ../../lib/libabsl_die_if_null.so.2401.0.0 ../../lib/libabsl_log_initialize.so.2401.0.0 ../../lib/libabsl_statusor.so.2401.0.0 ../../lib/libabsl_log_internal_check_op.so.2401.0.0 ../../lib/libabsl_leak_check.so.2401.0.0 ../../lib/libabsl_log_internal_conditions.so.2401.0.0 ../../lib/libabsl_log_internal_message.so.2401.0.0 ../../lib/libabsl_log_internal_nullguard.so.2401.0.0 ../../lib/libabsl_examine_stack.so.2401.0.0 ../../lib/libabsl_log_internal_format.so.2401.0.0 ../../lib/libabsl_log_internal_proto.so.2401.0.0 ../../lib/libabsl_log_internal_log_sink_set.so.2401.0.0 ../../lib/libabsl_log_sink.so.2401.0.0 ../../lib/libabsl_log_entry.so.2401.0.0 ../../lib/libabsl_flags_internal.so.2401.0.0 ../../lib/libabsl_flags_marshalling.so.2401.0.0 ../../lib/libabsl_flags_reflection.so.2401.0.0 ../../lib/libabsl_flags_config.so.2401.0.0 ../../lib/libabsl_flags_program_name.so.2401.0.0 ../../lib/libabsl_flags_private_handle_accessor.so.2401.0.0 ../../lib/libabsl_flags_commandlineflag.so.2401.0.0 ../../lib/libabsl_flags_commandlineflag_internal.so.2401.0.0 ../../lib/libabsl_log_internal_globals.so.2401.0.0 ../../lib/libabsl_log_globals.so.2401.0.0 ../../lib/libabsl_vlog_config_internal.so.2401.0.0 ../../lib/libabsl_log_internal_fnmatch.so.2401.0.0 ../../lib/libabsl_raw_hash_set.so.2401.0.0 ../../lib/libabsl_hash.so.2401.0.0 ../../lib/libabsl_city.so.2401.0.0 ../../lib/libabsl_low_level_hash.so.2401.0.0 ../../lib/libabsl_hashtablez_sampler.so.2401.0.0 ../../lib/libabsl_random_distributions.so.2401.0.0 ../../lib/libabsl_random_seed_sequences.so.2401.0.0 ../../lib/libabsl_random_internal_pool_urbg.so.2401.0.0 ../../lib/libabsl_random_internal_randen.so.2401.0.0 ../../lib/libabsl_random_internal_randen_hwaes.so.2401.0.0 ../../lib/libabsl_random_internal_randen_hwaes_impl.so.2401.0.0 ../../lib/libabsl_random_internal_randen_slow.so.2401.0.0 ../../lib/libabsl_random_internal_platform.so.2401.0.0 ../../lib/libabsl_random_internal_seed_material.so.2401.0.0 ../../lib/libabsl_random_seed_gen_exception.so.2401.0.0 ../../lib/libabsl_status.so.2401.0.0 ../../lib/libabsl_cord.so.2401.0.0 ../../lib/libabsl_cordz_info.so.2401.0.0 ../../lib/libabsl_cord_internal.so.2401.0.0 ../../lib/libabsl_cordz_functions.so.2401.0.0 ../../lib/libabsl_exponential_biased.so.2401.0.0 ../../lib/libabsl_cordz_handle.so.2401.0.0 ../../lib/libabsl_crc_cord_state.so.2401.0.0 ../../lib/libabsl_crc32c.so.2401.0.0 ../../lib/libabsl_crc_internal.so.2401.0.0 ../../lib/libabsl_crc_cpu_detect.so.2401.0.0 ../../lib/libabsl_bad_optional_access.so.2401.0.0 ../../lib/libabsl_strerror.so.2401.0.0 ../../lib/libabsl_str_format_internal.so.2401.0.0 ../../lib/libabsl_synchronization.so.2401.0.0 ../../lib/libabsl_stacktrace.so.2401.0.0 ../../lib/libabsl_symbolize.so.2401.0.0 ../../lib/libabsl_debugging_internal.so.2401.0.0 ../../lib/libabsl_demangle_internal.so.2401.0.0 ../../lib/libabsl_graphcycles_internal.so.2401.0.0 ../../lib/libabsl_kernel_timeout_internal.so.2401.0.0 ../../lib/libabsl_malloc_internal.so.2401.0.0 ../../lib/libabsl_time.so.2401.0.0 ../../lib/libabsl_civil_time.so.2401.0.0 ../../lib/libabsl_time_zone.so.2401.0.0 ../../lib/libabsl_bad_variant_access.so.2401.0.0 ../../lib/libutf8_validity.a ../../lib/libabsl_strings.so.2401.0.0 ../../lib/libabsl_int128.so.2401.0.0 ../../lib/libabsl_strings_internal.so.2401.0.0 ../../lib/libabsl_string_view.so.2401.0.0 ../../lib/libabsl_base.so.2401.0.0 ../../lib/libabsl_spinlock_wait.so.2401.0.0 ../../lib/libabsl_throw_delegate.so.2401.0.0 ../../lib/libabsl_raw_logging_internal.so.2401.0.0 ../../lib/libabsl_log_severity.so.2401.0.0 ../../lib/libutf8_range.a
/home/project/build_cross/archives/riscv64/bin/../lib/gcc/riscv64-buildroot-linux-gnu/11.3.0/../../../../riscv64-buildroot-linux-gnu/bin/ld: ../../lib/libabsl_log_internal_message.so.2401.0.0: undefined reference to `__atomic_compare_exchange_1'/home/project/build_cross/archives/riscv64/bin/../lib/gcc/riscv64-buildroot-linux-gnu/11.3.0/../../../../riscv64-buildroot-linux-gnu/bin/ld: ../../lib/libabsl_log_internal_globals.so.2401.0.0: undefined reference to `__atomic_exchange_1'collect2: error: ld returned 1 exit statusgmake[2]: *** [_deps/protobuf-build/CMakeFiles/protoc-gen-upb.dir/build.make:257: bin/protoc-gen-upb-27.2.0] Error 1gmake[2]: Leaving directory '/home/project/build_cross/riscv64'gmake[1]: *** [CMakeFiles/Makefile2:4663: _deps/protobuf-build/CMakeFiles/protoc-gen-upb.dir/all] Error 2gmake[1]: Leaving directory '/home/project/build_cross/riscv64'gmake: *** [Makefile:146: all] Error 2
What version of Abseil are you using?
message(CHECK_START "Fetching Abseil-cpp")
list(APPEND CMAKE_MESSAGE_INDENT " ")
set(ABSL_USE_SYSTEM_INCLUDES ON)
# We want Abseil to declare what C++ standard it was compiled with.set(ABSL_PROPAGATE_CXX_STD ON)
# We want Abseil to keep the INSTALL rules enabled, even though it is a# subproject. Otherwise the install rules in this project break.set(ABSL_ENABLE_INSTALL ON)
FetchContent_Declare(
absl
GIT_REPOSITORY "https://github.com/abseil/abseil-cpp.git"
GIT_TAG "20240116.2"
GIT_SHALLOW TRUE
PATCH_COMMAND git apply --ignore-whitespace "${CMAKE_CURRENT_LIST_DIR}/../patches/abseil-cpp-20240116.2.patch"
OVERRIDE_FIND_PACKAGE)
FetchContent_MakeAvailable(absl)
list(POP_BACK CMAKE_MESSAGE_INDENT)
message(CHECK_PASS "fetched")
note: the patch is to fix the RUNPATH in all absl shared library since my super project build use CMAKE_BUILD_WITH_INSTALL_RPATH TRUE.
(PR incoming -_-)
What operating system and version are you using?
run inside a docker:
%head -3 ci/docker/toolchain/Dockerfile
# Create a virtual environment with all tools installed# ref: https://hub.docker.com/_/ubuntu
FROM ubuntu:latest AS env
What compiler and version are you using?
From tools/cross_compile.sh
local -r TOOLCHAIN_URL="https://toolchains.bootlin.com/downloads/releases/toolchains/riscv64-lp64d/tarballs/riscv64-lp64d--glibc--stable-2022.08-1.tar.bz2"
local -r GCC_PREFIX="riscv64"
seems to be a gcc version 11.3.0 (Buildroot 2021.11-4428-g6b6741b)
Describe the issue
When using the bootlin cross_toolchain
ref: https://toolchains.bootlin.com/
I got the trace:
Steps to reproduce the problem
I'm using my pet project
mizux/cmake-cpp
:note: to debug inside the container you can do:
What version of Abseil are you using?
note: the patch is to fix the
RUNPATH
in all absl shared library since my super project build useCMAKE_BUILD_WITH_INSTALL_RPATH TRUE
.(PR incoming
-_-
)What operating system and version are you using?
run inside a docker:
What compiler and version are you using?
From tools/cross_compile.sh
seems to be a
gcc version 11.3.0 (Buildroot 2021.11-4428-g6b6741b)
What build system are you using?
%make --directory=ci sh_riscv64_env root@corentinl:/# cmake --version cmake version 3.28.3
Additional context
No response
The text was updated successfully, but these errors were encountered: