This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Fix missing err declaration in __pthread_initialize_minimal_internal
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: sellcey at imgtec dot com, GNU C Library <libc-alpha at sourceware dot org>, Khem Raj <raj dot khem at gmail dot com>
- Cc: Roland McGrath <roland at hack dot frob dot com>
- Date: Sat, 23 May 2015 23:04:26 -0400
- Subject: Re: [PATCH] Fix missing err declaration in __pthread_initialize_minimal_internal
- Authentication-results: sourceware.org; auth=none
- References: <1432312942 dot 16668 dot 92 dot camel at ubuntu-sellcey>
On 05/22/2015 12:42 PM, Steve Ellcey wrote:
> Roland's patch (https://sourceware.org/ml/libc-alpha/2015-05/msg00464.html)
> to set tid field to a unique value removed the declaration of err
> [INTERNAL_SYSCALL_DECL (err);] from __pthread_initialize_minimal_internal,
> but there are other uses of err in other INTERNAL_SYSCALL's in
> __pthread_initialize_minimal_internal so this broke the build glibc build
> for MIPS (and presumably other platforms).
>
> Here is a patch to put the declaration back. I think the only question
> is exactly where this declaration should go. I initially put it right
> in front of the first INTERNAL_SYSCALL call but I noticed that that is inside
> of an ifdef and there are other INTERNAL_SYSCALL uses (with err) that
> are in different ifdef's so I moved the declaration outside of any ifdef's.
> This fixed my build problem. OK to checkin?
>
> Steve Ellcey
> sellcey@imgtec.com
>
>
>
> 2015-05-22 Steve Ellcey <sellcey@imgtec.com>
>
> * nptl/nptl-init.c (__pthread_initialize_minimal_internal):
> Add declaration of err that was removed in earlier patch.
>
>
>
> diff --git a/nptl/nptl-init.c b/nptl/nptl-init.c
> index 5b8d931..3bfb478 100644
> --- a/nptl/nptl-init.c
> +++ b/nptl/nptl-init.c
> @@ -326,6 +326,7 @@ __pthread_initialize_minimal_internal (void)
> pd->robust_prev = &pd->robust_head;
> #endif
> pd->robust_head.list = &pd->robust_head;
> + INTERNAL_SYSCALL_DECL (err);
Why isn't this inside the inner ifdef?
> #ifdef __NR_set_robust_list
> pd->robust_head.futex_offset = (offsetof (pthread_mutex_t, __data.__lock)
> - offsetof (pthread_mutex_t,
As Florian mentioned to Raj, the definition of the err decl should
be in the same scope as the syscall that uses it.
Did I miss something?
Cheers,
Carlos.