tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

diff: libpthread build fails with USE_SSP



Hi!

I get these warnings during compilation:

#   compile  libpthread/pthread_cancelstub.o
/home/proger/net/src/obj/tooldir.NetBSD-5.99.48-amd64/bin/x86_64--netbsd-gcc 
-O2 -g -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 
-Wno-sign-compare -Wno-traditional -Wa,--fatal-warnings -Wreturn-type -Wswitch 
-Wshadow -Wcast-qual -Wwrite-strings -Wextra -Wno-unused-parameter 
-Wsign-compare -std=gnu99  -Werror  -fstack-protector -Wstack-protector --param 
ssp-buffer-size=1 -Wno-cast-qual  
-I/home/proger/net/src/lib/libpthread/arch/x86_64 
-I/home/proger/net/src/lib/libpthread -I/home/proger/net/src/lib/libpthread/obj 
-D_LIBC -D__LIBPTHREAD_SOURCE__ -I/src/sys 
-I/home/proger/net/src/lib/libpthread/../libc  -D_FORTIFY_SOURCE=2 -nostdinc 
-isystem /home/proger/net/src/obj/destdir.amd64/usr/include -c    
/home/proger/net/src/lib/libpthread/pthread_cancelstub.c -o pthread_cancelstub.o
cc1: warnings being treated as errors
/home/proger/net/src/lib/libpthread/pthread_cancelstub.c:479: warning: no 
previous prototype for '_cancelstub_readlink'
/home/proger/net/src/lib/libpthread/pthread_cancelstub.c:486: warning: no 
previous prototype for '_cancelstub_getcwd'
/home/proger/net/src/lib/libpthread/pthread_cancelstub.c:495: warning: no 
previous prototype for '_cancelstub_read'

Proposed diff:
 
Index: pthread_cancelstub.c
===================================================================
RCS file: /cvsroot/src/lib/libpthread/pthread_cancelstub.c,v
retrieving revision 1.31
diff -u -p -r1.31 pthread_cancelstub.c
--- pthread_cancelstub.c        26 Jan 2011 18:48:57 -0000      1.31
+++ pthread_cancelstub.c        10 Apr 2011 07:16:09 -0000
@@ -472,7 +472,10 @@ pwrite(int d, const void *buf, size_t nb
 
 #if _FORTIFY_SOURCE > 0
 #define STUB(fun) __ssp_weak_name(fun)
+
+ssize_t STUB(readlink)(const char * __restrict, char * __restrict, size_t);
 ssize_t _sys_readlink(const char * __restrict, char * __restrict, size_t);
+
 ssize_t
 STUB(readlink)(const char * __restrict path, char * __restrict buf,
     size_t bufsiz)
@@ -480,15 +483,16 @@ STUB(readlink)(const char * __restrict p
        return _sys_readlink(path, buf, bufsiz);
 }
 
+char *STUB(getcwd)(char *, size_t);
 char *_sys_getcwd(char *, size_t);
+
 char *
 STUB(getcwd)(char *buf, size_t size)
 {
        return _sys_getcwd(buf, size);
 }
-#else
-#define STUB(fun) fun
-#endif
+
+ssize_t STUB(read)(int, void *, size_t);
 
 ssize_t
 STUB(read)(int d, void *buf, size_t nbytes)
@@ -503,6 +507,9 @@ STUB(read)(int d, void *buf, size_t nbyt
 
        return retval;
 }
+#else
+#define STUB(fun) fun
+#endif
 
 ssize_t
 readv(int d, const struct iovec *iov, int iovcnt)



Home | Main Index | Thread Index | Old Index