This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch ping**3


On Sat, Apr 30, 2005 at 06:09:06PM +0100, Paul Brook wrote:
> On Saturday 30 April 2005 18:04, Steve Kargl wrote:
> > kargl[215] cat t1.f
> >       subroutine prn_val(x)
> >       real x
> >       print *, 'x = ', x
> >       end
> > kargl[216] cat t2.f
> >       program t2
> >       real x
> >       x = 1.
> >       call prn_val(x)
> >       end
> >
> > Compile t1.f with g77 and compile t2.f with gfortran
> >
> > kargl[222] f77 -c t1.f
> > kargl[223] gfc41 -static -o z -ff2c t2.f t1.o -lg2c
> >
> > /var/tmp/ccieIxG9.o(.text+0x16): In function `MAIN__':
> > : undefined reference to `prn_val_'
> >
> > collect2: ld returned 1 exit status
> 
> -fsecond-underscore
> 

Whoops.  I guess I should RTFM. :-)

The default behavior of g77 appears to be -fsecond-underscore.
Should we change options.c

    case OPT_ff2c:
      gfc_option.flag_f2c = value;
      break;

to 

    case OPT_ff2c:
      gfc_option.flag_f2c = value;
      gfc_option.flag_second_underscore = value;
      break;

-- 
Steve


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]