[25/30] Linux: Remove unused generic Makefile

Message ID 20221019221433.1082017-26-adhemerval.zanella@linaro.org
State New
Headers
Series Remove Linux generic sysdep |

Checks

Context Check Description
dj/TryBot-apply_patch success Patch applied to master at the time it was sent

Commit Message

Adhemerval Zanella Oct. 19, 2022, 10:14 p.m. UTC
  Both are already defined on default linux Makefile.
---
 sysdeps/unix/sysv/linux/generic/Makefile | 3 ---
 1 file changed, 3 deletions(-)
 delete mode 100644 sysdeps/unix/sysv/linux/generic/Makefile
  

Comments

Carlos O'Donell Dec. 6, 2022, 5:24 p.m. UTC | #1
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
  
Adhemerval Zanella Dec. 7, 2022, 9:19 p.m. UTC | #2
On 06/12/22 14:24, Carlos O'Donell wrote:
> 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?
> 

You are right, syscalls.list will generate the Makefile entries required in this
case.  Since we now have the default implementation on Linux folder, I will add
Makefile tools to make it explicit and remove the syscalls.list entry.

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

It is on my backlog.
  

Patch

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