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, 可以調整其他版本,比如-V gcc/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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM