segfault in cc1 during compilation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm compiling gcc 4.3.1 on OpenBSD 4.3, using gcc 3.3.5.

While configuring libgcc, configure failed saying "configure: error:
cannot compute suffix of object files: cannot compile". The relevant
section of config.log was:

configure:2398: /tmp/objdir/./gcc/xgcc -B/tmp/objdir/./gcc/ -B/usr/local/i386-unknown-openbsd4.3/bin/ -B/usr/local/i386-unknown-openbsd4.3/lib/ -isystem /usr/local/i386-unknown-openbsd4.3/include -isystem /usr/local/i386-unknown-openbsd4.3/sys-include -o conftest -O2 -g -g -O2     conftest.c  >&5
cc1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
configure:2401: $? = 1

So I loaded cc1 into gdb:

(gdb) set arg conftest.c
(gdb) r
Starting program: /tmp/objdir/gcc/cc1 conftest.c

Program received signal SIGSEGV, Segmentation fault.
0x1c03579f in c_common_init_options (argc=2, argv=0x10000000) at /usr/local/src/gcc-4.3.1/gcc/c-opts.c:247
247             if (! strcmp (argv[i], "-lang-asm"))
(gdb) bt
#0  0x1c03579f in c_common_init_options (argc=2, argv=0x10000000) at /usr/local/src/gcc-4.3.1/gcc/c-opts.c:247
#1  0x1c148cd5 in decode_options (argc=2, argv=0x10000000) at /usr/local/src/gcc-4.3.1/gcc/opts.c:733
#2  0x1c1b2a76 in toplev_main (argc=2, argv=0x10000000) at /usr/local/src/gcc-4.3.1/gcc/toplev.c:2266
#3  0x1c0502bf in main (argc=2, argv=0xcfbeec14) at /usr/local/src/gcc-4.3.1/gcc/main.c:35

Stepping through this part of the code, it looks like general_init(argv[0]) 
is stomping on argv at the call to xmalloc_set_program_name(progname).

I don't know about all the function calls in general_init(), so I just
assigned argv = save_argv after the call to general_init in
toplev_main () in toplev.c. That seems to have fixed the problem for
now, but I'm afraid I've missed a bigger problem. Does anyone have any
insight here?

-Jason


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux