diff mbox

add common CPP_SPECS for bfin

Message ID 20161129055120.GN14207@waldemar-brodkorb.de
State New
Headers show

Commit Message

Waldemar Brodkorb Nov. 29, 2016, 5:51 a.m. UTC
Hi,

add common defines _REENTRANT and _POSIX_SOURCE for bfin.
Patch is used in Buildroot for a while to fix issues compiling 
some software.
See here, why this should be always enabled:
https://lists.gnu.org/archive/html/autoconf-archive-maintainers/2016-06/msg00001.html  

2016-11-29  Waldemar Brodkorb <wbx@openadk.org>                                                                                                                         
                                                                                                                                                                        
       gcc/
       * gcc/config/bfin/linux.h: add common CPP_SPEC.

Comments

Jeff Law Nov. 29, 2016, 9:41 p.m. UTC | #1
On 11/28/2016 10:51 PM, Waldemar Brodkorb wrote:
> Hi,
>
> add common defines _REENTRANT and _POSIX_SOURCE for bfin.
> Patch is used in Buildroot for a while to fix issues compiling
> some software.
> See here, why this should be always enabled:
> https://lists.gnu.org/archive/html/autoconf-archive-maintainers/2016-06/msg00001.html
>
> 2016-11-29  Waldemar Brodkorb <wbx@openadk.org>
>
>        gcc/
>        * gcc/config/bfin/linux.h: add common CPP_SPEC.
Thanks.  I've adjusted the ChangeLog entry and committed this patch for you.

Jeff
diff mbox

Patch

diff --git a/gcc/config/bfin/linux.h b/gcc/config/bfin/linux.h
index c02ff44..0922493 100644
--- a/gcc/config/bfin/linux.h
+++ b/gcc/config/bfin/linux.h
@@ -38,6 +38,9 @@  see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
   "%{static:--start-group} %{mfast-fp:-lbffastfp} %G %L %{static:--end-group} \
    %{!static:%{mfast-fp:-lbffastfp} %G}"
 
+#undef CPP_SPEC
+#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
+
 #undef LINK_SPEC
 #define LINK_SPEC "\
   %{mfdpic: -m elf32bfinfd -z text} %{shared} %{pie} \