RFR(XS): 8046408: Build failure from multiple ptrace.h

Mikael Vidstedt mikael.vidstedt at oracle.com
Wed Jun 11 18:25:41 UTC 2014


Looks good, thanks for cleaning up after me! :)

Cheers,
Mikael

On 2014-06-11 11:22, Staffan Larsen wrote:
> Looks good!
>
> Thanks,
> /Staffan
>
> On 11 jun 2014, at 17:31, Kim Barrett <kim.barrett at oracle.com> wrote:
>
>> Please review the following 1-line change which is needed to avoid
>> build failures on some platforms.
>>
>> webrev: http://cr.openjdk.java.net/~mikael/webrevs/kim-8046408/webrev/
>> bug: https://bugs.openjdk.java.net/browse/JDK-8046408
>>
>> There are two ptrace.h headers available for linux, <sys/ptrace.h> and
>> <linux/ptrace.h>.  A new struct (ptrace_peeksiginfo_args) was recently
>> added to each, but the addition in <sys/ptrace.h> didn't follow the
>> convention there of using a double-underscore prefix for type names
>> declared in that file.  As a result, if both headers are included (as
>> is occurring in our code), there are multiple definitions of that
>> struct.  It appears to be a "well known" problem that already has a
>> fix [1], but glibc 2.18 was released with this problem.
>>
>> The inclusion of both variants was due to a file (ps_proc.c) directly
>> including sys/ptrace and indirectly including linux/ptrace, where the
>> indirectly including header is used in other places that don't include
>> sys/ptrace.  Our code can presently use either of the headers; I'm
>> proposing we prefer sys/ptrace rather than linux/ptrace.  A different
>> 1-line change would be to remove the direct include of sys/ptrace and
>> let that file rely on the indirect include of linux/ptrace, but I
>> dislike that, since ps_proc.c directly uses lots of names defined in
>> those headers.
>>
>> [1] https://www.sourceware.org/ml/libc-alpha/2014-01/msg00078.html
>>



More information about the hotspot-dev mailing list