01-基于SOA架构someip 开发-Boost-1.55.0 QNX交叉编译

  1. 背景

qcc编译存在lisence过期问题,因此采用gcc交叉编译

//TODO

01-基于SOA架构someip 开发-Linux开发环境搭建_soa someip_村里小码农的博客-CSDN博客

  1. 版本

boost-1.55.0

https://downloads.sourceforge.net/project/boost/boost/1.55.0/boost_1_55_0.tar.gz

  1. 编译脚本

#!/bin/bash
#
#----------------------------------------------------------
#    author: TIM
#    email : [email protected]                                                              
#    description: SOA someip build script                                                   
# ---------------------------------------------------------
#    Warm reminder :Abort operation with Ctrl+C
# ---------------------------------------------------------

SOURCE_DIR=$(pwd)

# qnx tools dir
QNX_TOOLS_PATH=/workspace/tools/prebuilt_QNX700

export QNX_CONFIGURATION=$QNX_TOOLS_PATH/.qnx
export QNX_TARGET=$QNX_TOOLS_PATH/target/qnx7
export QNX_HOST=$QNX_TOOLS_PATH/host/linux/x86_64
export QNX_ARCH=aarch64le
export MAKEFLAGS=-I$QNX_TOOLS_PATH/target/qnx7/usr/include
export MAKELDFLAGS=-L$QNX_TOOLS_PATH/target/qnx7/usr/lib,-L$QNX_PREBUILT/target/qnx7/aarch64le/lib
export PATH=$QNX_HOST/usr/bin:/pkg/hwtools/bin/:$PATH
#use aarch64-unknown-nto-qnx7.0.0
QNX_TOOLCHAINS_CC64=$QNX_TOOLS_PATH/host/linux/x86_64/usr/bin/aarch64-unknown-nto-qnx7.0.0-gcc
QNX_TOOLCHAINS_CXX64=$QNX_TOOLS_PATH/host/linux/x86_64/usr/bin/aarch64-unknown-nto-qnx7.0.0-g++

BOOST_ARCHIVE_PATH=${SOURCE_DIR}/3rdparty/archive/boost_1_55_0.tar.gz
BOOST_DIR=${SOURCE_DIR}/3rdparty/boost_1_55_0

echo -e "Project dir: $SOURCE_DIR"

if [ ! -d ${BOOST_DIR} ];then
    ##
    tar -xzf ${BOOST_ARCHIVE_PATH} -C ${SOURCE_DIR}/3rdparty/ 

    cd ${BOOST_DIR}/

    #patch for boost-1.55.0
    patch -p1 < ../archive/boost-1_55-qnx700.patch

    ##install boot to qnx toolchain:prebuilt_QNX700  support libs exp: --with-libraries=context,coroutine
    ./bootstrap.sh --prefix=${QNX_TARGET}/usr

    ##patch for qnx aarch64 cross compile support
    if [ -f project-config.jam ];then
        sed -i -r 's/using gcc ; /using gcc : : \/workspace\/tools\/prebuilt_QNX700\/host\/linux\/x86_64\/usr\/bin\/aarch64-unknown-nto-qnx7.0.0-gcc ;/' project-config.jam
    fi
    ##patch for : 'fatal error: pyconfig.h: No such file or directory'
    if [ -f tools/build/v2/tools/python.jam ];then
        sed -i -r 's/includes \?= \$\(prefix\)\/include\/python\$\(version\) ;/includes ?= \$\(QNX_TARGET\)\/aarch64le\/usr\/include\/python\$\(version\) ;/' tools/build/v2/tools/python.jam
    fi
fi

cd ${BOOST_DIR}/

#--without-context --without-coroutine install without context and coroutine,because "error: #error "platform not supported"
./b2 install link=static --without-context --without-coroutine variant=release toolset=gcc target-os=qnxnto cxxflags="-Wno-unused-function -std=gnu++11 -fPIC" --prefix=${QNX_TARGET}/usr -j12
cd ${ROOT_DIR}

patch:boost-1_55-qnx700.patch //QCC

diff --git a/libs/filesystem/src/operations.cpp b/libs/filesystem/src/operations.cpp
index a1504b5..01d2ba9 100644
--- a/libs/filesystem/src/operations.cpp
+++ b/libs/filesystem/src/operations.cpp
@@ -1410,7 +1410,8 @@ namespace detail
     //   "http://man7.org/linux/man-pages/man2/fchmodat.2.html"
 #   if defined(AT_FDCWD) && defined(AT_SYMLINK_NOFOLLOW) \
       && !(defined(__SUNPRO_CC) || defined(sun)) \
-      && !(defined(linux) || defined(__linux) || defined(__linux__))
+      && !(defined(linux) || defined(__linux) || defined(__linux__)) \
+      && !(defined(__QNX__) || defined(__QNXNTO__))
       if (::fchmodat(AT_FDCWD, p.c_str(), mode_cast(prms),
            !(prms & symlink_perms) ? 0 : AT_SYMLINK_NOFOLLOW))
 #   else  // fallback if fchmodat() not supported
diff --git a/tools/build/v2/tools/qcc.jam b/tools/build/v2/tools/qcc.jam
index 3b35578..fc717b7 100644
--- a/tools/build/v2/tools/qcc.jam
+++ b/tools/build/v2/tools/qcc.jam
@@ -219,7 +219,7 @@ if [ os.name ] = NT
 actions piecemeal archive
 {
     $(RM) "$(<)"
-    "$(CONFIG_COMMAND)" -A "$(<)" "$(>)"
+    "$(CONFIG_COMMAND)" -Vgcc_ntoaarch64le -A "$(<)" "$(>)"
 }

  1. 结果


Component configuration:
- atomic : building
- chrono : building
- context : not building
- coroutine : not building
- date_time : building
- exception : building
- filesystem : building
- graph : building
- graph_parallel : building
- iostreams : building
- locale : building
- log : building
- math : building
- mpi : building
- program_options : building
- python : building
- random : building
- regex : building
- serialization : building
- signals : building
- system : building
- test : building
- thread : building
- timer : building
- wave : building
...patience...
...patience...
...patience...
...patience...
...patience...
...found 29513 targets...

猜你喜欢

转载自blog.csdn.net/liaochaoyun/article/details/129519752
今日推荐