Results 1 to 7 of 7
a mechine with Xeon64 cpu, kernel is 2.4.29. i want to compile 32bit programs. i try with gcc option -m32. but it fails when link. althought in makefile i design ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 04-21-2005 #1Just Joined!
- Join Date
- Mar 2005
- Posts
- 5
helpme.how to compile 32bit programs in 64bit environment
a mechine with Xeon64 cpu, kernel is 2.4.29. i want to compile 32bit programs. i try with gcc option -m32. but it fails when link. althought in makefile i design the lib to be /lib and /usr/lib.
please give me some hint, thanks
- 04-21-2005 #2Just Joined!
- Join Date
- Feb 2005
- Location
- Delft, Holland
- Posts
- 95
What is the error message the linker gives?
- 04-22-2005 #3Just Joined!
- Join Date
- Mar 2005
- Posts
- 5
when make, the warning message is:
/usr/bin/ld: warning: i386 architecture of input file `lv_create_node.po' is incompatible with i386
86-64
output
error message is:
/LVM/tools/e2fsadm.c:380: undefined reference to `__moddi3'
e2fsadm.o(.text+0xb54):/LVM/tools/e2fsadm.c:391: undefined reference to `__moddi3'
e2fsadm.o(.text+0xebb):/LVM/tools/e2fsadm.c:514: undefined reference to `__divdi3'
e2fsadm.o(.text+0x1393):/LVM/tools/e2fsadm.c:442: undefined reference to `__divdi3'
collect2: ld returned 1 exit status
- 04-22-2005 #4Just Joined!
- Join Date
- Feb 2005
- Location
- Delft, Holland
- Posts
- 95
Do you have 32-bit libraries on your machine?
And did you tell the compiler that it should look for the libraries where you have placed them?
- 04-23-2005 #5Just Joined!
- Join Date
- Mar 2005
- Posts
- 5
when i install linux, i choose to support ia32 emulation in kernel. and i found /lib and /usr/lib directories which said to be 32bit libs. In makefile, i think it designates the compiler to use 32bit lib.
the segment of makefile is:
prefix = /usr
exec_prefix =
bindir = ${exec_prefix}/bin
staticlibdir = ${prefix}/lib
libdir = ${exec_prefix}/lib
sbindir = ${exec_prefix}/sbin
infodir = ${prefix}/info
mandir = ${prefix}/man
topobjdir = /LVM
# setup misc variables
# define the ownership variables for the binaries and man pages
OWNER=root
GROUP=root
# The number of jobs to run, if blank, defaults to the make standard
ifndef MAKEFLAGS
MAKEFLAGS =
endif
.SUFFIXES =
.SUFFIXES = .o.po.c
%.a: %.o
$(AR) -r $@ $<
%.o: %.c
$(CC) -c -pipe $(CFLAGS) -o $@ $<
%.po: %.c
$(CC) -c -pipe $(CFLAGS) -fPIC -o $@ $<
%: %.o $(LIBS)
$(CC) $(LDFLAGS) $< $(LOADLIBES) $(LDLIBS) -o $@
- 04-24-2005 #6
I think a 32-bit chroot enviroment is what you should use for compiling 32-bit apps, not sure how to do it on Xenon64's but, for AMD64s there's ahow to in the Tech. notes in gentoo.
Regards Scienitca (registered user #335819 - http://counter.li.org )
--
A master is nothing more than a student who knows something of which he can teach to other students.
- 04-25-2005 #7Just Joined!
- Join Date
- Mar 2005
- Posts
- 5
my distro is fedora core 3, how to use the chroot environment i know nothing about that. no other choice?


Reply With Quote
