[PATCH][RFC] -EB / -EL don't properly affect gcc predefined symbols
Hi, Regarding the PR: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29413 Is below patch adequate to fix the problem? Works fine with me, but haven't done any regression test. Thanks in Advance (Hiroki Kaminaga) t -- Index: gcc/gcc/config/mips/mips.h === --- gcc.orig/gcc/config/mips/mips.h +++ gcc/gcc/config/mips/mips.h @@ -1152,7 +1152,8 @@ extern const struct mips_cpu_info *mips_ #define SUBTARGET_CPP_SPEC "" #endif -#define CPP_SPEC "%(subtarget_cpp_spec)" +#define CPP_SPEC "%(subtarget_cpp_spec) %{EB:-meb} %{EL:-mel} \ +%{EB:%{EL:%emay not use both -EB and -EL}}" /* This macro defines names of additional specifications to put in the specs that can be used in various specifications like CC1_SPEC. Its definition
Re: [PATCH][RFC] -EB / -EL don't properly affect gcc predefined symbols
From: Andrew Pinski <[EMAIL PROTECTED]> > As I mentioned in the bug report, the problem is that CC1_SPEC > is the wrong one. (snip) > The attached patch is the more correct way to solve this. Thanks alot! (Hiroki Kaminaga) t --
Re: [PATCH][RFC] -EB / -EL don't properly affect gcc predefined symbols
From: Andrew Pinski <[EMAIL PROTECTED]> > On Thu, 2006-10-12 at 17:06 +0900, Hiroki Kaminaga wrote: > > Hi, > > > > Regarding the PR: > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29413 > > > > Is below patch adequate to fix the problem? > > Works fine with me, but haven't done any regression test. > > As I mentioned in the bug report, the problem is that CC1_SPEC > is the wrong one. > > Adding EB/EL to CPP_SPEC will only fix the C/C++/Objective-C front-ends > and no others. > > The attached patch is the more correct way to solve this. Your patch would cause `-profile' option not to set `-p' to cc1. Is this OK? Best Regards, (Hiroki Kaminaga) t --
Re: [PATCH][RFC] -EB / -EL don't properly affect gcc predefined symbols
From: Andrew Pinski <[EMAIL PROTECTED]> > > Your patch would cause `-profile' option not to set `-p' to cc1. Is this OK? > Not really, the following patch on top of the previous fixes the above > problem: > Index: config/mips/linux.h > === > --- config/mips/linux.h (revision 117683) > +++ config/mips/linux.h (working copy) > @@ -49,6 +49,8 @@ Boston, MA 02110-1301, USA. */ > #undef MD_EXEC_PREFIX > #undef MD_STARTFILE_PREFIX > > +#define SUBTARGET_CC1_SPEC "%{profile:-p}" > + > /* If we don't set MASK_ABICALLS, we can't default to PIC. */ > #undef TARGET_DEFAULT > #define TARGET_DEFAULT MASK_ABICALLS How about appending to CC1_SPEC? -#ifndef CC1_SPEC +#undef CC1_SPEC #define CC1_SPEC "\ %{gline:%{!g:%{!g0:%{!g1:%{!g2: -g1} \ %{G*} %{EB:-meb} %{EL:-mel} %{EB:%{EL:%emay not use both -EB and -EL}} \ %{save-temps: } \ -%(subtarget_cc1_spec)" +%(subtarget_cc1_spec) %{profile:-p}" -#endif Other architecture seems to set %{profile:-p} to CC1_SPEC. Best Regards, (Hiroki Kaminaga) t --