linux 交叉编译(CC)开源库

 

--host:

 arm-linux/arm-qnx

./configure  --host=arm-linux --prefix=/your_workspace/install CC=/release_version/toolchains/aarch64--glibc--stable/bin/aarch64-linux-gcc

make && make install

 

--boost

QNX.
/b2 toolset=qcc target-os=qnxnto threadapi=pthread link=shared -l240 --layout=system --without-python cxxflags="-Vgcc_ntoaarch64le -Y_cxx -Wc,-std=gnu++14 -D_LITTLE_ENDIAN" linkflags="-Vgcc_ntoaarch64le -Y_cxx -lang-c++" -j4
./b2 install link=static toolset=qcc cxxflags="-Vgcc_ntoaarch64le" target-os=qnxnto --prefix=/your_install_path
 
对于-Vgcc_ntoaarch64le, 可以调整其他版本,比如-Vgcc/5.3.0,gcc_ntoaarch64le; -Vgcc/8.3.0,gcc_ntoaarch64le
而对于QCC不能指向对应的qcc路径,这个需要手动绑定qcc所在路径

 

ARM:

1. ./bootstrap.sh 

2. 修改project-config.jam

3. ./b2 install link=static toolset=gcc --no-samples --no-tests --prefix=/home/yexf/Downloads/boost_1_76_0/install

 

# B2 Configuration

# Automatically generated by bootstrap.sh

import option ;
import feature ;

# Compiler configuration. This definition will be used unless
# you already have defined some toolsets in your user-config.jam
# file.
if ! gcc in [ feature.values <toolset> ]
{
# using gcc ;
using gcc : : /work/sdk/toolchains/aarch64--glibc--stable-2020.08-1/bin/aarch64-linux-gcc ;
}

project : default-build <toolset>gcc ;

# Python configuration
import python ;
if ! [ python.configured ]
{
using python : 2.7 : "/usr" ;
}

path-constant ICU_PATH : /usr ;


# List of --with-<library> and --without-<library>
# options. If left empty, all libraries will be built.
# Options specified on the command line completely
# override this variable.
libraries = ;

# These settings are equivalent to corresponding command-line
# options.
option.set prefix : /usr/local ;
option.set exec-prefix : /usr/local ;
option.set libdir : /usr/local/lib ;
option.set includedir : /usr/local/include ;

 

# Stop on first error

option.set keep-going : false ;

 

QNX7.1:

1. ./bootstrap.sh 

2. 修改project-config.jam

3. ./b2 install toolset=qcc cxxflags="-Vgcc/8.3.0,gcc_ntoaarch64le" --without-python --without-context target-os=qnxnto --prefix=/home/yexf/Downloads/boost_1_76_0/install

using qcc : : /work/sdk/qnx7.1/host/linux/x86_64/usr/bin/qcc ;

 

上面指令如果无法对应可以指定architeure/address-model

./b2 install link=shared toolset=qcc cxxflags="-Vgcc/8.3.0,gcc_ntoaarch64le" linkflags="-Vgcc/8.3.0,gcc_ntoaarch64le" target-os=qnxnto architecture=arm address-model=64 --without-python

 

STRACE(aarch64) as follows:

1. bootstrap
2. ./configure CC=/work/toolchains/aarch64--glibc--stable-2020.08-1/bin/aarch64-linux-gcc LD=/work/toolchains/aarch64--glibc--stable-2020.08-1/bin/aarch64-linux-ld --host=aarch64-linux --target=aarch64-linux --prefix=/work/software/strace/strace/install --enable-mpers=no
3. make
4. make install

 

 GCC(aarch64) as follows:

./configure CC=/work/toolchains/aarch64--glibc--stable-2020.08-1/bin/aarch64-linux-gcc CXX=/work/toolchains/aarch64--glibc--stable-2020.08-1/bin/aarch64-linux-g++ AR=/work/toolchains/aarch64--glibc--stable-2020.08-1/bin/aarch64-linux-ar LD=/work/toolchains/aarch64--glibc--stable-2020.08-1/bin/aarch64-linux-ld --host=aarch64-linux --target=aarch64-linux --prefix=/work/software/gdb/gdb-13.2/install

 

configure: error: GMP is missing or unusable

如果提示缺少GMP,则需要重新编译GMP,再用--with-libgmp-prefix=/your_gmp_install_path, 这个path里面包括include和lib

指定gmp路径:

./configure CC=/work/toolchains/aarch64--glibc--stable-2020.08-1/bin/aarch64-linux-gcc CXX=/work/toolchains/aarch64--glibc--stable-2020.08-1/bin/aarch64-linux-g++ AR=/work/toolchains/aarch64--glibc--stable-2020.08-1/bin/aarch64-linux-ar LD=/work/toolchains/aarch64--glibc--stable-2020.08-1/bin/aarch64-linux-ld --host=aarch64-linux --target=aarch64-linux --prefix=/work/software/gdb/gdb-13.2/install --with-libgmp-prefix=/work/software/gmp/gmp-6.3.0/install

 

GMP(aarch64) as follows:

./configure CC=/work//toolchains/aarch64--glibc--stable-2020.08-1/bin/aarch64-linux-gcc CXX=/work/toolchains/aarch64--glibc--stable-2020.08-1/bin/aarch64-linux-g++ AR=/work/toolchains/aarch64--glibc--stable-2020.08-1/bin/aarch64-linux-ar LD=/work/toolchains/aarch64--glibc--stable-2020.08-1/bin/aarch64-linux-ld --host=aarch64-linux --target=aarch64-linux --prefix=/work/software/gmp/gmp-6.3.0/install

posted @ 2022-02-11 15:34  sciapex  阅读(1106)  评论(0编辑  收藏  举报