MasterofProject
CSDN home>

How to build PowerLinux IBM application on X86 Intel server

Published in11:08 2015-11-04| Time reading| sourceCSDN| ZeroArticle comments| authorIBM

Abstract:This article will introduce how to use the Toolchain cross compiler, easy to build the source code running on the Architecture Power. This paper will answer about cross compile application performance, function and on the IBM powerlinux "server native debugging ability to compile the application of cross.

 brief introduction

Will run on the x86 server on Linux & reg; applications ported to another platform, such as powerlinux and need to set a different construction environment to compile the application, is it? Not necessary. You can on the x86 servers using a cross compiler, to construct a different platform architecture (such as IBM Power & reg;) the application binary file. Cross compiler has existed for a long time. They are mainly used to build applications for embedded systems with limited resources in order to run the operating system that can support the native compiler. For the first time, I understand that the cross compiler is involved in a project for handheld devices. I write and compile the source code on the x86 workstation, and load the binary files into the device through a serial communication link. Recently, I was using a cross compiler to build a simple application, so as to control the servo motor of a remote control device I have studied. Well, we get.

This article will introduce the Advance Toolchain for PowerLinux IBM contains the cross compiler. From here, I'll call the Advance Toolchain for PowerLinux IBM"Toolchain".ToolchainIs a set of open source development tools and runtime libraries, which enables users to use the latest Power IBM hardware characteristics on the Linux.ToolchainItself is self-contained and does not depend on the system toolchain. It is installed in/optIn the middle, so will not override the default Linux distribution toolchain. At the time of writing this article, the latest version contains the following package of the latest stable version:

  • The GNU compiler collection (GCC, G + + and gfortran), and all for the support of the IBM Power & reg; processor optimized GCC runtime
  • C GNU Library (glibc), which is optimized to support the POWER processor.
  • GNU binary utility (binutils)
  • Decimal floating-point Library (libdfp), optimization of, added support for IBM power7 & reg; and IBM power8 "processor server hardware DFP based on
  • AUXV Library (libauxv)
  • GNU debugger (GDB)
  • Performance analysis tools (oprofile, Valgrind, and iTrace)
  • Using multi core library (Intel TBB, Userspace RCU), from5.0-3Version start
  • As well as multiple support libraries (such as libhugetlbfs, zlib, etc.)

Related DownloadToolchainFor information, please refer to the reference section at the end of this paper.

For the purpose of this paper, we will introduce the toolchain cross compiler. This article describes how to useToolchainCross compiler, the x86 server to build a binary executable program for PowerLinux. The following questions have been answered in the paper.

  • In the X86 platform to build a cross compiler application, the performance of the native PowerLinux built on the binary program so good?
  • Cross compiled applications and libraries built on the X86 platform, do they have the same application binary features as the application built on the PowerLinux?
  • Cross compiled applications built on the X86 platform will generate binary programs that can perform native debugging on the PowerLinux.

To answer these questions, I used two popular open source applications, PostgreSQL and httpd Apache servers. PostgreSQL and httpd Apache source code release are used on the x86 serverToolchainCross compiler to build, but also in the PowerLinux server is built on the original. These applications are then installed in a different installation directory on a PowerLinux server and run. I ran two benchmark tools for these applications, and compared their performance and functionality.

The results of the test will be presented in the following sections. For readers who are interested in re creating tests,Environment and configurationandBuilding applications using toolchainSection, respectively, introduces the environment configuration and how to build the information of these applications.

result

To test these applications, I used a number of open benchmark tools. For PostgreSQL, I used the pgbench-tool from GitHub. It uses the PostgreSQL source code release with pgbench tools. For Apache httpd, I used the Apache httpd source code release with Apache bench (AB) tools. Please refer to the reference section at the bottom of this article to learn about the information about the place where you downloaded the pgbench-tools.

PostgreSQL test setup and results

After building a PostgreSQL application on a x86 server using a cross compiler, the complete binary assembly is transferred to a PowerLinux server. We have the following modifications to the default configuration file:

 

Max_connections Postgresql.conf = 4096 shared_buffers = synchronous_commit = off = checkpoint_segments = checkpoint_timeout = 3 2048MB = 5min

Modify PowerLinux system settingsKernel.semValue.

 

Kernel.sem sysctl.conf = 250320003212288

Modify the configuration file for pgbench-tools

 

MAX_WORKERS= "32".

According to the pgbench-tools website, PostgreSQL test according to the following steps to run:

  1. Create pgbench and results database.
  2. Initialize the results database.
  3. Create a test set that contains the description.
  4. Run the test using the runset script.
  5. Compile and submit test results.

For specific information about the execution of these steps, seePgbench-tools file.

Postgresql results (cross compiler)

The following are the results of running pgbench-tools on a cross compiled binary program on a Power server.

Fig. 1 the ratio of cross compiled PostgreSQL binary program

Fig. 1 the ratio of cross compiled PostgreSQL binary program

The ratio coefficient shows the trend of the number of transactions per second with the increase of the size of the database. The green line is the size of the database (MB), the red line represents the number of transactions per second. The graph shows that with the increase in the size of the database, the number of transactions per second will decrease.

Figure 2 cross compiled PostgreSQL binary program scalability diagram

Figure 2 cross compiled PostgreSQL binary program scalability diagram

Figure 2Shows a scalable graph. It shows that the number of transactions per second will increase as the number of clients increases.

PostgreSQL results (native compiler)

Test native compiled binary program, using the same configuration settings and database location (/tmp/usr/local/pgsql/data) with the cross compiled PostgreSQL. To ensure that the database is clean, discard the results and pgbench databases before starting the test.

Drop database results Postgresql#;

DATABASE DROP

Drop database pgbench postgresql#;

DATABASE DROP

Proportional coefficient and scalable graphFigure 3andFigure 4As shown. As mentioned before, the ratio coefficient shows the change in the number of transactions per second with the increase in the size of the database. The green line is the size of the database (MB), the red line represents the number of transactions per second.

Fig. 3 the proportion of native PostgreSQL binary program

Fig. 3 the proportion of native PostgreSQL binary program

Figure 4 shows that the number of transactions per second will increase as the number of clients increases.

Fig. 4 the scalability of the native PostgreSQL binary program

The construction of the original PostgreSQL binary program scalability map

You can note that the curve graph of the binary program with the native compiler is very similar to the curve graph of the binary program. This simple test shows that the x86 server on the cross compiler can get the same performance characteristics of the binary program with native compiled code.

Httpd Apache test setup and results

In order to test the Apache httpd benchmark tool I use Apache httpd source code release with theAB. Similar to Apache, httpd PostgreSQL is usedToolchainCross compiler construction, and the binary program to the PowerLinux server. I modified the default httpd.conf file in order toHtDocsTo point to local document. Remaining set to retain the default value.

I used to runABThe command line and parameters of the tool are as follows:

 

-n #./ab 500000 -c 100 out1.data -g http://9.3.4.241/

I run the command 3 times, write the output to the out1.data, out2.data, and out3.data, and use theGnuplotThe parameters in the utility and benchmark.tpl files describe the images of these files, as shown below.

 

# gnuplot benchmark.tpl

Benchmark.tpl output as PNG image set terminal # png

# save file to "benchmark.png" set output benchmark.png ""

# graph title set title Benchmark for 9.3.4.241 ""

Aspect ratio for image size set # size 1,1

Enable grid on Y-axis set grid # y

# X-axis label set xlabel Request ""

# Y-axis label set ylabel Response Time (MS)"

# plot data using column 10 with smooth sbezier lines plot out1.data using 10 smooth sbezier with lines title "benchmark 1:" and \ using out2.data 10 smooth sbezier with lines of the title "benchmark 2:" and \ using out3.data 10 smooth sbezier with lines title "benchmark 3:"

For more information about the Apache benchmark tool, see the end of this article.reference materialpart

Httpd Apache results (native compilation and cross compilation)

GnuplotUtility for each test to generate a file named benchmark.png. These graphs can use any image viewer for viewing. Two pictures such asFigure 5andFigure 6As shown.

Figure 5Shows the native compilation of the httpd curve.

Fig. 5 response time curves of native compiled httpd

Fig. 5 response time curves of native compiled httpd

Figure 6Shows the cross compilation of the httpd curve.

Fig. 6 response time curves of cross compiled httpd

Fig. 6 response time curves of cross compiled httpd

You can notice that the two curves show very similar performance characteristics. Readers can use different Web documents and data to perform more tests.

Functional and debug findings

In addition to performance, developers may have otherToolchainCross compiler issues related to the use of. This section answers questions related to the ability of the binary program to cross compile and debug. These problems are:

  • Cross compiler construction of a binary program, the function is not compatible with the original construction of the executable program?
  • Cross compiled binary program can be debugged on the PowerLinux server?

The next two simple cases help to answer these questions.

  • Use case 1: replace one or more shared library of one native httpd to useToolchainShared library constructed by cross compiler. See if the native build httpd is still running.
  • Use case 2: attach a debugger to a running process on the PowerLinux server. The process is a cross compiled binary executable program from the x86 server. Set a breakpoint, set the source directory, and the implementation of a set of functions.

Use case 1: functional test

The following is a description of the actions that I followed in the use case 1:

  1. The original construction of the httpd installed in the /home/usr/local.
  2. Running /home/use/local/bin/httpd binary programLDDUtility in order to show that it is a shared binary dependency. You can notice that both libaprutil-1.so.0 and libapr-1.so.0 are located in the /home/usr/local/lib. These libraries are part of the native compiled library that httpd needs.

 

[root@localhost lib]# LDD../../bin/httpd linux-vdso64.so.1 (0x00000fffa1140000) = > libaprutil-1.so.0 = > /home/usr/local/apr/lib/libaprutil-1.so.0 (0x00000fffa10c0000) libapr-1.so.0 = /home/usr/local/apr/lib/libapr-1.so.0 (0x00000fffa1060000) librt.so.1 = /opt/at7.0-5-rc1/lib64/power7/librt.so.1 (0x00000fffa1040000) libcrypt.so.1 = /opt/at7.0-5-rc1/lib64/power7/libcrypt.so.1 (0x00000fffa0ff0000) libpthread.so.0 = > /opt/at7.0-5-rc1/lib64/power7/ libpthread.so.0 (0x00000fffa0fb0000) libdl.so.2 = /opt/at7.0-5-rc1/lib64/power7/libdl.so.2 (0x00000fffa0f90000) libc.so.6 = /opt/at7.0-5-rc1/lib64/power7/libc.so.6 (0x00000fffa0da0000) /opt/at7.0-5-rc1/lib64/ld64.so.1 = /lib64/ ld64.so.1 (0x00000000267a0000)
  1. Delete shared library libaprutil-1.so.0 and libapr-1.so.0.
  2. The cross compiled library libaprutil-1.so.0 and libapr-1.so.0 copied to /tmp/usr/local/lib.
  3. The /tmp/usr/local/lib is included in the LD_LIBRARY_PATH.

 

# CD /home/usr/local/apr/lib # RM libaprutil-1.so.0 # RM libapr-1.so.0 # export LD library LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/tmp/usr/local/lib library LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/tmp/usr/local/lib
  1. Run againLDD结构实用程序可以看到httpd /甲氧苄啶,现在使用了/usr/local中的库lib。

 

[根] # @本地库……/……/我/ LDD httpd Linux vdso64.so.1 =>(0x00000fff951a0000)libaprutil - 1.so.0 => /tmp /usr/local APR /图书馆/ libaprutil - 1.so.0(0x00000fff95150000)libapr - 1.so.0 => /tmp /usr/local APR /图书馆/ libapr - 1.so.0(0x00000fff950f0000)librt.so.1 => /选择/ / / / at7.0-5-rc1 lib64介绍Power7 librt.so.1(0x00000fff950d0000)libcrypt.so.1 => /选择/ / / / at7.0-5-rc1 lib64介绍Power7 libcrypt.so.1(0x00000fff95080000)libpthread.so.0 => /选择/ / / / at7.0-5-rc1 lib64介绍Power7 libpthread.so.0(0x00000fff95040000)libdl.so.2 => /选择/ / / / libdl.so.2 at7.0-5-rc1 lib64介绍Power7(0x00000fff95020000)libc.so.6 => /选择/ / / / at7.0-5-rc1 lib64介绍Power7 libc.so.6(0x00000fff94e30000)libexpat.so.0 => /tmp /usr/local APR /图书馆/ libexpat.so.0(0x00000fff94df0000)at7.0-5-rc1 lib64 /选择/ / / / / ld64.so.1 lib64 ld64.so.1 =>(0x0000000022730000)
  1. 启动应用程序,以查看它是否能像正常应用程序一样运行。

 

# CD /家# /usr/local/bin。/ PS–ef | grep # apachectl启动http:11022 15 41 1 0根?00:00:00 /家/usr/local/bin / httpd启动守护进程11023 11022 15 K 0:41?00:00:00 /家/usr/local/bin / httpd启动守护进程11024 11022 15 K 0:41?00:00:00 /家/usr/local/bin / httpd启动守护进程11022 11025 K 0 15 41?00:00:00 /家/usr/local/bin / httpd启动守护进程11 15 11022 K 0:41?00:00:00 /家/usr/local/bin K / httpd启动
  1. 在浏览器中打开运行httpd进程的powerlinux服务器,查看浏览器上是否显示了以下消息:

它起作用了!

在此场景中,我们结合使用了一个原生编译的库和交叉编译的库.交叉编译的库是使用ppc64架构选项构建的.在此用例中我们可以证明,我们可以在powerlinux服务器上结合使用交叉编译的库和原生编译的可执行程序。

2:调试用例

在第二个用例中,我们尝试证明交叉编译的可执行程序可以在powerlinux服务器上进行调试.以下是我在用例中遵循的操作说明:2

  1. GDB进程.确保使用的版本是,附加到httpd服务器工具链平台上构建的版本交叉编译器在x86。

 

[根]“localhost # GDB attach 25412 GNU GDB(GDB)7.6.50.20130722-cvs版权所有(C)2013年自由软件基金会,公司许可:GNU GPLv3 + 3版GPL或之后的gnu.org<http:////gpl.html许可证>这是自由软件:你是免费的变化和重新分配它。有没有保证,在法律允许的范围。显示“复制”和“型秀保修”的细节。这是“powerpc64 GDB配置Linux”。(gdb)……
  1. 将目录设置到源代码发行版。

 

(gdb)集projecttoolchainplcompile /目录/家/月7

在#(GDB)在0 0x00000fff7cb676f8 _ _ _ newselect _ nocancel()在sysdeps /……/ UNIX系统调用的template.s:81 # 1 3 0x00000fff7cd38274 _睡眠(t = <退出>优化)在UNIX /时间/ time.c:246 # 2 0x0000000010034220在AP或_超时(_ _等待状态0xfffeaa1e704 0xfffeaa1e700 exitcode = =,=,= 0x1003d0c6138 0xfffeaa1e6e0 RET,P,S = < >(MPM)优化出_ common.c 195 3 0x0000000010079238 #:在主服务器_ _环路(剩余_儿童_到发射出_ = < >:优化worker.c)在1654年4 #职工_ run(_ pconf = <退出>优化,优化出伯格= < >,<退出>优化S = 5)在worker.c:1823 # 0x0000000010033430 AP运行在_ _ MPM(pconf 0x1003d0c6138伯格0x1003d0f3378 = =,=,0x1003d0ef4c0 MPM)在_ common.c:96 #主(6 0x000000001002a5d8 = 3 = 0xf argc,argvffeaa1ee28)在main.c:777

  1. 将一个函数移动到4月_睡眠。。。。。。。

 

(gdb)在1月_ # 0x00000fff7cd38274动睡眠(t = <退出>优化)在UNIX /时间/ time.c:246 246精选(0,0,0,0,&电视);
  1. 列出4月_睡眠的源代码。

 

(gdb)列表延迟(T/1000)241 242 243 # else结构timeval;电视;_ 244 tv.tv USEC = T %月_ USEC _通过_秒;秒= 245 tv.tv _吨/月_ USEC _通过_秒;246精选(0,0,0,0,&电视)# } endif;247 248 249 250 # OS2而
  1. 与该进程分离。

 

(detach) Detaching from program:/tmp/usr/local/bin/httpd process, GDB 25412 (GDB) quit

Remote debugging

ToolchainAlso includeGDBSERVERProgram. It allows developers to from a remoteGDBSession connection to their application. Make sure you call on the PowerLinux serverGDBSERVERProgram, you use the GDB from toolchain. For me, be sure to check if it's on my path.

 

# type GDBSERVER GDBSERVER is hashed (/opt/at7.0-5-rc1/bin/gdbserver)

This is used on the PowerLinux server.GDBSERVERAn example of a program. We will attach to a running httpd process:

 

Bin]# GDBSERVER --attach 9.3.4.240:2345 Attached 22589 PID; [root@stgisv241 = 22589 on port Listening 2345

On the x86 server, the httpd binary program on the local server callsPowerpc64-linux-gdbProgram. Please note, from toolchainGDBVersion namePowerpc64-linux-gdb. The use of the httpd binary program is running on the PowerLinux server with a cross compiler version of the binary.

 

PWD /tmp/usr/local/bin [root@stgisv240 bin]# powerpc64-linux-gdb #./httpd GNU GDB (GDB) 7.6.50.20130722-cvs Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+ GNU GPL version later: 3 or <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.Type "show copying" and show warranty "" for details. This GDB was configured as "--host=i686-linux --target= powerpc64-linux". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/ software/gdb/documentation/>. For hel P, type "help". Type "word apropos" search for commands to related to word Reading symbols from /tmp/usr/local/bin/httpd done.... (GDB) ().

Still in the GDB x86 sessionGDBCall in the target command, as shown in the following example.

 

(GDB) target remote 9.3.4.241:2345 Remote debugging using 9.3.4.241:2345 warning:Could not load shared library symbols for 7 libraries e.g. /opt/at7.0-5-rc1/lib64/power7/librt.so.1., Use the "info sharedlibrary" command to see the complete listing. Do you need "set solib-search-path" or "set sysRoot" Reading symbols from? /tmp/usr/local/apr/lib/libaprutil-1.so.0 done. Loaded symbols for /tmp/usr/local/apr/lib/libaprutil-1.so.0... Reading symbols from /tmp/usr/local/apr/lib/ libexpat.so.0 done.... Loaded symbols for /tmp/usr/local/apr/lib/libexpat.so.0 Reading symbols from /tmp/usr/local/apr/lib/libapr-1.so.0 done. Loaded symbols for /tmp/usr/local/apr/lib/libapr-1.so.0..... . reading symbols from /tmp/usr/local/modules/mod_alias.so /tmp/usr/local/modules/mod_alias.so... Done. Loaded symbols for /tmp/usr/local/modules/mod_alias.so /tmp/usr/local/modules/mod_alias.so warning:Unable to find dynamic linker breakpoint. GDB will be unable to debug shared library initializers and track explicitly loaded dynamic code. 0x00000fffa8fe76f8 in?? () (GDB)

Can see some of theGDBThe warning message associated with the library symbol cannot be found.GDBcommandSharedlibrary infoShows the GDB failed to read the symbol library. The following example output shows the GDB failed to read the symbol library. Note that these libraries are part of the system, unless they open the symbol at compile time, otherwise you don't have to worry about them.

 

(GDB)信息sharedlibrary从系统读取的共享库没有linux-vdso64。所以。1 0x00000fffa924ce80 0x00000fffa927e8a8是/tmp /usr/local/ APR / lib / libaprutil-1的0x00000fffa91f7940 0x00000fffa922aa18是/tmp /usr/local/ APR / lib / libexpat。所以。0 0x00000fffa9192e60 0x00000fffa91ca0b8是/tmp /usr/local APR / lib / libapr-1。所以。0没有/选择/ at7.0-5-rc1 / lib64 / POWER7 / librt。没有/选择/ at7.0-5-rc1/lib64/power7/libcrypt没有/选择/ at7.0-5-rc1 / lib64 / libdl POWER7 /没有/选择/ at7.0-5-rc1/lib6。4 /力量/ libpthre没有/选择/ at7.0-5-rc1/lib64/power7/libc.so没有/选择/ at7.0-5-rc1 / lib64 / ld64。所以。1没有/选择/ at7.0-5-rc1/lib64/power7/libnss_f 0x00000fffa8ea0c00 0x00000fffa8ea1878是/tmp /usr/local/模块/ mod_authn_file 0x00000fffa8e810a0 0x00000fffa8e82108是/tmp /usr/local/模块/ mod_authn_core。0x00000fffa8e60da0 0x00000fffa8e61bb0是/tmp /usr/local/模块/ mod_authz_host。0x00000fffa8e40f40 0x00000fffa8e41ed0是/tmp /usr/local/模块/ mod_authz_group 0x00000fffa8e208e0 0x00000fffa8e20f18是/tmp /usr/local/模块/ mod_authz_user。0x00000fffa8e019e0 0x00000fffa8e046d8是/tmp /usr/local/模块/ mod_authz_core。…

如用例2所示,可以在调试原生编译的可执行程序的PowerLinux服务器上本地或远程调试交叉编译的可执行程序另外,可以注意到二进制程序使用。选项来编译,以便生成调试信息。

环境和配置

测试环境有一个IBM Flex System®组成,该系统有多个IBM Flex System X240计算节点和两个基于IBM POWER7处理器的节点(一个Flex系统P260和一个Flex系统P460)。出于本项目的目的,我使用一个Flex System X240计算节点来交叉编译Apache httpd和PostgreSQL。构建二进制程序后,我将它们转移到Flex系统计算节点P460。图7显示了IBM Flex System测试环境的布局图。

图7。IBM Flex System测试环境

Flex System IBM test environment

以下是我的系统配置、操作系统级别和其他与系统设置相关的信息。

Flex System X240计算节点

用于交叉编译二进制程序的英特尔节点仅需要足够的处理能力和内存,以便能够构建二进制程序配置如下功率:

  1. 基于内核的虚拟机(KVM)管理程序Red Hat 6.5
    • 32个处理器
    • 64 GB内存
    • IBM Storwize®v7000存取区域网络(SAN)连接磁盘
  2. 客人系统KVM
    • 红帽企业6.5
    • 4个处理器
    • 16 GB内存
    • 一个virtio磁盘:100 GB
    • 一个配置为BR0的虚拟网络接口卡(NIC)

所有其他KVM客户系统都已关闭,以消除破坏环境的任何可能性。

Flex系统计算节点法则

Flex系统法则计算节点包含多个逻辑分区(LPAR),其中一个配置为测试服务器PowerLinux服务器配置如下:

  1. IBM的PowerVM®来宾
    • 红帽企业6.5
    • 8个处理器(专用)
    • 32 GB内存
    • Storwize v7000三连接磁盘(50 GB)
    • 通过虚拟I/O服务器(VIOS)共享的以太网适配器
  2. LPAR配置
    • 处理模式:专用
      • 最少处理器数:8
      • 目标处理器数:8
      • 最大处理器数:32
    • 专用内存
      • 最小内存:256 MB
      • 目标内存:32 GB
      • 最大内存:64 GB
  3. 虚拟以太网适配器(通过威驰建立)
    • 适配器编号:2
    • VLAN ID:1
    • 需要此适配器来激活虚拟服务器:已选择

以下是我运行的其他一些命令:

 

 

# ppc64_cpu --最小频率:3.56 GHz(CPU 28)最大值:3.56 GHz(CPU 4)平均:3.56 GHz

# ppc64_cpu --核心内核目前= 8号

# sysctl.conf kernel.sem = 250 32000 32 12288

使用工具构建应用程序

Usually, the process of building an open source distribution is an iterative process. If you are lucky, the process may have been constructed. Unfortunately, since most open source distributions are built on X86 servers, it is possible to encounter problems when trying to build them for different architectures, such as the Power IBM architecture.

If you encounter problems when building an open source package on Power, just search for a similar situation on the Internet, see if these reported problems are closely related to your experience. If it is relevant, then in most cases you can find suggestions on how to solve the problem.

For me, although the configuration script to select the correct parameters, PostgreSQL well built to complete, but httpd Apache is not so lucky. The next few sections will be introduced to build the httpd Apache needed for the Power architectureRepair procedure.

Cross compiler experience

When writing this article, I use the cross compiler version is a version of the internal use only IBM, it is designed to fix a bug I encountered during the test and build. Readers can download the 7.0-5 AT version, which is the latest cross compiler (published in this article), with the next few paragraphs to describe the error of the repair process.

As I try to cross compile the apr-1.5.1 source distribution, I see the following compiler messages.

 

"This - program has been built without plugin support sorry"

As I search for possible help and solutions on the Internet, I found a number of links mentioned that the compiler needs to use the "enabled plugin" option to build. I report this problem to the toolchain support team, and the toolchain maintenance staff quickly responded to me and provided me with a modified version of the enabled plugin option. Note that the toolchain cross compiler and native compiler versions both need to be constructed using the enabled plugin option. I can continue to work after getting the toolchain version with the repair program.

This is my first experience with toolchain PowerLinux.

Cross compile 2.4.3 httpd

To cross compile httpd Apache, use the other 3 packages. They are:APR,Apr-utilandPCRE. Find the location of the latest package to download, start using the toolchain cross compiler to build them on the x86 server.

The problem I encountered while building apr-1.5.1 was building the gen_test_char.o module. Please refer toBugzilla ASF - error 51257Learn more about the details. I modified the Makefile.in file (as shown below) and run the buildconf script in order to include the changes in the configuration script.

The modifications to the Makefile.in are shown below:

 

[root@stgisv240 apr-1.5.1]# diff - u Makefile.in../../apr-1.5.1/Makefile.in - Makefile.in 2014-03-17 10:10:26.000000000 typing the Dalai../../apr-1.5.1/Makefile.in 2014-07-03 13:36:11.125013781 typing @ @ -46,7 +46,6, May 5, 2000

Clean = CLEAN_TARGETS apr-config.out apr.exp exports.c export Export_vars.c.Make.dirs \ Build/apr_rules.out Build/apr_rules.out Tools/gen_test_char@EXEEXT@ test Tools/gen_test_char@EXEEXT@ \ - Tools/gen_test_char.o test Tools/gen_test_char.o Tools/gen_test_char.lo test Tools/gen_test_char.lo \ Include/private/apr_escape_test_char.h escape test Include/private/apr_escape_test_char.h DISTCLEAN_TARGETS DISTCLEAN_TARGETS = config.cache config.log config.status \ include/apr.h Include/arch/unix/apr_private.h Include/arch/unix/apr_private.h \ @ @ -132,10 +131,9 @ @ ` make 'tools Make_tools_dir: $MKDIR (APR) tools

-OBJECTS_gen_test_char Gen test char = Tools/gen_test_char.lo test Tools/gen_test_char.lo $(local LIBS) -tools/gen_test_char.lo: test -tools/gen_test_char.lo: make tools dir -tools/gen_test_char@EXEEXT@ test -tools/gen_test_char@EXEEXT@: (link PROG) (objects Gen test char) of $- $$$(objects Gen test char) (all LIBS) +tools/ Gen test Gen_test_char@EXEEXT@: make tools dir +tools/gen_test_char@EXEEXT@ test +tools/gen_test_char@EXEEXT@: Tools/gen_test_char.c test Tools/gen_test_char.c + $(build CC) $(cflags for build $< - o $@ Include/private/apr_escape_test_char.h: escape test Include/private/apr_escape_test_char.h: Tools/gen_test_char@EXEEXT@ test Tools/gen_test_char@EXEEXT@ $MKDIR (APR) include/ private

After modifying the Makefile.in file, I runBuildconfTo create a new configuration script. The next section will describe the parameters and variables used to configure the script. By the way, I was trying to cross compile httpd Apache and its components on other platforms (such as ARM) for the development of a developer's recommendation for configuring the script to select the configuration parameters.

The following are the parameters and environment variables that I use when configuring the apr-1.5.1 components on the x86 server.

 

#配置脚本使用Linux x86 build_cc电力工具链GCC GCC CC cc_for_build = = = powerpc64 Linux GCC CPP = powerpc64 Linux CPP作为= powerpc64 Linux作为AR = powerpc64 Linux AR ranlib = powerpc64 Linux GCC ranlib CXX = powerpc64-linux-c + LD = powerpc64 Linux LD带= powerpc64 Linux带

出口CC CPP作为ascpp AR ranlib cxxcpp CXX LD条目的cc_for_build LDFLAGS建立

。/配置-前缀= /tmp /usr/local/ APR主机= powerpc64 Linux ac_cv_file__dev_zero =没有ac_cv_func_setpgrp_void =没有apr_cv_tcp_nodelay_with_cork =没有ac_cv_sizeof_struct_iovec = 1

build_cc = gcc的安装

我在功率服务器上了略加修改的相同发行版。请注意,用于功率服务器的PowerLinux工具使用了具有类似命名的可执行程序,比如从原生CPPBinutils包安装的CPPLD。修改脚本中的CPP和LD变量,如下所示确保功率。工具链的路径首先传入您的路径环境中。

以下是我在功率服务器上运行apr-1.5.1的配置脚本时使用的参数和环境变量。

 

#配置脚本使用工具对电力build_cc PowerLinux cc_for_build = = GCC GCC CC = powerpc64 Linux GCC CPP = CPP #注意差异= powerpc64 Linux作为AR = powerpc64 Linux AR ranlib = powerpc64 Linux GCC ranlib CXX = powerpc64-linux-c + LD = LD #注意区别带= powerpc64 Linux条# CFLAGS =”MCPU = 440fp - mtune = 440fp --sysroot sysroot美元“# LDFLAGS建立= L sysroot美元/ lib

出口CC CPP作为ascpp AR ranlib cxxcpp CXX LD条目的cc_for_build LDFLAGS建立

。/配置-前缀= /家/ usr /地方/月ac_cv_file__dev_zero =没有ac_cv_func_setpgrp_void =没有apr_cv_tcp_nodelay_with_cork =没有ac_cv_sizeof_struct_iovec = 1 ac_cv_struct_rlimit =是的build_cc = gcc的安装

以下是我在x86服务器上运行apr-util-1.5.3组件的配置脚本时使用的参数和环境变量。

 

#配置脚本apr-util-1.5.3 x86 build_cc = = GCC GCC cc_for_build CC = powerpc64 Linux GCC CPP = powerpc64 Linux CPP作为= powerpc64 Linux作为AR = powerpc64 Linux AR ranlib = powerpc64 Linux GCC ranlib CXX = powerpc64-linux-c + LD = powerpc64 Linux LD带= powerpc64 Linux带

出口CC CPP作为ascpp AR ranlib cxxcpp CXX LD条目的cc_for_build LDFLAGS建立

。/配置-前缀= /tmp /usr/local/ APR主机= powerpc64 Linux与APR = /tmp /usr/local/ APR ac_cv_file__dev_zero =没有ac_cv_func_setpgrp_void =没有apr_cv_tcp_nodelay_with_cork =没有ac_cv_sizeof_struct_iovec = 1

以下是我在功率服务器上运行apr-util-1.5.3组件的配置脚本时使用的参数和环境变量。

 

#配置脚本apr-util-1.5.3电力build_cc = = GCC GCC cc_for_build CC = powerpc64 Linux GCC CPP = = powerpc64 CPP作为Linux作为AR = powerpc64 Linux AR ranlib = powerpc64 Linux GCC ranlib CXX = powerpc64-linux-c + LD = LD带= powerpc64 Linux带

出口CC CPP作为ascpp AR ranlib cxxcpp CXX LD条目的cc_for_build LDFLAGS建立

。/配置-前缀= /家/ usr /地方/ APR主机= powerpc64 Linux与APR = /tmp /usr/local/ APR ac_cv_file__dev_zero =没有ac_cv_func_setpgrp_void =没有apr_cv_tcp_nodelay_with_cork =没有ac_cv_sizeof_struct_iovec = 1

以下是我在x86服务器上运行httpd组件的配置脚本时使用的参数和环境变量。

 

#配置脚本httpd 2.4.3 x86 cc_for_build = GCC CC = powerpc64 Linux GCC CPP = powerpc64 Linux CPP作为= powerpc64 Linux作为AR = powerpc64 Linux AR ranlib = powerpc64 Linux GCC ranlib CXX = powerpc64-linux-c + LD = powerpc64 Linux LD带= powerpc64 Linux带

出口CC CPP作为ascpp AR ranlib cxxcpp CXX LD条目的cc_for_build LDFLAGS建立

。/配置-前缀= /tmp /usr/local主机= ppc64 ap_cv_void_ptr_lt_long =没有与PCRE = /tmp /usr/local/bin / PCRE配置--月= /tmp /usr/local/ APR——MPM =工人月利用= /tmp /usr/local APR /斌/ apu-1-config

以下是我在功率服务器上运行httpd组件的配置脚本时使用的参数和环境变量。

 

#配置脚本httpd 2.4.3电力cc_for_build = GCC CC = powerpc64 Linux GCC CPP = = powerpc64 CPP作为Linux # ascpp = PowerPC Linux GNU APM AR = powerpc64 Linux AR ranlib = powerpc64 Linux GCC ranlib # cxxcpp = PowerPC Linux GNU CPP APM CXX = powerpc64-linux-c + LD = /选择/ at7.0-5-rc1/bin/ld条= powerpc64 Linux条# CFLAGS =”比例= 440fp - mtune = 440fp --sysroot sysroot美元“# LDFLAGS建立= L sysroot美元/ lib

出口CC CPP作为ascpp AR ranlib cxxcpp CXX LD条目的cc_for_build LDFLAGS建立

。/配置-前缀= /家/ usr /本地主机= ppc64 ap_cv_void_ptr_lt_long =没有与PCRE = /家/usr/local/bin / PCRE配置--月= /家/ usr /局部/月——MPM =工人月利用= /家/ usr /地方/ APR /斌/ apu-1-config

交叉编译PostgreSQL 9.4.3

不同于之前构建httpd所需的源代码发行版,我在交叉编译PostgreSQL PostgreSQL是使用以下配置脚本来构建的时未遇到问题。

以下是我在x86服务器上运行PostgreSQL的的配置脚本时使用的参数和环境变量。

 

#配置x86 CC = powerpc64 Linux GCC CPP = powerpc64 CPP postgresql-9.3.4 Linux脚本= powerpc64 Linux作为AR = powerpc64 Linux AR ranlib = powerpc64 Linux GCC ranlib CXX = powerpc64-linux-c + D = powerpc64 Linux LD带= powerpc64 Linux带

出口CC CPP作为ascpp AR ranlib cxxcpp CXX LD条目的cc_for_build LDFLAGS建立

。/配置-前缀= /tmp /usr/local主机= powerpc64 Linux没有readline --没有成功

与Apache配置脚本一样,您可以注意到针对功率服务器工具使用了具有类似命名的可执行程序,比如从原生CPPBinutils包安装的CPPLD。修改脚本中的CPP和LD变量,如下所示。确保工具链的路径首先传入您的路径环境中。

以下是我在功率服务器上运行PostgreSQL的的配置脚本时使用的参数和环境变量。

 

#配置脚本postgresql-9.3.4电力CC = powerpc64 Linux GCC CPP = = powerpc64 CPP作为Linux作为AR = powerpc64 Linux AR ranlib = powerpc64 Linux GCC ranlib CXX = powerpc64-linux-c + LD = powerpc64 Linux LD带= powerpc64 Linux带

出口CC CPP作为ascpp AR ranlib cxxcpp CXX LD条目的cc_for_build LDFLAGS建立

。/配置-前缀= /家/ usr /本地主机= powerpc64 Linux没有readline --没有成功

结束语

工具交叉编译器的实际价值在于,开发人员可在他们熟悉的开发平台上(在大多数情况下是x86)编译和构建电源架构应用程序。从我们的用例中可以看到,工具可生成像原生编译的应用程序一样高效地执行的二进制可执行程序和库。而且,交叉编译的库与原生编译的应用程序兼容。最后但同样重要的是,交叉编译的应用程序可在本地调试以及使用GDB调试器远程调试。

与在x86的Linux工具链平台上使用原生PowerLinux工具没什么不同希望本文能让读者很好地了解的特性和功能PowerLinux工具链。