Find the answer to your Linux question:
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.
  1. #1
    Just 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

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

  3. #3
    Just 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 i38686-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

  4. $spacer_open
    $spacer_close
  5. #4
    Just 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?

  6. #5
    Just 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 $@

  7. #6
    Linux Enthusiast scientica's Avatar
    Join Date
    Sep 2003
    Location
    South- or "Mid-" Sweden
    Posts
    742
    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.

  8. #7
    Just 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?

Posting Permissions

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