LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 12-22-2009, 02:16 AM   #1
sachinkusale
LQ Newbie
 
Registered: Dec 2009
Posts: 2

Rep: Reputation: 0
64bit binary to be built on 32-bit Linux4 using g++/GCC


Hi,
I tried to build the 64 bit binary using g++ (3.4.6-8).
#g++ -m64 my.cpp
my.cpp:1: sorry, unimplemented: 64-bit mode not compiled in

Above there, is error thrown for the 64-bit compilation.
Do i need to install packages glibc-devel(ppc64) and libstdc++-devel(ppc64).
If yes then, pls. help me with the location where i can get these packages, for download.
 
Old 12-22-2009, 06:33 AM   #2
ozanbaba
Member
 
Registered: May 2003
Location: İzmir
Distribution: Slackware64 15.0 Multilib
Posts: 778

Rep: Reputation: 135Reputation: 135
Quote:
Originally Posted by sachinkusale View Post
Hi,
I tried to build the 64 bit binary using g++ (3.4.6-8).
#g++ -m64 my.cpp
my.cpp:1: sorry, unimplemented: 64-bit mode not compiled in

Above there, is error thrown for the 64-bit compilation.
Do i need to install packages glibc-devel(ppc64) and libstdc++-devel(ppc64).
If yes then, pls. help me with the location where i can get these packages, for download.
check the pakage information if there are there for cross compiling. if not, you have to compile your own gcc. (don't worry it's not hard just takes too long)
 
Old 12-23-2009, 12:35 AM   #3
sachinkusale
LQ Newbie
 
Registered: Dec 2009
Posts: 2

Original Poster
Rep: Reputation: 0
How to compile GCC itself? what all are the components to do so .?
 
Old 12-23-2009, 02:08 AM   #4
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
Generally you would use the compiler already installed on your system to compile a cross-compiler.
 
1 members found this post helpful.
Old 12-23-2009, 02:28 AM   #5
ozanbaba
Member
 
Registered: May 2003
Location: İzmir
Distribution: Slackware64 15.0 Multilib
Posts: 778

Rep: Reputation: 135Reputation: 135
Quote:
Originally Posted by sachinkusale View Post
How to compile GCC itself? what all are the components to do so .?
i compiled gcc 4.4.2 once for wine64 test.

simply it uses native system gcc to compile and create new compiler.

folllow the gcc install documentation carefully over here.

secondly you do not have to install gcc system wide to use. for my wine64 test, i installed it on $HOME/gcc. you can configure it on configure script or later when you do make install as "make install DESTDIR=$HOME/gcc". then run configure scripts makes with CC=path/to/gcc CXX=path/to/g++

thirdly don't put languages you don't need (like java). compile is long.
 
  


Reply

Tags
g++, gcc



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
Compilation problem when downgrading from 64-bit gcc to 32-bit gcc huyhoang3673 Linux - Software 7 08-26-2009 11:31 AM
Inquiry:Incorrectly built binary hadimotamedi Linux - Software 1 08-22-2009 08:53 AM
running software built with gcc 3.0.2 on Redhat 8 - gcc 3.2 dst1989 Linux - Software 3 03-08-2004 10:23 PM
C, read 8 bit octal numbers, convert to 24 bit binary bamalabs Programming 3 01-20-2004 09:59 AM
Binary Built problem Maranello Linux - Newbie 2 12-03-2003 05:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:27 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
Open Source Consulting | Domain Registration