[PATCH] x32: Add <asm/unistd_x32.h> and regenerate arch-syscall.h

Florian Weimer fweimer@redhat.com
Mon Aug 24 17:17:23 GMT 2020


* H. J. Lu:

> On Mon, Aug 24, 2020 at 6:23 AM Florian Weimer <fweimer@redhat.com> wrote:
>>
>> * H. J. Lu:
>>
>> > It doesn't work in this case.  <fixup-asm-unistd.h> is used to undefine or
>> > redefine a syscall from <asm/unistd.h>.   The actual syscall numbers still
>> > come from <asm/unistd.h>.  In this case, the sycall number is missing from
>> > <asm/unistd_x32.h>.   My patch is a prerequisite for a new testcase:
>> >
>> > ../sysdeps/unix/sysv/linux/x86/tst-sigreturn-1.c: In function ‘setup_ldt’:
>> > ../sysdeps/unix/sysv/linux/x86/tst-sigreturn-1.c:258:14: error:
>> > ‘SYS_set_thread_area’ undeclared (first use in this function)
>> >   258 |  if (syscall(SYS_set_thread_area, &gdt_data16_desc) == 0) {
>> >       |              ^~~~~~~~~~~~~~~~~~~
>>
>> Can you make it an internal test and use __NR_set_thread_area?
>>
>
> Like?
>
> #if !defined(__NR_set_thread_area) && defined(__x86_64__) && defined(__ILP32__)
> /* X32 uses the same 64-bit syscall interface for set_thread_area.  */
> # define __NR_set_thread_area (__X32_SYSCALL_BIT + 205)
> #endif

No, I neant using tests-internal, so that you get the built-in system
call table.

But is it really correct to add an unsupported system call definition
for the rest of glibc?  If this is just setting things up for a test,
maybe the __X32_SYSCALL_BIT hack is the right approach after all.
(I don't know the objective of this test.)

Thanks,
Florian



More information about the Libc-alpha mailing list