473,386 Members | 1,830 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Cross-compiling and linking 32-bit applications

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."
%%%% <ya***@ieee.org % 'Yours Truly, 2095', *Time*, ELO
http://home.earthlink.net/~yatescr
May 28 '07 #1
3 2042
Randy Yates <ya***@ieee.orgwrites:
/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."
%%%% <ya***@ieee.org % "Rockaria", *A New World Record*, ELO
http://home.earthlink.net/~yatescr
May 28 '07 #2
In article <m3************@ieee.org>, Randy Yates <ya***@ieee.orgwrote:
>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
May 28 '07 #3
In article <f3**********@canopus.cc.umanitoba.ca>,
Walter Roberson <ro******@ibd.nrc-cnrc.gc.cawrote:
>In article <m3************@ieee.org>, Randy Yates <ya***@ieee.orgwrote:
>>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

May 29 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: * ProteanThread * | last post by:
but depends upon the clique: ...
4
by: David Peach | last post by:
Hello, hope somebody here can help me... I have a query that lists defects recorded in a user defined date range. That query is then used as the source for a Cross Tab query that cross-tabs count...
23
by: Jeff Rodriguez | last post by:
Here's what I want do: Have a main daemon which starts up several threads in a Boss-Queue structure. From those threads, I want them all to sit and watch a queue. Once an entry goes into the...
7
by: Scott M. | last post by:
How can I disable the cross-site scripting check for one particular page of a site?
8
by: Pieter | last post by:
Hi, I'm having some weird problem using the BackGroundWorker in an Outlook (2003) Add-In, with VB.NET 2005: I'm using the BackGroundWorker to get the info of some mailitems, and after each item...
3
by: jlamanna | last post by:
I was wondering if there was a utility that could tell you when your C# application is making cross-apartment COM calls. I have a fairly large application that makes extensive use of a 3rd party...
1
by: Rob Woodworth | last post by:
Hi, I'm having serious problems getting my report to work. I need to generate a timesheet report which will contain info for one employee between certain dates (one week's worth of dates). I...
3
by: aspmonger | last post by:
Hello, I really believe that IE 6 has a new (intentional?) bug that severely limits the capability of dhtml and cross domain scripting. Yesterday, I read an interesting article about the subject and...
6
by: Simon | last post by:
Hi All, An experiment i'm doing requires requires a synchronous cross-domain request, without using a proxy. I wondered if anyone had any ideas to help me achieve this. Below is what I have...
6
by: Bart Van der Donck | last post by:
Hello, I'm presenting my new library 'AJAX Cross Domain' - a javascript extension that allows to perform cross-domain AJAX requests. http://www.ajax-cross-domain.com/ Any comments or...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.