LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   64bit binary to be built on 32-bit Linux4 using g++/GCC (https://www.linuxquestions.org/questions/linux-newbie-8/64bit-binary-to-be-built-on-32-bit-linux4-using-g-gcc-777392/)

sachinkusale 12-22-2009 02:16 AM

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.

ozanbaba 12-22-2009 06:33 AM

Quote:

Originally Posted by sachinkusale (Post 3800946)
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)

sachinkusale 12-23-2009 12:35 AM

How to compile GCC itself? what all are the components to do so .?

btmiller 12-23-2009 02:08 AM

Generally you would use the compiler already installed on your system to compile a cross-compiler.

ozanbaba 12-23-2009 02:28 AM

Quote:

Originally Posted by sachinkusale (Post 3802032)
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.


All times are GMT -5. The time now is 06:01 AM.