0

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.
Warren Young
  • 40,875
  • 8
  • 85
  • 101
User1
  • 39,458
  • 69
  • 187
  • 265
  • Install the packages called 'libc32' and/or 'gcc32' or something named like this. –  Jun 05 '12 at 14:57
  • can you not get the tcpslice program from the tcpdump rpm package available via centos rpm repo? Not sure what version of centos you are running but http://rpm.pbone.net/index.php3/stat/4/idpl/17839287/dir/centos_5/com/tcpdump-3.9.4-15.el5.x86_64.rpm.html is for centos 5 and the src rpm is available for you to compile with. – MichaelN Jun 05 '12 at 18:08
  • This should be moved to `unix.stackexchange.com` – Warren Young Jun 07 '12 at 12:12

3 Answers3

2

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.

Employed Russian
  • 199,314
  • 34
  • 295
  • 362
Jay
  • 24,173
  • 25
  • 93
  • 141
  • Thanks for the help. How can I tell the `./configure` script to use -m32? `./configure -m32` fails as an unrecognized option, it looks like a gcc flag. – User1 Jun 05 '12 at 15:19
  • 1
    `./configure CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32` But, as I say in my answer, I don't think this will actually solve your problem. – Warren Young Jun 08 '12 at 18:37
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.

Warren Young
  • 40,875
  • 8
  • 85
  • 101
0

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

Community
  • 1
  • 1
Aftnix
  • 4,461
  • 6
  • 26
  • 43
  • I'm running CentOS and I installed glibc.i686. The `./configure` still fails the same way. – User1 Jun 05 '12 at 15:20