Results 1 to 6 of 6

Thread: Cross compiling to 64-bit on 32-bit host

  1. #1
    Join Date
    Jul 2007
    Beans
    6

    Talking Cross compiling to 64-bit on 32-bit host

    Hi,

    I have 2 Ubuntu machines at home - one with the 32-bit edition of Feisty and one with the 64-bit edition of Feisty.

    I was wondering if it is possible to cross-compile 64-bit programs for the 64-bit Feisty on the 32-bit Feisty (I know that 32-bit binaries would work on the 64-bit with IA32 libs but wondering if 64-bit binaries can be produced on the 32-bit machine).

    Regards,
    Sparkymat

  2. #2
    Join Date
    Jul 2007
    Beans
    6

    Re: Cross compiling to 64-bit on 32-bit host

    I managed to find out the answer by snooping around in synaptic. . Installing 'lib64gcc1','libc6-amd64' and 'libc6-dev-amd64' lets me compile programs for 64-bit. I just need to add a '-m64' option to gcc to generate 64-bit binaries.

    Now only need to figure out how to get the commonly used 64-bit libraries installed.

  3. #3
    Join Date
    Jul 2007
    Beans
    6

    Re: Cross compiling to 64-bit on 32-bit host

    Sorry for the hasty post. Installing these screwed up my 32-bit gcc. I need to keep both in parallel. Still trying to figure it out. Will update as soon as i find something.

  4. #4
    Join Date
    Mar 2006
    Location
    Ireland
    Beans
    42
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: Cross compiling to 64-bit on 32-bit host

    I dont know if you still have this problem or if you figured it out, but I managed to solve it by installing the gcc-4.x-multilib and g++-4.x-multilib packages from the repository. Then you can compile for 64 bit using the -m64 -fPIC flags

  5. #5
    Join Date
    Apr 2007
    Beans
    22
    Distro
    Ubuntu 7.04 Feisty Fawn

    Re: Cross compiling to 64-bit on 32-bit host

    and how can I set the target CPU with configure?

  6. #6
    Join Date
    Aug 2007
    Location
    Manchester, UK
    Beans
    10,285
    Distro
    Ubuntu

    Re: Cross compiling to 64-bit on 32-bit host

    Check the date of the post above your's

    And I don't know if you can do for ./configure because originally the posters were talking about gcc - the GNU C Compiler

Bookmarks

Posting Permissions

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