无法使用 aarch64-unknown-nto-qnx7.0.0-g++-5.4.0 编译器为 QNX 平台交叉编译 gRPC
Not able to cross compile gRPC for QNX platform using aarch64-unknown-nto-qnx7.0.0-g++-5.4.0 compiler
我正在尝试使用 QNX aarch64-unknown-nto-qnx7.0.0-g++-5.4.0 编译器交叉编译 gRPC 代码。
我正在使用 toolchain.cmake 文件进行编译。
toolchain.cmake:
SET(CMAKE_SYSTEM_NAME QNX)
SET(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_CROSSCOMPILING 1)
set(CMAKE_SYSROOT "$ENV{TOOLCHAIN_PATH}")
set(CMAKE_C_COMPILER "$ENV{TOOLCHAIN_PATH}/usr/bin/aarch64-unknown-nto-qnx7.0.0-gcc-5.4.0")
set(CMAKE_CXX_COMPILER "$ENV{TOOLCHAIN_PATH}/usr/bin/aarch64-unknown-nto-qnx7.0.0-g++-5.4.0")
set(CMAKE_CXX_FLAGS "-Vgcc_ntoaarch64 -O2 -Wc,-Wall -DBUILDENV_qss -g -Os -Wall -march=armv8-a -mcpu=cortex-a57 -mtune=cortex-a57 \
-fstack-protector-strong -DNDEBUG -DFMT_HEADER_ONLY -EL -DVARIANT_le -std=c++11 -stdlib=libstdc++ -lang-c++ \
-I . \
-I$ENV{TOOLCHAIN_PATH}/usr/include \
-I$ENV{TOOLCHAIN_PATH}/usr/include/WF \
-I$ENV{TOOLCHAIN_PATH}/usr/include/KHR \
-I$ENV{INSTALL_ROOT_nto}/usr/include \
-Wl,-L$ENV{INSTALL_ROOT_nto}/aarch64le/lib \
-Wl,-L$ENV{INSTALL_ROOT_nto}/aarch64le/usr/lib \
-Wl,-L$ENV{TOOLCHAIN_PATH}/aarch64le/lib \
-Wl,-L$ENV{TOOLCHAIN_PATH}/aarch64le/usr/lib")
我收到以下错误,即使我使用了 -std=c++11(gnu++11 也尝试过):
error: #error "C++ versions less than C++11 are not supported."
error: 'constexpr' does not name a type
error: '__to_gcc_order' is not a member of 'std::__1::__gcc_atomic'
error: 'NormalizeLogSeverity' is not a member of 'absl'
请帮我解决这个问题。
设置(CMAKE_CXX_STANDARD 11)
要么
-std=c++11
存在一些许可问题,我无法构建代码。
更新许可证后,此问题已解决。
我正在尝试使用 QNX aarch64-unknown-nto-qnx7.0.0-g++-5.4.0 编译器交叉编译 gRPC 代码。 我正在使用 toolchain.cmake 文件进行编译。
toolchain.cmake:
SET(CMAKE_SYSTEM_NAME QNX)
SET(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_CROSSCOMPILING 1)
set(CMAKE_SYSROOT "$ENV{TOOLCHAIN_PATH}")
set(CMAKE_C_COMPILER "$ENV{TOOLCHAIN_PATH}/usr/bin/aarch64-unknown-nto-qnx7.0.0-gcc-5.4.0")
set(CMAKE_CXX_COMPILER "$ENV{TOOLCHAIN_PATH}/usr/bin/aarch64-unknown-nto-qnx7.0.0-g++-5.4.0")
set(CMAKE_CXX_FLAGS "-Vgcc_ntoaarch64 -O2 -Wc,-Wall -DBUILDENV_qss -g -Os -Wall -march=armv8-a -mcpu=cortex-a57 -mtune=cortex-a57 \
-fstack-protector-strong -DNDEBUG -DFMT_HEADER_ONLY -EL -DVARIANT_le -std=c++11 -stdlib=libstdc++ -lang-c++ \
-I . \
-I$ENV{TOOLCHAIN_PATH}/usr/include \
-I$ENV{TOOLCHAIN_PATH}/usr/include/WF \
-I$ENV{TOOLCHAIN_PATH}/usr/include/KHR \
-I$ENV{INSTALL_ROOT_nto}/usr/include \
-Wl,-L$ENV{INSTALL_ROOT_nto}/aarch64le/lib \
-Wl,-L$ENV{INSTALL_ROOT_nto}/aarch64le/usr/lib \
-Wl,-L$ENV{TOOLCHAIN_PATH}/aarch64le/lib \
-Wl,-L$ENV{TOOLCHAIN_PATH}/aarch64le/usr/lib")
我收到以下错误,即使我使用了 -std=c++11(gnu++11 也尝试过):
error: #error "C++ versions less than C++11 are not supported."
error: 'constexpr' does not name a type
error: '__to_gcc_order' is not a member of 'std::__1::__gcc_atomic'
error: 'NormalizeLogSeverity' is not a member of 'absl'
请帮我解决这个问题。
设置(CMAKE_CXX_STANDARD 11) 要么 -std=c++11
存在一些许可问题,我无法构建代码。
更新许可证后,此问题已解决。