LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 09-07-2010, 02:47 AM   #1
naveenese
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.
Ex:
====
#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
Naveen
 
Old 09-07-2010, 08:05 PM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 122Reputation: 122
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, 04:47 AM   #3
naveenese
LQ Newbie
 
Registered: Aug 2010
Location: Inida,chennai
Posts: 7

Original Poster
Rep: Reputation: 0
Smile

Matir,

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

Thanks
Naveen
 
Old 09-08-2010, 06:54 AM   #4
rpurdie
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, 01:22 PM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154
A random executable, 'powerpc' (Debian) :
http://ftp.de.debian.org/debian/pool...b1_powerpc.deb

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


Reply


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 06:03 PM
My c compiler doesn't work after the cross-compiler installed heracles.cn Linux - Newbie 1 06-05-2007 04:55 AM
problem with the cross compiled executable??? raklo Linux - Kernel 0 04-03-2007 08:16 AM
glib Error: while building Cross-Compiler for PPC Dhana_pal Linux From Scratch 2 12-28-2006 01:57 AM


All times are GMT -5. The time now is 04:49 PM.

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