Compiling tcpsplice on a 64-bit machine

一个人想着一个人 提交于 2019-12-13 03:37:47

问题


I am trying to compile a small utility called tcpslice. It's the typical GNU C application. When I run ./configure, here is the output:

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. 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?
  2. Is it possible to update the configure script to support 64-bit Linux? If so, will I be making some serious code changes in the .c files as well?
  3. I noticed a 64-bit RHEL6 machine on my network has this utility installed and running with an identical version number (1.2a3). Could I somehow download the source that was used to build it? I can get access the to RHN if necessary.

回答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?

Yes. -m32 is the option.

Is it possible to update the configure script to support 64-bit Linux? If so, will I be making some serious code changes in the .c files as well?

You will have to make some code changes to make a purely 32 bit application work on 64 bit. Here's a link that talks about porting code from 32 bit to 64 bit.

I am sorry, I do not know the answer for your 3rd question.

Hope the little information provided by me helps in some way.




回答2:


You've misinterpreted what the configure script is telling you. The solution has nothing to do with CPU bitness.

The error comes down to a too-old version of config.guess, which the package creator generated with libtoolize. To fix it, you will need to have libtool installed, then say:

$ libtoolize --force

You'll find that configure now runs, because libtoolize overwrote the tarball version of config.guess with one appropriate to your system.

You may run into another problem, a "missing" bpf.h file. Just edit tcpslice.c and change this line:

#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.




回答3:


install following packages :

 $apt-get install ia32-libs.

for rhel its different :

look at the answer to this question :

CentOS 64 bit bad ELF interpreter



来源:https://stackoverflow.com/questions/10899616/compiling-tcpsplice-on-a-64-bit-machine

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!