Article View: alt.os.linux.ubuntu
Article #126Re: Cannot cross compile ONE LINE PROGRAM, 64 to 32 bit
From: Robert Heller
Date: Fri, 31 Oct 2008 15:18
Date: Fri, 31 Oct 2008 15:18
46 lines
3503 bytes
3503 bytes
At Thu, 30 Oct 2008 12:41:47 -0500 Ignoramus11000 <ignoramus11000@NOSPAM.11000.invalid> wrote:
>
> Here's a program that I am trying to cross compile (obviously I am
> working on a larger program, but this is a very simple illustration):
>
> int main( int args, char **argv ) { return 0; }
>
> Here's how I do it:
>
> gcc -o exe -m32 q.c
>
> Here's what I get:
>
> ~/tmp==>gcc -o exe -m32 q.c
> /usr/bin/ld: skipping incompatible /lib/libc.so.6 when searching for /lib/libc.so.6
> /usr/bin/ld: cannot find /lib/libc.so.6
> collect2: ld returned 1 exit status
>
> This is a Ubuntu Hardy machine, 64 bit, trying to cross compile for 32
> bit. I installed a bunch of 32 bit libraries, but it does not
> help. (ia32-libs gcc-4.2-multilib)
You really can't use the 64-bit targeted compiler to compile for 32-bit.
You need to create the 32-bit targeted compiler as a cross-compiler. And
no, you really, really DON'T want to install the compiler from a 32-bit
distro on your 64-bit install.
The "ia32-libs gcc-4.2-multilib" is likely just the run-time to let you
run 32-bit apps on your 64-bit machine. And no, you really, really
DON'T want to install the 32-bit dev packages on your 64-bit system either.
It might just be easier to install vmware server and install a 32-bit
Ubuntu Hardy in a virtual machine. I've built cross-gcc compilers --
it is a bear -- not hard really, just a bear -- many tedious bits and
pieces -- of course this was a mess-windows targeted build tool set,
which only adds more 'fun' to the process.
>
--
Robert Heller -- Get the Deepwoods Software FireFox Toolbar!
Deepwoods Software -- Linux Installation and Administration
http://www.deepsoft.com/ -- Web Hosting, with CGI and Database
heller@deepsoft.com -- Contract Programming: C/C++, Tcl/Tk
Technical Details
Message-ID:
<142dnbonm8p-vJbUnZ2dnUVZ_qPinZ2d@posted.localnet>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local02.nntp.dca.giganews.com!nntp.posted.localnet!news.posted.localnet.POSTED!not-for-mailReferences:
<FP2dnfTT6Z5GbJTUnZ2dnUVZ_oPinZ2d@giganews.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11318c,79eb8258de53cf24 X-Google-Thread: 1103af,79eb8258de53cf24 X-Google-Attributes: gid11318c,gid1103af,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local02.nntp.dca.giganews.com!nntp.posted.localnet!news.posted.localnet.POSTED!not-for-mail NNTP-Posting-Date: Fri, 31 Oct 2008 10:18:58 -0500 From: Robert Heller <heller@deepsoft.com> Organization: Deepwoods Software X-Newsreader: TkNews 2.0 Subject: Re: Cannot cross compile ONE LINE PROGRAM, 64 to 32 bit In-Reply-To: <FP2dnfTT6Z5GbJTUnZ2dnUVZ_oPinZ2d@giganews.com> References: <FP2dnfTT6Z5GbJTUnZ2dnUVZ_oPinZ2d@giganews.com> Newsgroups: alt.os.linux.ubuntu,gnu.gcc.help,comp.os.linux.development,comp.os.linux.misc Originator: heller@mail.deepsoft.com Message-ID: <142dnbonm8p-vJbUnZ2dnUVZ_qPinZ2d@posted.localnet> Date: Fri, 31 Oct 2008 10:18:59 -0500 Lines: 46 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 64.74.153.161 X-Trace: sv3-mvQ5y37o8GeLqdly0NuFTZsFjXHSOhzqc9dRag6aE5EryN4grXo/8ytRP19hIExoGKb5sqqibTMmgvs!WvwPPswNa//jd+UTccTv/f3/dcrQtcPoSVACacto/foLHrfLyEkxmfvCHcVCHCxuyDD5Ekpfjgqt!xevmoaQf9Ke6y54b4OANOEce3HgxZZqYFg== X-Complaints-To: abuse@localnet.com X-DMCA-Complaints-To: abuse@localnet.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.39