Find the answer to your Linux question:
Results 1 to 7 of 7
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1 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

  2. #2
    Just Joined!
    Join Date
    Feb 2005
    Delft, Holland
    What is the error message the linker gives?

  3. #3
    when make, the warning message is:
    /usr/bin/ld: warning: i386 architecture of input file `lv_create_node.po' is incompatible with i38686-64

    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

  4. $spacer_open
  5. #4
    Just Joined!
    Join Date
    Feb 2005
    Delft, Holland
    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?

  6. #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

    # The number of jobs to run, if blank, defaults to the make standard
    ifndef MAKEFLAGS

    .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 $@

  7. #6
    Linux Enthusiast scientica's Avatar
    Join Date
    Sep 2003
    South- or "Mid-" Sweden
    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 - )
    A master is nothing more than a student who knows something of which he can teach to other students.

  8. #7
    my distro is fedora core 3, how to use the chroot environment i know nothing about that. no other choice?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts