[PATCH 25/30] Linux: Remove unused generic Makefile

Carlos O'Donell carlos@redhat.com
Tue Dec 6 17:24:34 GMT 2022


On 10/19/22 18:14, Adhemerval Zanella via Libc-alpha wrote:
> Both are already defined on default linux Makefile.

Is this true? It is defined in the default syscalls.list and built
as a wrapper from that.

With your series applied I see things like:

(echo '#define SYSCALL_NAME epoll_create'; \
 echo '#define SYSCALL_NARGS 1'; \
 echo '#define SYSCALL_ULONG_ARG_1 0'; \
 echo '#define SYSCALL_ULONG_ARG_2 0'; \
 echo '#define SYSCALL_SYMBOL epoll_create'; \
 echo '#define SYSCALL_NOERRNO 0'; \
 echo '#define SYSCALL_ERRVAL 0'; \
 echo '#include <syscall-template.S>'; \
) | gcc -Wl,--build-id=none -c ...

objdump -ldr misc/epoll_create.os

misc/epoll_create.os:     file format elf64-x86-64


Disassembly of section .text:

0000000000000000 <__GI_epoll_create>:
epoll_create():
/mnt/ssd/carlos/src/glibc-work/misc/../sysdeps/unix/syscall-template.S:120
   0:	b8 d5 00 00 00       	mov    $0xd5,%eax
   5:	0f 05                	syscall 
   7:	48 3d 01 f0 ff ff    	cmp    $0xfffffffffffff001,%rax
   d:	73 01                	jae    10 <__GI_epoll_create+0x10>
/mnt/ssd/carlos/src/glibc-work/misc/../sysdeps/unix/syscall-template.S:122
   f:	c3                   	ret    
/mnt/ssd/carlos/src/glibc-work/misc/../sysdeps/unix/syscall-template.S:123
  10:	48 8b 0d 00 00 00 00 	mov    0x0(%rip),%rcx        # 17 <__GI_epoll_create+0x17>
			13: R_X86_64_GOTTPOFF	__libc_errno-0x4
  17:	f7 d8                	neg    %eax
  19:	64 89 01             	mov    %eax,%fs:(%rcx)
  1c:	48 83 c8 ff          	or     $0xffffffffffffffff,%rax
  20:	c3                   	ret    

There is no Makefile definition for these so the C versions are
going to be unused until the syscalls.list entry is removed?

May you please confirm using a final build that we don't still need this?

Likewise we should probably cross-check bewteen the makefiles and the
syscalls-list to see what is and isn't being built with wrappers.

> ---
>  sysdeps/unix/sysv/linux/generic/Makefile | 3 ---
>  1 file changed, 3 deletions(-)
>  delete mode 100644 sysdeps/unix/sysv/linux/generic/Makefile
> 
> diff --git a/sysdeps/unix/sysv/linux/generic/Makefile b/sysdeps/unix/sysv/linux/generic/Makefile
> deleted file mode 100644
> index 7e27e79772..0000000000
> --- a/sysdeps/unix/sysv/linux/generic/Makefile
> +++ /dev/null
> @@ -1,3 +0,0 @@
> -ifeq ($(subdir),misc)
> -sysdep_routines += epoll_create inotify_init
> -endif



-- 
Cheers,
Carlos.



More information about the Libc-alpha mailing list