Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-07-2010, 01:47 AM   #1
LQ Newbie
Registered: Aug 2010
Location: Inida,chennai
Posts: 7

Rep: Reputation: 0
Smile How to generate 64-bit executable(utility) using ppc cross compiler

Hi Everyone,

I need your help to generate 64-bit executable(utility) using PowerPC-linux cross compiler?

i.e any options need to pass ppc-gcc other then "-m64"

I have written a small test program on 64-bit server and generated 64-bit executable using gcc alone.
#file a.out
a.out: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped

Actually i want to generate a executable(using PowerPC-linux cross compiler),which will run on 64-bit machines.

In my Makefile I am trying to use CC = XXXXX/powerpc-linux/bin/powerpc-linux-gcc -m64 to ppc-linux-gcc,but giving error.

error: -m64 not supported in this configuration

If i remove -m64 its generating 32-bit executable.

Can any one help for me?

Thanks in advance

Warm Regards
Old 09-07-2010, 07:05 PM   #2
LQ Guru
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 123Reputation: 123
Try "-arch ppc64" to gcc. I'm not sure that will work, but that's the option used when building for OS X on PPC 64.
Old 09-08-2010, 03:47 AM   #3
LQ Newbie
Registered: Aug 2010
Location: Inida,chennai
Posts: 7

Original Poster
Rep: Reputation: 0


The "-arch ppc64" option to ppc-gcc compiler did not worked.

Old 09-08-2010, 05:54 AM   #4
LQ Newbie
Registered: Sep 2010
Posts: 1

Rep: Reputation: 0
There are a few things you need to ensure for this to work. You need to make sure you have 64 bit libraries installed to compile against. You also need to ensure your compiler is able to compile 64 bit binaries and it sounds like this one isn't able to. See if "powerpc-linux-gcc --help=target" shows it supporting the -m64 option.
Old 09-08-2010, 12:22 PM   #5
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,549

Rep: Reputation: 3241Reputation: 3241Reputation: 3241Reputation: 3241Reputation: 3241Reputation: 3241Reputation: 3241Reputation: 3241Reputation: 3241Reputation: 3241Reputation: 3241
A random executable, 'powerpc' (Debian) :

$ file amide
The reply is:
"amide: ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1
(SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, .."

Are you building for OSX or powerpc Linux ?
Is the OS, where you try to build, 64 Bits ?

A 32 Bits tool chain cannot build a 64 Bits file.
You will need a complete toolchain: binutils - libc - gcc, all 64 Bits.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
ldd on cross-compiled executable ranthal Linux - Software 2 10-19-2009 05:03 PM
My c compiler doesn't work after the cross-compiler installed Linux - Newbie 1 06-05-2007 03:55 AM
problem with the cross compiled executable??? raklo Linux - Kernel 0 04-03-2007 07:16 AM
glib Error: while building Cross-Compiler for PPC Dhana_pal Linux From Scratch 2 12-28-2006 12:57 AM

All times are GMT -5. The time now is 04:31 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration