Author Topic: ubuntu 8.04 x64, codeblocks x64, gdb x64 = program x32... not x64  (Read 6009 times)

Offline str0g

  • Multiple posting newcomer
  • *
  • Posts: 20
How can I change build to 64bit?
Ive checked my code with VS with 64 settings and my program was x64 (address over 10gb ram under vista :) )
but code builded with CB under ubuntu for ubuntu can addresss only 4095 so where to add something ;P

Offline odubtaig

  • Single posting newcomer
  • *
  • Posts: 9
Re: ubuntu 8.04 x64, codeblocks x64, gdb x64 = program x32... not x64
« Reply #1 on: September 29, 2008, 01:45:43 am »
Have you gone through Project >> Build Options? The options for target architecture are under Compiler Flags, I believe it's -march=athlon64 to support the widest target.

Offline str0g

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: ubuntu 8.04 x64, codeblocks x64, gdb x64 = program x32... not x64
« Reply #2 on: September 29, 2008, 01:54:12 pm »
I did what you told me, then rebuild project->compile and run = still no resaults addressing ends on 4095 ;(

Offline odubtaig

  • Single posting newcomer
  • *
  • Posts: 9
Re: ubuntu 8.04 x64, codeblocks x64, gdb x64 = program x32... not x64
« Reply #3 on: September 29, 2008, 03:33:48 pm »
Hmm, was hoping that'd add the other options as well. Go back to the compiler flags and select the Other options tab, add -m64 (no space or anything required around this) and see if that works. On the command line this sets int to 32, long to 64 and pointer to 64.

Really I'm not sure why -march=athlon64 shouldn't have done this automatically as such options are usually super options including what extensions a CPU does/doesn't have (-march=prescott includes -mmmx -msse -msse2 -msse3 for example).
« Last Edit: September 29, 2008, 03:46:17 pm by odubtaig »

Offline str0g

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: ubuntu 8.04 x64, codeblocks x64, gdb x64 = program x32... not x64
« Reply #4 on: September 29, 2008, 06:26:50 pm »
still same :/

Offline odubtaig

  • Single posting newcomer
  • *
  • Posts: 9
Re: ubuntu 8.04 x64, codeblocks x64, gdb x64 = program x32... not x64
« Reply #5 on: September 29, 2008, 08:09:46 pm »
OK, this is something of an odd one as GCC on 64bit systems is supposed to default to 64bit programs so it's odd that it's defaulting to 32 bit in the first place (I'm assuming this has been altered on Ubuntu as far as my earlier comments are concerned). The only other thing I can think of is to try -mcmodel=medium but so far as I know the limit there is 2GB, not 4GB and it doesn't limit where pointers can point to (just where the program and its symbols can be).

Make absolutely sure of your version of gcc/g++ on the command line (gcc --version) or double check it in Synaptic. Other than that I think this might be better answered on the Ubuntu forums as it's getting more into compiller issues than a problem with C::B. Only thing that can confirm this is to try to compile the program on the command line rather than through C::B, trying the different -m... options, to see if something sticks that doesn't in C::B. If it does work better and the compiler selection in C::B is correct then there may be a bigger problem.

Offline str0g

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: ubuntu 8.04 x64, codeblocks x64, gdb x64 = program x32... not x64
« Reply #6 on: September 29, 2008, 08:48:57 pm »
Its looks like its bigger problem...

after compiling in cmd line still same  problem :(

This program built for x86_64-pc-linux-gnu
Report bugs to <bug-make@gnu.org>
lukasz@lukasz:~/Desktop$ make -v
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for x86_64-pc-linux-gnu
lukasz@lukasz:~/Desktop$ gcc --version
gcc (GCC) 4.2.3 (Ubuntu 4.2.3-2ubuntu7)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: ubuntu 8.04 x64, codeblocks x64, gdb x64 = program x32... not x64
« Reply #7 on: September 29, 2008, 10:28:12 pm »
I'm not sure if that can cause your problem: do you have the appropriate kernel for your system, or is it a standard kernel that can not address the amount of memory you use ?

Offline str0g

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: ubuntu 8.04 x64, codeblocks x64, gdb x64 = program x32... not x64
« Reply #8 on: September 30, 2008, 12:03:09 am »
lukasz@lukasz:~$ uname -v
#1 SMP Wed Aug 20 17:53:40 UTC 2008
lukasz@lukasz:~$ uname -r
2.6.24-19-generic
lukasz@lukasz:~$ uname -s
Linux