【问题标题】:Cross compiling boost libraries for power-pc fails为 power-pc 交叉编译 boost 库失败
【发布时间】:2017-10-12 15:25:33
【问题描述】:

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

请在下面找到我为使其运行而执行的步骤:

我已经

  1. 下载了 boost 1.61
  2. /home/emh2下解压
  3. 并执行 sudo ./home/bootstrap.sh 来提升构建器 b2
  4. Boost.Builder b2 已成功创建。

交叉编译器powerpc-bt-linux-gnuspe-g++位于以下路径下:

/usr/local/cross/i686-bt-linux/usr/bin/powerpc-bt-linux-gnuspe/

交叉编译器的包含目录如下

/usr/local/cross/ppce500v2-bt-linux-gnuspe/usr/include/c++/5.2.0/powerpc-bt-linux-gnuspe

/usr/local/cross/ppce500v2-bt-linux-gnuspe/usr/include/c++/5.2.0/

/usr/local/cross/ppce500v2-bt-linux-gnuspe/usr/include/

接下来我在 /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 工具集=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.

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

【问题讨论】:

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


    【解决方案1】:

    首先,我会运行

    ./b2 --debug-configuration -n 
    

    here 所述。这应该可以让您确认 b2 正在抓取正确的 jam 文件。它会在 /home/user/ 中查找 user-config.jam,因此如果该目录不存在,您可能需要将其移至该目录。

    此外,我发现自己需要写出 &lt;compileflag&gt;-option1 &lt;compileflag&gt;-option2 etc... 可能有一种方法可以传递一整串选项,但在单个 &lt;compileflags&gt; 之后将它们分开似乎不起作用。

    输出显示了运行的完整编译命令。您应该会看到您的编译标志出现在那里,并且可以使用它来验证您的 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"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-04-12
      • 1970-01-01
      • 2018-08-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多