Compiling gcc with -mcmodel=large fails

Adrian Smith adrian.m.smith@gmail.com
Tue Jul 3 08:28:00 GMT 2012


When I try to compile gcc using "-mcmodel=large" it fails with:

   configure: error: cannot compute suffix of object files:
   cannot compile. See `config.log' for more details.

I have, however, successfully downloaded and compiled gcc without
using the "-mcmodel=large" option. gcc compiles, and the resulting
compiler compiles a simple "hello world" and the program runs
successfully.

Introducing the "-mcmodel=large" parameters into the CFLAGS_FOR_TARGET
parameter in following command, however, causes it to fail:

   make \
      BOOT_CFLAGS='-g -O2 -mcmodel=large' \
      CFLAGS_FOR_TARGET='-g -O2 -mcmodel=large' \
      bootstrap

The "config.log" is identical between the successful and
non-successful runs (attached). The stdout and stderr from the "make"
command which fails is also attached.

I am compiling gcc 4.7.1 on Ubuntu 10.10 x86-64.

I would appreciate your help.

The reason I am compiling gcc like this is I wish to use the
"-mcmodel=large" option, as I have a (generated) program whose
executable would be larger than 2GB. When I use the standard gcc
supplied with my system, and use this option, the linker fails with
errors like the following; I understand this means I need to recompile
gcc itself using the option, please correct me if I am wrong about
this.

   crtstuff.c:(.text+0x20): relocation truncated to fit:
   R_X86_64_32S against `.dtors'

Thanks,
Adrian
---
Adrian Smith B.Sc.
adrian.m.smith@gmail.com
http://www.databasesandlife.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: config.log
Type: application/octet-stream
Size: 26785 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20120703/0844ff4a/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: make-stdouterr.txt.gz
Type: application/x-gzip
Size: 34138 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20120703/0844ff4a/attachment.bin>


More information about the Gcc-help mailing list