2

Could you please describe that how have you installed gcc-multilib and g++-multilib on 32bit debian machine to generate 64 bit code?

I installed gcc-4.7.2 on my 32bit debian system(and also installed binutils-2.23). When i try to compile a simple hello world program with -m64 flag as

# gcc -m64 hello.c

I am getting following error message:

"hello.c:1:0: sorry, unimplemented: 64-bit mode not compiled in" .

Please tell me the steps to generate the 64bit code on 32bit debian system.

1 Answers1

1

You need to re-install gcc with this option in the configure.

RSFalcon7
  • 2,241
  • 6
  • 34
  • 55
  • I installed gcc-4.7.2 with configure --enable-multilib and --enable-targets=i686-pc-linux-gnu,x86_64-pc-linux-gnu And before this configuration for gcc i installed binutils with --enable-targets=i686-pc-linux-gnu,x86_64-pc-linux-gnu. And every thing worked fine. I installed gcc-4.7.2 successfuly though also i am not able generate 64bit code using -m64 flag on my 32bit debian machine. – NIlesh Srivastava May 03 '13 at 04:20
  • # gcc -m64 hello.c I am getting following error message: "hello.c:1:0: sorry, unimplemented: 64-bit mode not compiled in" . – NIlesh Srivastava May 03 '13 at 04:59
  • @NIlesh can you update the question with the output of `gcc -v`? – RSFalcon7 May 04 '13 at 12:46
  • # gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/var/opt/crossgcc/bin/../libexec/gcc/i686-pc-linux-gnu/4.7.2/lto-wrapper Target: i686-pc-linux-gnu Configured with: ../gcc-4.7.2/configure --enable-multilib --enable-targets=i686-pc-linux-gnu,x86_64-pc-linux-gnu --prefix=/opt/crossgcc --with-gmp=/opt/crossgcc --with-mpfr=/opt/crossgcc --with-mpc=/opt/crossgcc --with-system-zlib Thread model: posix gcc version 4.7.2 (GCC) – NIlesh Srivastava May 06 '13 at 03:49
  • The system is i686(cmd :uname -a), 32 bit debian machine(no lm flags in "flags:" in /proc/cpuinfo) – NIlesh Srivastava May 06 '13 at 03:54