This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add declaration of "kill" for SPU


Hi Ulrich,

On Dec  2 20:12, Ulrich Weigand wrote:
> Hello,
> 
> on the SPU, libgloss implements the kill function, but none of the newlib
> header file provides a prototype for it.  This has been the case forever,
> but as of recent GCC changes it now causes the SPU GCC build to fail.
> 
> This is because libgfortran uses a configure check to test for the presence
> of "kill".  This will succeed since libgloss *does* have kill.  Since the
> test succeeds, libgfortran now attempt to use kill.  But since the function
> is not declared anywhere, this will result in a warning message.  And as
> of a couple of weeks ago, libgfortran has switched to using -Werror, so
> this causes the whole build to abort.
> 
> There are already two prototypes of kill in newlib header files, but both
> are not active on SPU.  The one is in libc/sys/linux/sys/signal.h, which
> isn't applicable on SPU anyway, and the other is in libc/include/sys/signal.h
> under a #if defined(__CYGWIN__) || defined(__rtems__) block.
> 
> It does not really make sense to enable that whole block for SPU, since
> it would enable a whole bunch of other functions that are in fact not
> available on the SPU.
> 
> The patch below simply adds a new prototype for kill, for use simply
> on SPU.  This fixes the GCC build breakage for me.

What about this instead.  It's pretty much what we do in other headers,
e.g. sys/unistd.h.  Does that work for you?


Index: libc/include/sys/signal.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/sys/signal.h,v
retrieving revision 1.24
diff -u -p -r1.24 signal.h
--- libc/include/sys/signal.h	18 Aug 2014 18:18:10 -0000	1.24
+++ libc/include/sys/signal.h	3 Dec 2014 09:28:48 -0000
@@ -179,8 +178,12 @@ int _EXFUN(pthread_sigmask, (int how, co
 
 #ifdef _COMPILING_NEWLIB
 int _EXFUN(_kill, (pid_t, int));
-#endif
+#endif /* _COMPILING_NEWLIB */
+#endif /* __CYGWIN__ || __rtems__ */
+#if defined(__CYGWIN__) || defined(__rtems__) || defined(__SPU__)
 int _EXFUN(kill, (pid_t, int));
+#endif /* __CYGWIN__ || __rtems__ || __SPU__ */
+#if defined(__CYGWIN__) || defined(__rtems__)
 int _EXFUN(killpg, (pid_t, int));
 int _EXFUN(sigaction, (int, const struct sigaction *, struct sigaction *));
 int _EXFUN(sigaddset, (sigset_t *, const int));


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat

Attachment: pgpCom99_IsUX.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]