用于PowerPC架构的Cross Compile Boost库 [英] Cross Compile Boost library for PowerPC architecture

查看:197
本文介绍了用于PowerPC架构的Cross Compile Boost库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图交叉编译用于PowerPC架构的Boost库(Thread,System)。我按照以下步骤,但面临问题。



我运行一个shell脚本,设置我的工具链。编译器ppc_4xx-g ++在shell上可见。



以下步骤:


  1. 添加行using gcc:power:ppc_4xx-g ++;到文件user-config.jam

  2. 在根目录中运行./bootstrap.sh --prefix = BoostPowerPC。

  3. 运行./b2 install --build-dir = BoostPowerPC工具集= gcc-power --with-thread --with-system阶段

结果:目录被创建,但编译失败。我不能附加错误日志(请给我您的电子邮件,以便我可以发送您的错误日志,如果你需要)。下面是错误日志的快照。

 组件配置:

- atomic:not building
- chrono:不构建
- 上下文:不构建
- date_time:不构建
- 异常:不构建
- 文件系统:不构建
- 图:not building
- graph_parallel:not building
- iostreams:not building
- locale:not building
- math:not building
- mpi:not building
- program_options:不构建
- python:不构建
- 随机:不构建
- 正则表达式:不构建
- 序列化:不构建
- 信号:没有建立
- system:building
- test:not building
- thread:building
- timer:not building
- wave:not building
b $ b ... patience ...
...找到20376个目标...
...更新10110目标...
common.mkdir BoostPowerPC
common。 mkdir BoostPowerPC / lib
common.mkdir BoostPowerPC / boost
common.mkdir BoostPowerPC / boost / bin.v2
common.mkdir BoostPowerPC / boost / bin.v2 / libs
common。 mkdir BoostPowerPC / boost / bin.v2 / libs / system
common.mkdir BoostPowerPC / boost / bin.v2 / libs / system / build
common.mkdir BoostPowerPC / boost / bin.v2 / libs / system / build / gcc-power
common.mkdir BoostPowerPC / boost / bin.v2 / libs / system / build / gcc-power / release
common.mkdir BoostPowerPC / boost / bin.v2 / libs / system / build / gcc-power / release / threading-multi
gcc.compile.c ++ BoostPowerPC / boost / bin.v2 / libs / system / build / gcc-power / release / threading-multi / error_code.o
在./boost/config/select_stdlib_config.hpp:18中包含的文件中,
来自./boost/config.hpp:40,
来自./boost/system/config.hpp:13,
来自libs / system / src / error_code.cpp:18:
/opt/ELDK/4.2/ppc_4xx/usr/include/c++/4.2.2/cstddef:50:28:error:bits / c ++ config.h:没有这样的文件或目录
包含在/opt/ELDK/4.2/ppc_4xx/usr/include/c++/4.2.2/ios:43,
从/ opt /ELDK/4.2/ppc_4xx/usr/include/c++/4.2.2/ostream:45,
来自/opt/ELDK/4.2/ppc_4xx/usr/include/c++/4.2.2/iterator:70,
来自./boost/iterator.hpp:17,
来自./boost/operators.hpp:86,
来自./boost/system/error_code.hpp:17,
从libs / system / src / error_code.cpp:19:



它抱怨找不到文件c ++ config.h。但是该文件位于/opt/ELDK/4.2/usr/include/c++/4.2.2/powerpc-linux/bits目录中



然后我试图请在b2命令中使用标签include。但是,然后我得到一个错误,找不到文件cstddef是存在于目录/opt/ELDK/4.2/usr/include/c++/4.2.2。我想我已经写了包含路径。



你认为是什么问题?为什么我的编译器找不到文件,即使它的存在?有任何建议吗?



更新:



我使用-d + 2和-q选项, 。

 ppc_4xx-g ++-ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -pedantic -pthread -fPIC -DBOOST_ALL_NO_LIB = 1 -DBOOST_SYSTEM_DYN_LINK = 1 -DNDEBUG -I。 -I/opt/ELDK/4.2/ppc_4xx/usr/include-c -oBoostPowerPC / boost / bin.v2 / libs / system / build / gcc-power / release / threading-multi / error_code.o libs / system / src / error_code.cpp

编译日志:

 在./boost/config/select_stdlib_config.hpp:18中包含的文件中,
来自./boost/config.hpp:40,
从./boost/system/config.hpp:13,
从libs / system / src / error_code.cpp:18:
/opt/ELDK/4.2/ppc_4xx/usr/include/c++/ 4.2.2 / cstddef:50:28:error:bits / c ++ config.h:没有这样的文件或目录

我们可以看到更高的目录,它包含所需的文件,并且对编译器可见。我甚至尝试使用-L命令并指定根目录。它仍然没有帮助。



我检查了ppc_4xx-g ++和2个感兴趣的选项的编译选项


  1. - sysroot =:这是编译器使用的所有include和库的根目录。


  2. -B:使用它,我们可以为编译器添加一个搜索路径。


帮帮我。任何建议?

解决方案

问题是因为编译器中的错误。它无法递归搜索目录以查找包含文件夹。当我手动提供额外的包含路径,它拒绝它说明冗余包含路径(因为它是在相同的目录结构) - 通过使用-v选项找到这一点。然后我创建了一个目录,创建一个软链接到具有必要的包含文件的目录,并将这个新目录包含在我的包含路径(解决方法)。这个工作,我可以生成库。



例如:include文件存在于目录abc / include / xyz / include中,编译器不接受已经指定路径abc / include。因此,我创建了一个目录别名,并将其链接到abc / include / xyz / include。然后我包括./alias作为包括路径之一,它的工作。这是一个已知的编译器问题,在以后的版本中是固定的,我认为在4.6



PS:这个想法不是我的,但发现了一个类似的网上帮助我。 / p>

I am trying to cross compile Boost library (Thread, System) for PowerPC architecture. I followed the below steps but facing problems.

I run a shell script which sets up my toolchain. The compiler ppc_4xx-g++ is visible at the shell.

Steps followed:

  1. Add the line "using gcc : power : ppc_4xx-g++ ;" to the file user-config.jam
  2. Run ./bootstrap.sh --prefix=BoostPowerPC in root directory.
  3. Run ./b2 install --build-dir=BoostPowerPC toolset=gcc-power --with-thread --with-system stage

Result: All the directories gets created but compilation fails. I can't attach the error log (Please send me your email so that I can send you the error log if you need). Below is the snapshot of the error log.

Component configuration:

- atomic                   : not building
- chrono                   : not building
- context                  : 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
- math                     : 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                   : building
- test                     : not building
- thread                   : building
- timer                    : not building
- wave                     : not building

...patience...
...found 20376 targets...
...updating 10110 targets...
common.mkdir BoostPowerPC
common.mkdir BoostPowerPC/lib
common.mkdir BoostPowerPC/boost
common.mkdir BoostPowerPC/boost/bin.v2
common.mkdir BoostPowerPC/boost/bin.v2/libs
common.mkdir BoostPowerPC/boost/bin.v2/libs/system
common.mkdir BoostPowerPC/boost/bin.v2/libs/system/build
common.mkdir BoostPowerPC/boost/bin.v2/libs/system/build/gcc-power
common.mkdir BoostPowerPC/boost/bin.v2/libs/system/build/gcc-power/release
common.mkdir BoostPowerPC/boost/bin.v2/libs/system/build/gcc-power/release/threading-multi
gcc.compile.c++ BoostPowerPC/boost/bin.v2/libs/system/build/gcc-power/release/threading-multi/error_code.o
In file included from ./boost/config/select_stdlib_config.hpp:18,
             from ./boost/config.hpp:40,
             from ./boost/system/config.hpp:13,
             from libs/system/src/error_code.cpp:18:
/opt/ELDK/4.2/ppc_4xx/usr/include/c++/4.2.2/cstddef:50:28: error: bits/c++config.h: No such file or directory
In file included from /opt/ELDK/4.2/ppc_4xx/usr/include/c++/4.2.2/ios:43,
             from /opt/ELDK/4.2/ppc_4xx/usr/include/c++/4.2.2/ostream:45,
             from /opt/ELDK/4.2/ppc_4xx/usr/include/c++/4.2.2/iterator:70,
             from ./boost/iterator.hpp:17,
             from ./boost/operators.hpp:86,
             from ./boost/system/error_code.hpp:17,
             from libs/system/src/error_code.cpp:19:
.
.
.

Its complaining that the file c++config.h is not found. But the file is present in the location /opt/ELDK/4.2/usr/include/c++/4.2.2/powerpc-linux/bits directory

Then I tried to use the tag "include" in the b2 command. But then I get a error that the file cstddef is not found which is present in the directory /opt/ELDK/4.2/usr/include/c++/4.2.2. I think I am over writing the include path.

What do you think is the problem ? Why can't my compiler find the file even if its present ? Any suggestions ?

Update:

I used -d+2 and -q options and below is the result.

"ppc_4xx-g++"  -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -pedantic -pthread -fPIC  -DBOOST_ALL_NO_LIB=1 -DBOOST_SYSTEM_DYN_LINK=1 -DNDEBUG  -I"." -I"/opt/ELDK/4.2/ppc_4xx/usr/include" -c -o "BoostPowerPC/boost/bin.v2/libs/system/build/gcc-power/release/threading-multi/error_code.o" "libs/system/src/error_code.cpp"

Compilation log:

In file included from ./boost/config/select_stdlib_config.hpp:18,
             from ./boost/config.hpp:40,
             from ./boost/system/config.hpp:13,
             from libs/system/src/error_code.cpp:18:
/opt/ELDK/4.2/ppc_4xx/usr/include/c++/4.2.2/cstddef:50:28: error: bits/c++config.h: No such file or directory

As we can see the the higher directory which has the required file is included and visible to the compiler. I even tried using -L command and specify the root directory. It still didn't help.

I checked the compilation options of ppc_4xx-g++ and 2 options interested me

  1. --sysroot=: This is the root directory of all the includes and libraries used by the compiler.

  2. -B : Using this we can add a search path for the compiler.

I tried both and it didn't help. Any suggestions ?

解决方案

The problem was because of a bug in the compiler. It couldn't recursively search for directories to find the include folders. When I manually provided the additional include path, it rejected it stating redundant include path (since it was in the same directory structure) - Found this by using -v option. Then I created a directory, created a soft link to the directory which had the necessary include files and included this new directory in my include path (Workaround). This worked and I could generate the libraries.

Eg: The include files were present in the directory abc/include/xyz/include which the compiler was not accepting as I had already specified the path abc/include. Hence I created a directory alias and linked it to abc/include/xyz/include. Then I included ./alias as one of the include paths and it worked. This was a known compiler issue which is fixed in later versions, I think in 4.6

PS: The idea was not mine but found a similar post online which helped me.

这篇关于用于PowerPC架构的Cross Compile Boost库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆