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__
- From: Gunther Nikl <gni at gecko dot de>
- To: "Kaveh R. Ghazi" <ghazi at caipclassic dot rutgers dot edu>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 30 Nov 2005 16:31:46 +0100
- Subject: Re: [patch installed] PRs 6123 & 18382, centralize defining __PIC__/__pic__
- References: <200511220324.jAM3OVcu024505@caipclassic.rutgers.edu>
On Mon, Nov 21, 2005 at 10:24:31PM -0500, Kaveh R. Ghazi wrote:
>
> As per:
> http://gcc.gnu.org/ml/gcc-patches/2005-09/msg00775.html
> I've installed my fix for these PRs. Updated patch below which I
> retested with mainline on x86_64-unknown-linux-gnu.
Sorry for being that late.
> 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