This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch installed] PRs 6123 & 18382, centralize defining __PIC__/__pic__
> > diff -rup orig/egcc-SVN20051120/gcc/c-cppbuiltin.c egcc-SVN20051120/gcc/c-cppbuiltin.c
> > --- orig/egcc-SVN20051120/gcc/c-cppbuiltin.c 2005-11-03 10:40:14.000000000 -0500
> > +++ egcc-SVN20051120/gcc/c-cppbuiltin.c 2005-11-21 15:36:08.000000000 -0500
> > @@ -419,6 +419,11 @@ c_cpp_builtins (cpp_reader *pfile)
> > cpp_define (pfile, "__FINITE_MATH_ONLY__=1");
> > else
> > cpp_define (pfile, "__FINITE_MATH_ONLY__=0");
> > + if (flag_pic)
> > + {
> > + builtin_define_with_int_value ("__pic__", flag_pic);
> > + builtin_define_with_int_value ("__PIC__", flag_pic);
> > + }
> >
> > if (flag_iso)
> > cpp_define (pfile, "__STRICT_ANSI__");
>
> I know that most/all ports did it that way. Still, if a port
> would like todo it differently, then its impossible with this
> implementation. What about moving that hunk into a
> TARGET_XXX_CPP_DEFINE with this as default value? That would
> allow a port to override/change the behaviour for this define.
> Gunther
Thanks for your feedback. The whole point of my patch was to make the
values of these macros predictable across platforms.
If it turns out to be necessary strictly for correctness somewhere
e.g. the system headers reply on different behavior, then it should be
easy to make this target dependent at that point.
But until such a platform is identified I would like to discourage any
variation.
--Kaveh
--
Kaveh R. Ghazi ghazi@caip.rutgers.edu