diff mbox

microblaze-linux: add missing cpp specs

Message ID 1432742394-23471-1-git-send-email-vapier@gentoo.org
State New
Headers show

Commit Message

Mike Frysinger May 27, 2015, 3:59 p.m. UTC
Define CPP_SPEC for microblaze linux targets so that -posix & -pthread
work like on all other linux targets.

2015-05-27  Mike Frysinger  <vapier@gentoo.org>

	* config/microblaze/linux.h (CPP_SPEC): Define.
---
 gcc/config/microblaze/linux.h | 3 +++
 1 file changed, 3 insertions(+)

Comments

Andreas Schwab May 27, 2015, 4:03 p.m. UTC | #1
Mike Frysinger <vapier@gentoo.org> writes:

> diff --git a/gcc/config/microblaze/linux.h b/gcc/config/microblaze/linux.h
> index a7faa7d..655a70f 100644
> --- a/gcc/config/microblaze/linux.h
> +++ b/gcc/config/microblaze/linux.h
> @@ -22,6 +22,9 @@
>  #undef TARGET_SUPPORTS_PIC
>  #define TARGET_SUPPORTS_PIC 1
>  
> +#undef CPP_SPEC
> +#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"

Should this be defined by a shared header?

Andreas.
Jeff Law May 27, 2015, 4:06 p.m. UTC | #2
On 05/27/2015 10:03 AM, Andreas Schwab wrote:
> Mike Frysinger <vapier@gentoo.org> writes:
>
>> diff --git a/gcc/config/microblaze/linux.h b/gcc/config/microblaze/linux.h
>> index a7faa7d..655a70f 100644
>> --- a/gcc/config/microblaze/linux.h
>> +++ b/gcc/config/microblaze/linux.h
>> @@ -22,6 +22,9 @@
>>   #undef TARGET_SUPPORTS_PIC
>>   #define TARGET_SUPPORTS_PIC 1
>>
>> +#undef CPP_SPEC
>> +#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
>
> Should this be defined by a shared header?
Seems that way to me as well.

jeff
Mike Frysinger May 27, 2015, 4:28 p.m. UTC | #3
On 27 May 2015 18:03, Andreas Schwab wrote:
> Mike Frysinger <vapier@gentoo.org> writes:
> 
> > diff --git a/gcc/config/microblaze/linux.h b/gcc/config/microblaze/linux.h
> > index a7faa7d..655a70f 100644
> > --- a/gcc/config/microblaze/linux.h
> > +++ b/gcc/config/microblaze/linux.h
> > @@ -22,6 +22,9 @@
> >  #undef TARGET_SUPPORTS_PIC
> >  #define TARGET_SUPPORTS_PIC 1
> >  
> > +#undef CPP_SPEC
> > +#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
> 
> Should this be defined by a shared header?

i was going to poke that next, but i don't think fixing the few fringe arches 
should be predicated on cleaning up a mess that has been here for over a decade.
-mike
Jeff Law May 27, 2015, 4:36 p.m. UTC | #4
On 05/27/2015 10:28 AM, Mike Frysinger wrote:
> On 27 May 2015 18:03, Andreas Schwab wrote:
>> Mike Frysinger <vapier@gentoo.org> writes:
>>
>>> diff --git a/gcc/config/microblaze/linux.h b/gcc/config/microblaze/linux.h
>>> index a7faa7d..655a70f 100644
>>> --- a/gcc/config/microblaze/linux.h
>>> +++ b/gcc/config/microblaze/linux.h
>>> @@ -22,6 +22,9 @@
>>>   #undef TARGET_SUPPORTS_PIC
>>>   #define TARGET_SUPPORTS_PIC 1
>>>
>>> +#undef CPP_SPEC
>>> +#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
>>
>> Should this be defined by a shared header?
>
> i was going to poke that next, but i don't think fixing the few fringe arches
> should be predicated on cleaning up a mess that has been here for over a decade.
How dare you call the PA a fringe architecture, it's only been dead for 
a decade or so.

If you're going to poke at factoring that code out next, then I don't 
mind going forward now.  All these are approved.

jeff
diff mbox

Patch

diff --git a/gcc/config/microblaze/linux.h b/gcc/config/microblaze/linux.h
index a7faa7d..655a70f 100644
--- a/gcc/config/microblaze/linux.h
+++ b/gcc/config/microblaze/linux.h
@@ -22,6 +22,9 @@ 
 #undef TARGET_SUPPORTS_PIC
 #define TARGET_SUPPORTS_PIC 1
 
+#undef CPP_SPEC
+#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
+
 #undef TLS_NEEDS_GOT
 #define TLS_NEEDS_GOT 1