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]

[PATCH] Add declaration of "kill" for SPU


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.

Bye,
Ulrich


newlib/ChangeLog:

	* libc/include/sys/signal.h [__SPU__] (kill): Declare.


Index: src/newlib/libc/include/sys/signal.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/sys/signal.h,v
retrieving revision 1.24
diff -u -r1.24 signal.h
--- src/newlib/libc/include/sys/signal.h	18 Aug 2014 18:18:10 -0000	1.24
+++ src/newlib/libc/include/sys/signal.h	5 Oct 2014 21:41:43 -0000
@@ -225,6 +225,10 @@
 
 #endif /* defined(__CYGWIN__) || defined(__rtems__) */
 
+#if defined(__SPU__)
+int _EXFUN(kill, (pid_t, int));
+#endif
+
 /* #endif __STRICT_ANSI__ */
 
 #if defined(___AM29K__)
-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com


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