用于power-pc的交叉编译升级库失败

时间:2017-05-13 11:13:24

标签: linux gcc boost g++ cross-compiling

我需要交叉编译power-pc的boost库。

请在下面找到我为了让它运行而执行的步骤:

我已经

  1. 已下载boost 1.61
  2. / home / emh2
  3. 下解压缩
  4. 并执行 sudo ./home/bootstrap.sh 以提升构建器 b2
  5. Boost.Builder b2 已成功创建。
  6. 交叉编译器 powerpc-bt-linux-gnuspe-g ++ 位于以下路径下:

      

    的/ usr /本地/交叉/ i686的-BT-的Linux的/ usr /斌/ PowerPC的BT-Linux的gnuspe /

    交叉编译器的include目录如下

      

    的/ usr /本地/交叉/ ppce500v2-BT-Linux的gnuspe的/ usr /包括/ C ++ / 5.2.0 / PowerPC的BT-Linux的gnuspe

         

    的/ usr /本地/交叉/ ppce500v2-BT-Linux的gnuspe的/ usr /包括/ C ++ / 5.2.0 /

         

    的/ usr /本地/交叉/ ppce500v2-BT-Linux的gnuspe的/ usr /包括/

    接下来,我在 / home user-config.jam 中创建了以下内容:

     using gcc 
     : ppc 
     : /usr/local/cross/i686-bt-linux/usr/bin/powerpc-bt-linux-gnuspe/powerpc-bt-linux-gnuspe-g++ 
     : <compilerflags>-I/usr/local/cross/ppce500v2-bt-linux-gnuspe/usr/include/c++/5.2.0/powerpc-bt-linux-gnuspe -I/usr/local/cross/ppce500v2-bt-linux-gnuspe/usr/include/c++/5.2.0/ -I/usr/local/cross/ppce500v2-bt-linux-gnuspe/usr/include/    ;
    

    之后我用

    开始交叉编译
      

    ./ b2 toolset = gcc-ppc --with-log

    这是输出,表示无法找到文件/目录:

    Performing configuration checks
    - 32-bit                   : yes (cached)
    - arm                      : no  (cached)
    - mips1                    : no  (cached)
    - power                    : yes (cached)
    
    Building the Boost C++ Libraries.
    - symlinks supported       : yes (cached)
    - compiler-supports-visibility : yes (cached)
    - has_icu builds           : no  (cached)
    - lockfree boost::atomic_flag : no  (cached)
    Component configuration:
    
    - atomic                   : not building
    - chrono                   : not building
    - container                : not building
    - context                  : not building
    - coroutine                : not building
    - coroutine2               : not building
    - date_time                : not building
    - exception                : not building
    - filesystem               : not building
    - graph                    : not building
    - graph_parallel           : not building
    - iostreams                : not building
    - locale                   : not building
    - log                      : building
    - math                     : not building
    - metaparse                : not building
    - mpi                      : not building
    - program_options          : not building
    - python                   : not building
    - random                   : not building
    - regex                    : not building
    - serialization            : not building
    - signals                  : not building
    - system                   : not building
    - test                     : not building
    - thread                   : not building
    - timer                    : not building
    - type_erasure             : not building
    - wave                     : not building
    ...patience...
    ...patience...
    ...patience...
    ...patience...
    ...found 4056 targets...
    ...updating 208 targets...
    gcc.compile.c++ bin.v2/libs/atomic/build/gcc-ppc/release/threading- multi/lockpool.o
    libs/atomic/src/lockpool.cpp:15:19: fatal error: cstddef: No such file or   directory
    compilation terminated.
    
    "/usr/local/cross/i686-bt-linux/usr/bin/powerpc-bt-linux-gnuspe/powerpc-bt-linux-gnuspe-g++"  -ftemplate-depth-128 -O3 -finline-functions -Wno-inline    -Wall -pthread -fPIC -m32  -DBOOST_ALL_NO_LIB=1 -DBOOST_ATOMIC_DYN_LINK=1   -DBOOST_ATOMIC_SOURCE -DNDEBUG  -I"." -c -o "bin.v2/libs/atomic/build/gcc-ppc   /release/threading-multi/lockpool.o" "libs/atomic/src/lockpool.cpp"
    
    ...failed gcc.compile.c++ bin.v2/libs/atomic/build/gcc-ppc/release/threading-  multi/lockpool.o...
    ...skipped <pbin.v2/libs/atomic/build/gcc-ppc/release/threading-  multi>libboost_atomic.so.1.61.0 for lack of <pbin.v2/libs/atomic/build/gcc-ppc  /release/threading-multi>lockpool.o...
    ...skipped <pstage/lib>libboost_atomic.so.1.61.0 for lack of <pbin.v2/libs /atomic/build/gcc-ppc/release/threading-multi>libboost_atomic.so.1.61.0...
    ...skipped <pstage/lib>libboost_atomic.so for lack of   <pstage/lib>libboost_atomic.so.1.61.0...
    gcc.compile.c++ bin.v2/libs/date_time/build/gcc-ppc/release/threading-  multi/gregorian/greg_month.o
    In file included from ./boost/date_time/gregorian/greg_month.hpp:12:0,
                 from libs/date_time/src/gregorian/greg_month.cpp:14:
    ./boost/date_time/constrained_value.hpp:12:21: fatal error: exception: No    such file or directory
    compilation terminated.
    

    我在这里缺少什么?为什么我会收到这些“没有这样的文件或目录”错误?

1 个答案:

答案 0 :(得分:0)

首先,我会跑

./b2 --debug-configuration -n 

here所述。这应该允许您确认b2正在抓取正确的卡纸文件。它在/ home / user /中查找user-config.jam,因此如果它已经存在,您可能需要将其移动到该目录。

此外,我发现自己需要写出<compileflag>-option1 <compileflag>-option2 etc...可能有一种方法可以传递一系列选项,但只是在单<compileflags>之后将它们分开。似乎工作。

输出显示运行的完整编译命令。您应该看到您的编译标志显示在那里,并可以使用它来验证您的jam文件语法是否正常工作。

在上面的输出中,您可以预期包含的内容

"/usr/local/cross/i686-bt-linux/usr/bin/powerpc-bt-linux-gnuspe/powerpc-bt-linux-gnuspe-g++"  -ftemplate-depth-128 -O3 -finline-functions -Wno-inline    -Wall -pthread -fPIC -m32  -DBOOST_ALL_NO_LIB=1 -DBOOST_ATOMIC_DYN_LINK=1   -DBOOST_ATOMIC_SOURCE -DNDEBUG  -I"." -c -o "bin.v2/libs/atomic/build/gcc-ppc   /release/threading-multi/lockpool.o" "libs/atomic/src/lockpool.cpp"
相关问题