简体   繁体   English

在64位计算机上编译tcpsplice

[英]Compiling tcpsplice on a 64-bit machine

I am trying to compile a small utility called tcpslice . 我正在尝试编译一个名为tcpslice的小实用程序。 It's the typical GNU C application. 这是典型的GNU C应用程序。 When I run ./configure , here is the output: 当我运行./configure ,输出如下:

checking build system type... Invalid configuration `x86_64-pc-linux-gnuoldld': machine `x86_64-pc' not recognized
configure: error: /bin/sh ./config.sub x86_64-pc-linux-gnuoldld failed

It appears to not support compilation as a 64-bit Linux application. 它似乎不支持作为64位Linux应用程序进行编译。 So I have a few questions: 所以我有几个问题:

  1. Is it possible to set some flags to compile the application as 32-bit AND be able to run it on my 64-bit operating system? 是否可以设置一些标志以将应用程序编译为32位并能够在我的64位操作系统上运行?
  2. Is it possible to update the configure script to support 64-bit Linux? 是否可以更新配置脚本以支持64位Linux? If so, will I be making some serious code changes in the .c files as well? 如果是这样,我是否还会在.c文件中进行一些严重的代码更改?
  3. I noticed a 64-bit RHEL6 machine on my network has this utility installed and running with an identical version number (1.2a3). 我注意到我网络上的一台64位RHEL6计算机安装了此实用程序,并以相同的版本号(1.2a3)运行。 Could I somehow download the source that was used to build it? 我可以以某种方式下载用于构建它的源代码吗? I can get access the to RHN if necessary. 如有必要,我可以访问RHN。

Is it possible to set some flags to compile the application as 32-bit AND be able to run it on my 64-bit operating system? 是否可以设置一些标志以将应用程序编译为32位并能够在我的64位操作系统上运行?

Yes. 是。 -m32 is the option. -m32是选项。

Is it possible to update the configure script to support 64-bit Linux? 是否可以更新配置脚本以支持64位Linux? If so, will I be making some serious code changes in the .c files as well? 如果是这样,我是否还会在.c文件中进行一些严重的代码更改?

You will have to make some code changes to make a purely 32 bit application work on 64 bit. 您必须进行一些代码更改,才能使纯32位应用程序在64位上运行。 Here's a link that talks about porting code from 32 bit to 64 bit. 这里有一个链接 ,讨论有关从32位代码移植到64位。

I am sorry, I do not know the answer for your 3rd question. 抱歉,您的第三个问题不知道答案。

Hope the little information provided by me helps in some way. 希望我提供的少量信息能有所帮助。

You've misinterpreted what the configure script is telling you. 您误解了configure脚本告诉您的内容。 The solution has nothing to do with CPU bitness. 该解决方案与CPU位无关。

The error comes down to a too-old version of config.guess , which the package creator generated with libtoolize . 该错误归结为config.guess版本太旧,该版本由软件包创建者使用libtoolize生成。 To fix it, you will need to have libtool installed, then say: 要修复它,您将需要安装libtool ,然后说:

$ libtoolize --force

You'll find that configure now runs, because libtoolize overwrote the tarball version of config.guess with one appropriate to your system. 您会发现configure现在可以运行了,因为libtoolize用适合您系统的tar。覆盖了config.guess的tarball版本。

You may run into another problem, a "missing" bpf.h file. 您可能会遇到另一个问题,一个“丢失”的bpf.h文件。 Just edit tcpslice.c and change this line: 只需编辑tcpslice.c并更改此行:

#include <net/bpf.h>

to: 至:

#include <pcap-bpf.h>

With those two changes, I got tcpslice to build on my 64-bit CentOS 5 box. 经过这两个更改,我使tcpslice可以在我的64位CentOS 5机器上构建。

install following packages : 安装以下软件包:

 $apt-get install ia32-libs.

for rhel its different : 对于rhel不同:

look at the answer to this question : 看看这个问题的答案:

CentOS 64 bit bad ELF interpreter CentOS 64位错误的ELF解释器

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM