This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
gcc bug on solaris 2.7?
- To: gcc-bugs at gcc dot gnu dot org
- Subject: gcc bug on solaris 2.7?
- From: Satish Balay <balay at mcs dot anl dot gov>
- Date: Thu, 12 Aug 1999 16:57:15 -0500 (CDT)
GCC developers,
I have the following report to file regarding gcc-2.95 on solaris 2.7.
I can reproduce the same problem with older versions of egcs(1.1) on
this machine. However everything works fine on a solaris 2.6 machine.
Don't know if this is a gcc bug or solaris-2.7 bug. I've tared up
the source files, including the intermediate files, and the output
from the options "-v --save-temps" in make.log in this tar file.
Thanks,
Satish
*************************************************
fire:/homes/balay/junk/bug>gcc -v
Reading specs from /home/alice/software/gcc-2.95/solaris-gcc/lib/gcc-lib/sparc-sun-solaris2.7/2.95/specs
gcc version 2.95 19990728 (release)
fire:/homes/balay/junk/bug>uname -a
SunOS fire.mcs.anl.gov 5.7 Generic_106541-05 sun4u sparc
*************************************************
fire:/homes/balay/junk/bug>cat main.c
#include <stdio.h>
extern void foo(void);
int main(void)
{
foo();
return 0;
}
fire:/homes/balay/junk/bug>cat foo.c
#include <stdio.h>
void foo1(void)
{
printf("Hello\n");
}
void (*foo2)(void) = foo1;
void foo(void)
{
(*foo2)();
}
********************************************************
fire:/homes/balay/junk/bug>gcc main.c foo.c
fire:/homes/balay/junk/bug>a.out <-- direct compile works.
Hello
fire:/homes/balay/junk/bug>gcc -c foo.c
fire:/homes/balay/junk/bug>ar clr libfoo.a foo.o
fire:/homes/balay/junk/bug>gcc main.c -L. -lfoo
fire:/homes/balay/junk/bug>a.out <-- Using static libraries work
Hello
fire:/homes/balay/junk/bug>ld -G foo.o -o libfoo.so
fire:/homes/balay/junk/bug>gcc main.c -L. -lfoo -R.
fire:/homes/balay/junk/bug>a.out <-- shared libraries crash
Segmentation fault
*******************************************************
bug.tar.gz