public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* How to get more detailed crash information from gcc
@ 2011-01-13  8:44 Schmidt, Steffen
  2011-01-13  8:46 ` Jonathan Wakely
  2011-01-13 10:28 ` How to recursively search libs using gcc Name lastlong
  0 siblings, 2 replies; 7+ messages in thread
From: Schmidt, Steffen @ 2011-01-13  8:44 UTC (permalink / raw)
  To: gcc-help


Hello,

I'm using GNU Toolchain cross-compiler MinGW32 to mips32 in GCC version 4.3.2

During compilation I rarely get a mysterious "internal compiler error: Segmentation fault" in GCC. This segmentation fault seems somehow to be related to the environment GCC runs in, e.g. the path where GCC is started in, environment variables or compiler parameters. If the segmentation fault occurs when compiling a certain c file, it is reproducible, as long as I do not change the file or the environment GCC runs in. If I change e.g. the path to the file, by renaming a folder, the segmentation fault is gone. I've also found, that by adding a certain amount of whitespaces to the c file (spaces or new lines) without changing anything else in the c file and changing nothing in the environment GCC runs in, the segmentation fault is also gone.

Unfortunately, I did not compile this GCC by myself, it has no debug information, and recompilation of this GCC or an update to a newer GCC version is currently not an option for me either. Is there perhaps some way to get more detailed information about the GCC crash, by using the GCC as is, without recompilation, like some debug option on GCCs command line? I need something that would help me trace the error, so that I might be able to prevent the crash from happening and to submit a bug report.

Thanks in advance for any responses,
 Steffen

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to get more detailed crash information from gcc
  2011-01-13  8:44 How to get more detailed crash information from gcc Schmidt, Steffen
@ 2011-01-13  8:46 ` Jonathan Wakely
  2011-01-13 10:28 ` How to recursively search libs using gcc Name lastlong
  1 sibling, 0 replies; 7+ messages in thread
From: Jonathan Wakely @ 2011-01-13  8:46 UTC (permalink / raw)
  To: Schmidt, Steffen; +Cc: gcc-help

On 13 January 2011 08:44, Schmidt, Steffen wrote:
>
> Hello,
>
> I'm using GNU Toolchain cross-compiler MinGW32 to mips32 in GCC version 4.3.2
>
> During compilation I rarely get a mysterious "internal compiler error: Segmentation fault" in GCC. This segmentation fault seems somehow to be related to the environment GCC runs in, e.g. the path where GCC is started in, environment variables or compiler parameters. If the segmentation fault occurs when compiling a certain c file, it is reproducible, as long as I do not change the file or the environment GCC runs in. If I change e.g. the path to the file, by renaming a folder, the segmentation fault is gone. I've also found, that by adding a certain amount of whitespaces to the c file (spaces or new lines) without changing anything else in the c file and changing nothing in the environment GCC runs in, the segmentation fault is also gone.
>
> Unfortunately, I did not compile this GCC by myself, it has no debug information, and recompilation of this GCC or an update to a newer GCC version is currently not an option for me either. Is there perhaps some way to get more detailed information about the GCC crash, by using the GCC as is, without recompilation, like some debug option on GCCs command line? I need something that would help me trace the error, so that I might be able to prevent the crash from happening and to submit a bug report.

The -v option will show you the sub-processes that the gcc driver
runs, then you can try debugging that process, see
http://gcc.gnu.org/wiki/DebuggingGCC

^ permalink raw reply	[flat|nested] 7+ messages in thread

* How to recursively search libs using gcc
  2011-01-13  8:44 How to get more detailed crash information from gcc Schmidt, Steffen
  2011-01-13  8:46 ` Jonathan Wakely
@ 2011-01-13 10:28 ` Name lastlong
  2011-01-13 12:35   ` Jonathan Wakely
  1 sibling, 1 reply; 7+ messages in thread
From: Name lastlong @ 2011-01-13 10:28 UTC (permalink / raw)
  To: gcc-help

Hi,

We have an option "--start-group <archive or obj files> --end-group"
to LD that searches the libs recursively.

What do I need to do (if I want to use gcc for linking and not LD) for searching libs recursively using gcc?

I know following workaround;
#gcc -Wl,--start-group <obj or archive files> -Wl,--end-group

Is there any other way?
Does gcc, by default, searches libs recursively?

Thanks for help.

-Brew


      

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to recursively search libs using gcc
  2011-01-13 10:28 ` How to recursively search libs using gcc Name lastlong
@ 2011-01-13 12:35   ` Jonathan Wakely
  2011-01-13 14:03     ` Name lastlong
  0 siblings, 1 reply; 7+ messages in thread
From: Jonathan Wakely @ 2011-01-13 12:35 UTC (permalink / raw)
  To: Name lastlong; +Cc: gcc-help

On 13 January 2011 10:28, Name lastlong wrote:
> Hi,
>
> We have an option "--start-group <archive or obj files> --end-group"
> to LD that searches the libs recursively.
>
> What do I need to do (if I want to use gcc for linking and not LD) for searching libs recursively using gcc?
>
> I know following workaround;
> #gcc -Wl,--start-group <obj or archive files> -Wl,--end-group

That's not a workaround, it's how to tell gcc to pass arguments to the
linker, so that's the right way to do it.
That's described in the man page for gnu ld.

> Is there any other way?

gcc '-Wl,-(' <obj or archive files> '-Wl,-)'

But it is just the same as using start-group/end-group

> Does gcc, by default, searches libs recursively?

No.  You can see the options passed to the linker by using 'gcc -v ...'

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to recursively search libs using gcc
  2011-01-13 12:35   ` Jonathan Wakely
@ 2011-01-13 14:03     ` Name lastlong
  2011-01-13 16:35       ` Jonathan Wakely
  0 siblings, 1 reply; 7+ messages in thread
From: Name lastlong @ 2011-01-13 14:03 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-help

First of all, apology for mixing/linking  my post with other unrelated post.

> That's not a workaround, it's how to tell gcc to pass  arguments to the
> linker, so that's the right way to do it. 

I agree, it not a 'work-around'.

> > Is there any other way?
> 
> gcc '-Wl,-(' <obj or archive files> '-Wl,-)'

This is useful. I have trouble getting this work, but I shall be able to fix it. 

-Brew


      

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to recursively search libs using gcc
  2011-01-13 14:03     ` Name lastlong
@ 2011-01-13 16:35       ` Jonathan Wakely
  2011-01-17 11:11         ` Name lastlong
  0 siblings, 1 reply; 7+ messages in thread
From: Jonathan Wakely @ 2011-01-13 16:35 UTC (permalink / raw)
  To: Name lastlong; +Cc: gcc-help

On 13 January 2011 14:03, Name lastlong wrote:
>
>> > Is there any other way?
>>
>> gcc '-Wl,-(' <obj or archive files> '-Wl,-)'
>
> This is useful. I have trouble getting this work, but I shall be able to fix it.

The shell might treat ( and ) as special characters that need to be
quoted or escaped.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How to recursively search libs using gcc
  2011-01-13 16:35       ` Jonathan Wakely
@ 2011-01-17 11:11         ` Name lastlong
  0 siblings, 0 replies; 7+ messages in thread
From: Name lastlong @ 2011-01-17 11:11 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-help

--- On Thu, 1/13/11, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
> From: Jonathan Wakely <jwakely.gcc@gmail.com>
> The shell might treat ( and ) as special characters that
> need to be quoted or escaped.

Thats right, -Wl,\( and -Wl,\) did work for me. Thanks a lot.

-Brew


      

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-01-17 11:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-13  8:44 How to get more detailed crash information from gcc Schmidt, Steffen
2011-01-13  8:46 ` Jonathan Wakely
2011-01-13 10:28 ` How to recursively search libs using gcc Name lastlong
2011-01-13 12:35   ` Jonathan Wakely
2011-01-13 14:03     ` Name lastlong
2011-01-13 16:35       ` Jonathan Wakely
2011-01-17 11:11         ` Name lastlong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).