Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Cross-compiling and linking 32-bit applications

Reply
Thread Tools

Cross-compiling and linking 32-bit applications

 
 
Randy Yates
Guest
Posts: n/a
 
      05-28-2007
Hi Folks,

I have a cross-development problem in which I'm using the x86_64 version
of Fedora Core 6 as a development system but want to build executables that
are 32-bit. I've got a mix of C (mainly C) and about 2 or 3 assembly routines.
I'm using yasm as my assembler and gcc 4.1.2 for my C compiler, and
GNU ld version 2.17.50.0.6-2.fc6 20061020 as my linker.

I thought that if I just specified a 32-bit target for the C compiler via
"-m32", the 32-bit elf output for the assembler via "-f elf32", and 32-bit
output from the linker via "--oformat elf32-i386" that this would do the
trick. But I'm getting

/usr/lib/../lib64/libm.so: could not read symbols: File in wrong format
collect2: ld returned 1 exit status

Any ideas? I'm not even sure this is the right thing to do, or even if
it's possible. Could someone please enlighten me, or at least give me
some pointers?
--
% Randy Yates % "I met someone who looks alot like you,
%% Fuquay-Varina, NC % she does the things you do,
%%% 919-577-9882 % but she is an IBM."
%%%% <(E-Mail Removed)> % 'Yours Truly, 2095', *Time*, ELO
http://home.earthlink.net/~yatescr
 
Reply With Quote
 
 
 
 
Randy Yates
Guest
Posts: n/a
 
      05-28-2007
Randy Yates <(E-Mail Removed)> writes:

> /usr/lib/../lib64/libm.so: could not read symbols: File in wrong format
> collect2: ld returned 1 exit status


PS: If I add the option to tell the linker to look in /usr/lib, I get
this:

gcc /tmp/home/btscdecoder/dev/lib/src/deemphasis/sim/nativelinux/simdeemphasis.o /home/btscdecoder/dev/lib/lib/cloption.a /home/btscdecoder/dev/lib/lib/deemphasis.a /home/btscdecoder/dev/lib/lib/buffer.a /home/btscdecoder/dev/lib/lib/wavefile.a /home/btscdecoder/dev/lib/lib/fir.a -Xlinker --oformat -Xlinker elf32-i386 -L/usr/lib -o /home/btscdecoder/dev/lib/src/deemphasis/sim/simdeemphasis -lm
/usr/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/bin/ld: skipping incompatible /usr/lib/libm.a when searching for -lm
/usr/lib/../lib64/libm.so: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
--
% Randy Yates % "She's sweet on Wagner-I think she'd die for Beethoven.
%% Fuquay-Varina, NC % She love the way Puccini lays down a tune, and
%%% 919-577-9882 % Verdi's always creepin' from her room."
%%%% <(E-Mail Removed)> % "Rockaria", *A New World Record*, ELO
http://home.earthlink.net/~yatescr
 
Reply With Quote
 
 
 
 
Walter Roberson
Guest
Posts: n/a
 
      05-28-2007
In article <(E-Mail Removed)>, Randy Yates <(E-Mail Removed)> wrote:
>I have a cross-development problem in which I'm using the x86_64 version
>of Fedora Core 6 as a development system but want to build executables that
>are 32-bit. I've got a mix of C (mainly C) and about 2 or 3 assembly routines.
>I'm using yasm as my assembler and gcc 4.1.2 for my C compiler, and
>GNU ld version 2.17.50.0.6-2.fc6 20061020 as my linker.


You should ask in a gcc newsgroup or mailing list, as comp.lang.c
avoids the specifics of implementations.
--
All is vanity. -- Ecclesiastes
 
Reply With Quote
 
Kenny McCormack
Guest
Posts: n/a
 
      05-29-2007
In article <f3ffd8$9p1$(E-Mail Removed)>,
Walter Roberson <(E-Mail Removed)-cnrc.gc.ca> wrote:
>In article <(E-Mail Removed)>, Randy Yates <(E-Mail Removed)> wrote:
>>I have a cross-development problem in which I'm using the x86_64
>>version of Fedora Core 6 as a development system but want to build
>>executables that are 32-bit. I've got a mix of C (mainly C) and about
>>2 or 3 assembly routines. I'm using yasm as my assembler and gcc
>>4.1.2 for my C compiler, and GNU ld version 2.17.50.0.6-2.fc6 20061020
>>as my linker.

>
>You should ask in a gcc newsgroup or mailing list, as comp.lang.c
>avoids the specifics of implementations.


IOW:

Off topic. Not portable. Cant discuss it here. Blah, blah, blah.

> All is vanity. -- Ecclesiastes


ITYM, all is BS (in this ng).

Useful clc-related links:

http://en.wikipedia.org/wiki/Aspergers
http://en.wikipedia.org/wiki/Clique
http://en.wikipedia.org/wiki/C_programming_language

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
James Gosling the Creator of EMACS and JAVA - leaves ORACLE - Butthen reports started coming in of odd failures. Systems would crashstrangely. We'd get crashes in applications. All applications. Crashes in thekernel. small Pox C Programming 2 07-22-2010 10:07 PM
Ajax Applications (75 links) : Sites/applications featuring/using Ajax. www.web20developers.com HTML 0 10-06-2006 03:28 AM
Difference between Python CGI applications and Php applications praba kar Python 2 05-04-2005 06:49 PM
Mystery of Java applications blocking Windows XP applications Wolfgang Java 5 02-19-2004 02:45 PM
web applications versus. web portal applications John Davis ASP .Net 0 08-21-2003 12:11 AM



Advertisments