LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-09-2006, 06:33 AM   #1
gobi_dgm
Member
 
Registered: Feb 2005
Location: Bangalore
Distribution: FC3
Posts: 137

Rep: Reputation: 15
gcc options


hi,

i tried to compile my c program with the option -m64 and got a warning as shown below..
> gcc -m64 file.c
cc1: sorry, not implemented: 64-bit mode not compiled in

i understood that 64-bit mode has to implemented while compiling the gcc source code.

Should i rebuild Gcc? if so which is the option to enable 64-bit mode..

Im using i686 athlon i386 GNU/Linux.. i hope kernel supports 64-bit mode.

thanks in advance
gobi
 
Old 06-09-2006, 11:10 PM   #2
soulxcavtor
Member
 
Registered: May 2006
Location: USA.FLorida
Distribution: Mandriva 2006 PowerPack
Posts: 238

Rep: Reputation: 30
Good question. I'd

--> First, check the version of gcc. If it is less than 3.2 I guess even if you recompile it doesn't support 64-bit operations. If its newer than 3.2 than you might be lucky that it would already be compiled with that support.

--> An easy and quick test to check if your compiler supports 64 bit operations is to write a trivial C program. I've tested on my old laptop to find out that my gcc doesn't support 64 bit operations.

OK this is what I've done.

Wrote a test C program called test.c

void main()
{
printf("Hello\n");
}

And compiled it normally,

# gcc -o test32 test.c

It created a binary called test. To see if its a 32 bit binary, I used 'file'.
# file test32
test32: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.0, dynamically linked (uses shared libs), not stripped

Great, it is a 32-bit binary that can be executed on any i386 machine with Linux 2.2 or greater.

Then comes the big test, tried compiling as a 64-bit binary
#gcc -o test64 test.c -m64
cc1: sorry, not implemented: 64-bit mode not compiled in

If you don't get this error then you are probably fine. You can verify it using the 'file' command.
 
Old 06-10-2006, 03:50 AM   #3
gobi_dgm
Member
 
Registered: Feb 2005
Location: Bangalore
Distribution: FC3
Posts: 137

Original Poster
Rep: Reputation: 15
hi,
im using gcc 3.4.2

> gcc -v
Reading specs from /usr/lib/gcc/i386-redhat-linux/3.4.2/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-java-awt=gtk --host=i386-redhat-linux
Thread model: posix
gcc version 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)

when i do

> gcc -o check x.c
> file check

check: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), not stripped

> gcc -o check x.c -m64
x.c:1: sorry, unimplemented: 64-bit mode not compiled in

should i post anyother output?
 
Old 06-10-2006, 04:14 AM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
Errrrh... is your FC 64 bit in the first bit, or did you install
a cross-compiler?


Cheers,
Tink
 
Old 06-10-2006, 04:29 AM   #5
gobi_dgm
Member
 
Registered: Feb 2005
Location: Bangalore
Distribution: FC3
Posts: 137

Original Poster
Rep: Reputation: 15
can you please tell me how to check whether FC3 is 64 bit ?
 
Old 06-12-2006, 04:33 AM   #6
gobi_dgm
Member
 
Registered: Feb 2005
Location: Bangalore
Distribution: FC3
Posts: 137

Original Poster
Rep: Reputation: 15
hi,
i just checked my FC3 version.. its 32-bit version of FC3..

> vi /proc/version

Linux version 2.4.20-8smp (bhcompile@stripples.devel.redhat.com) (gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)) #1 SMP Thu Mar 13 16:43:01 EST 2003

Im not using any cross compilers?

is it possible to generate 64-bit binary in 32-bit FC3 which runs on amd x86_64 machine?
 
Old 06-16-2006, 04:16 AM   #7
gobi_dgm
Member
 
Registered: Feb 2005
Location: Bangalore
Distribution: FC3
Posts: 137

Original Poster
Rep: Reputation: 15
i reinstalled FC for 64-bit version and it works now..
Thanks for all ur support..
 
Old 06-16-2006, 04:54 PM   #8
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
Using the right things works wonders, doesn't it ;}


Cheers,
Tink
 
  


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
X11 - GCC compiling options nawin_g Programming 2 04-23-2006 12:01 PM
best options for gcc under athlon64 exodist Linux - Hardware 2 12-17-2004 03:21 PM
GCC compiler options???!! Umanga Linux - Newbie 1 10-08-2004 03:16 AM
Kernel 2.6.2 options question - LOCKED options ? tvojvodi Linux - General 0 02-17-2004 04:23 AM
Shell script problems, passing options to gcc usernamed Programming 2 09-10-2003 06:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:03 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