[roland/waitpid] Fix __waitpid_nocancel link error

Message ID 20140516210218.8081E2C3A81@topped-with-meat.com
State Committed
Headers

Commit Message

Roland McGrath May 16, 2014, 9:02 p.m. UTC
  > Well, I am not getting that error anymore but now my MIPS build dies
> while linking libc.so:
> 
> /local/home/sellcey/nightly/obj-mips-mti-linux-gnu/glibc/obj_default/libc_pic.os: In function `_IO_new_proc_close':
> /local/home/sellcey/nightly/src/glibc/libio/iopopen.c:347: undefined reference to `__waitpid_nocancel'
> /local/home/sellcey/nightly/src/glibc/libio/iopopen.c:345: undefined reference to `__waitpid_nocancel'
> /local/home/sellcey/nightly/install-mips-mti-linux-gnu/lib/gcc/mips-mti-linux-gnu/4.10.0/../../../../mips-mti-linux-gnu/bin/ld: /local/home/sellcey/nightly/obj-mips-mti-linux-gnu/glibc/obj_default/libc.so: hidden symbol `__waitpid_nocancel' isn't defined
> /local/home/sellcey/nightly/install-mips-mti-linux-gnu/lib/gcc/mips-mti-linux-gnu/4.10.0/../../../../mips-mti-linux-gnu/bin/ld: final link failed: Bad value
> collect2: error: ld returned 1 exit status

This is unrelated to fork.  It is due to my not-cancel.h change.  
I think the following patch will fix it.  Can you verify that?
(You can just use 'git checkout roland/waitpid' if you are otherwise
using unmodified trunk.)


Thanks,
Roland


	* sysdeps/unix/sysv/linux/not-cancel.h (waitpid_not_cancel):
	Use wait4 regardless of [__NR_waitpid].
  

Comments

Steve Ellcey May 16, 2014, 9:28 p.m. UTC | #1
On Fri, 2014-05-16 at 14:02 -0700, Roland McGrath wrote:
> 
> This is unrelated to fork.  It is due to my not-cancel.h change.  
> I think the following patch will fix it.  Can you verify that?
> (You can just use 'git checkout roland/waitpid' if you are otherwise
> using unmodified trunk.)
> 
> 
> Thanks,
> Roland
> 
> 
> 	* sysdeps/unix/sysv/linux/not-cancel.h (waitpid_not_cancel):
> 	Use wait4 regardless of [__NR_waitpid].
> 
> --- a/sysdeps/unix/sysv/linux/not-cancel.h
> +++ b/sysdeps/unix/sysv/linux/not-cancel.h
> @@ -83,13 +83,8 @@ extern int __openat64_nocancel (int fd, const char *fname, int oflag,
>    __fcntl_nocancel (fd, cmd, val)
>  
>  /* Uncancelable waitpid.  */
> -#ifdef __NR_waitpid
> -# define waitpid_not_cancel(pid, stat_loc, options) \
> -  __waitpid_nocancel (pid, stat_loc, options)
> -#else
> -# define waitpid_not_cancel(pid, stat_loc, options) \
> +#define waitpid_not_cancel(pid, stat_loc, options) \
>    INLINE_SYSCALL (wait4, 4, pid, stat_loc, options, NULL)
> -#endif
>  
>  /* Uncancelable pause.  */
>  #define pause_not_cancel() \


I applied this patch and my MIPS build worked.

Steve Ellcey
sellcey@mips.com
  
Roland McGrath May 16, 2014, 10:46 p.m. UTC | #2
Thanks for the testing.  I've put the change in.
  

Patch

--- a/sysdeps/unix/sysv/linux/not-cancel.h
+++ b/sysdeps/unix/sysv/linux/not-cancel.h
@@ -83,13 +83,8 @@  extern int __openat64_nocancel (int fd, const char *fname, int oflag,
   __fcntl_nocancel (fd, cmd, val)
 
 /* Uncancelable waitpid.  */
-#ifdef __NR_waitpid
-# define waitpid_not_cancel(pid, stat_loc, options) \
-  __waitpid_nocancel (pid, stat_loc, options)
-#else
-# define waitpid_not_cancel(pid, stat_loc, options) \
+#define waitpid_not_cancel(pid, stat_loc, options) \
   INLINE_SYSCALL (wait4, 4, pid, stat_loc, options, NULL)
-#endif
 
 /* Uncancelable pause.  */
 #define pause_not_cancel() \