[v2,1/3] ia64: Always define IA64_USE_NEW_STUB as a flag macro

Message ID aaebc7f81d38f328e69ee39b970be9f01bed33a7.1651682800.git.fweimer@redhat.com
State Superseded
Headers
Series [v2,1/3] ia64: Always define IA64_USE_NEW_STUB as a flag macro |

Checks

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

Commit Message

Florian Weimer May 4, 2022, 4:47 p.m. UTC
  And keep the previous definition if it exists.  This allows
disabling IA64_USE_NEW_STUB while keeping USE_DL_SYSINFO defined.
---
v2: New patch.
 sysdeps/unix/sysv/linux/ia64/brk.c    |  3 +--
 sysdeps/unix/sysv/linux/ia64/sysdep.h | 21 +++++++++++++--------
 2 files changed, 14 insertions(+), 10 deletions(-)


base-commit: c1b68685d438373efe64e5f076f4215723004dfb
  

Comments

Adhemerval Zanella Netto May 4, 2022, 4:54 p.m. UTC | #1
On 04/05/2022 13:47, Florian Weimer wrote:
> And keep the previous definition if it exists.  This allows
> disabling IA64_USE_NEW_STUB while keeping USE_DL_SYSINFO defined.
> ---
> v2: New patch.
>  sysdeps/unix/sysv/linux/ia64/brk.c    |  3 +--
>  sysdeps/unix/sysv/linux/ia64/sysdep.h | 21 +++++++++++++--------
>  2 files changed, 14 insertions(+), 10 deletions(-)
> 
> diff --git a/sysdeps/unix/sysv/linux/ia64/brk.c b/sysdeps/unix/sysv/linux/ia64/brk.c
> index 65142aeae9..e1fa88f9b0 100644
> --- a/sysdeps/unix/sysv/linux/ia64/brk.c
> +++ b/sysdeps/unix/sysv/linux/ia64/brk.c
> @@ -16,7 +16,6 @@
>     License along with the GNU C Library; if not, see
>     <https://www.gnu.org/licenses/>.  */
>  
> -#include <dl-sysdep.h>
>  /* brk is used by statup before TCB is properly set.  */
> -#undef USE_DL_SYSINFO
> +#define IA64_USE_NEW_STUB 0
>  #include <sysdeps/unix/sysv/linux/brk.c>
> diff --git a/sysdeps/unix/sysv/linux/ia64/sysdep.h b/sysdeps/unix/sysv/linux/ia64/sysdep.h
> index 193ecee023..72b72acb6f 100644
> --- a/sysdeps/unix/sysv/linux/ia64/sysdep.h
> +++ b/sysdeps/unix/sysv/linux/ia64/sysdep.h
> @@ -44,12 +44,17 @@
>  #undef SYS_ify
>  #define SYS_ify(syscall_name)	__NR_##syscall_name
>  
> -#if defined USE_DL_SYSINFO \
> +#ifndef IA64_USE_NEW_STUB
> +# if defined USE_DL_SYSINFO \
>  	&& (IS_IN (libc) \
>  	    || IS_IN (libpthread) || IS_IN (librt))

I think you can drop libpthread and librt here.

> -# define IA64_USE_NEW_STUB
> -#else
> -# undef IA64_USE_NEW_STUB
> +#  define IA64_USE_NEW_STUB 1
> +# else
> +#  define IA64_USE_NEW_STUB 0
> +# endif
> +#endif
> +#if IA64_USE_NEW_STUB && !USE_DL_SYSINFO
> +# error IA64_USE_NEW_STUB needs USE_DL_SYSINFO
>  #endif
>  
>  #ifdef __ASSEMBLER__
> @@ -101,7 +106,7 @@
>  	mov r15=num;				\
>  	break __IA64_BREAK_SYSCALL
>  
> -#ifdef IA64_USE_NEW_STUB
> +#if IA64_USE_NEW_STUB
>  # ifdef SHARED
>  #  define DO_CALL(num)				\
>  	.prologue;				\
> @@ -185,7 +190,7 @@
>     (non-negative) errno on error or the return value on success.
>   */
>  
> -#ifdef IA64_USE_NEW_STUB
> +#if IA64_USE_NEW_STUB
>  
>  # define INTERNAL_SYSCALL_NCS(name, nr, args...)			      \
>  ({									      \
> @@ -277,7 +282,7 @@
>  #define ASM_OUTARGS_5	ASM_OUTARGS_4, "=r" (_out4)
>  #define ASM_OUTARGS_6	ASM_OUTARGS_5, "=r" (_out5)
>  
> -#ifdef IA64_USE_NEW_STUB
> +#if IA64_USE_NEW_STUB
>  #define ASM_ARGS_0
>  #define ASM_ARGS_1	ASM_ARGS_0, "4" (_out0)
>  #define ASM_ARGS_2	ASM_ARGS_1, "5" (_out1)
> @@ -313,7 +318,7 @@
>    /* Branch registers.  */						\
>    "b6"
>  
> -#ifdef IA64_USE_NEW_STUB
> +#if IA64_USE_NEW_STUB
>  # define ASM_CLOBBERS_6	ASM_CLOBBERS_6_COMMON
>  #else
>  # define ASM_CLOBBERS_6	ASM_CLOBBERS_6_COMMON , "b7"
> 
> base-commit: c1b68685d438373efe64e5f076f4215723004dfb

Rest look ok.
  
Florian Weimer May 4, 2022, 5:11 p.m. UTC | #2
* Adhemerval Zanella:

> On 04/05/2022 13:47, Florian Weimer wrote:
>> And keep the previous definition if it exists.  This allows
>> disabling IA64_USE_NEW_STUB while keeping USE_DL_SYSINFO defined.
>> ---
>> v2: New patch.
>>  sysdeps/unix/sysv/linux/ia64/brk.c    |  3 +--
>>  sysdeps/unix/sysv/linux/ia64/sysdep.h | 21 +++++++++++++--------
>>  2 files changed, 14 insertions(+), 10 deletions(-)
>> 
>> diff --git a/sysdeps/unix/sysv/linux/ia64/brk.c b/sysdeps/unix/sysv/linux/ia64/brk.c
>> index 65142aeae9..e1fa88f9b0 100644
>> --- a/sysdeps/unix/sysv/linux/ia64/brk.c
>> +++ b/sysdeps/unix/sysv/linux/ia64/brk.c
>> @@ -16,7 +16,6 @@
>>     License along with the GNU C Library; if not, see
>>     <https://www.gnu.org/licenses/>.  */
>>  
>> -#include <dl-sysdep.h>
>>  /* brk is used by statup before TCB is properly set.  */
>> -#undef USE_DL_SYSINFO
>> +#define IA64_USE_NEW_STUB 0
>>  #include <sysdeps/unix/sysv/linux/brk.c>
>> diff --git a/sysdeps/unix/sysv/linux/ia64/sysdep.h b/sysdeps/unix/sysv/linux/ia64/sysdep.h
>> index 193ecee023..72b72acb6f 100644
>> --- a/sysdeps/unix/sysv/linux/ia64/sysdep.h
>> +++ b/sysdeps/unix/sysv/linux/ia64/sysdep.h
>> @@ -44,12 +44,17 @@
>>  #undef SYS_ify
>>  #define SYS_ify(syscall_name)	__NR_##syscall_name
>>  
>> -#if defined USE_DL_SYSINFO \
>> +#ifndef IA64_USE_NEW_STUB
>> +# if defined USE_DL_SYSINFO \
>>  	&& (IS_IN (libc) \
>>  	    || IS_IN (libpthread) || IS_IN (librt))
>
> I think you can drop libpthread and librt here.

Will do so in v3.

Thanks,
Florian
  

Patch

diff --git a/sysdeps/unix/sysv/linux/ia64/brk.c b/sysdeps/unix/sysv/linux/ia64/brk.c
index 65142aeae9..e1fa88f9b0 100644
--- a/sysdeps/unix/sysv/linux/ia64/brk.c
+++ b/sysdeps/unix/sysv/linux/ia64/brk.c
@@ -16,7 +16,6 @@ 
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#include <dl-sysdep.h>
 /* brk is used by statup before TCB is properly set.  */
-#undef USE_DL_SYSINFO
+#define IA64_USE_NEW_STUB 0
 #include <sysdeps/unix/sysv/linux/brk.c>
diff --git a/sysdeps/unix/sysv/linux/ia64/sysdep.h b/sysdeps/unix/sysv/linux/ia64/sysdep.h
index 193ecee023..72b72acb6f 100644
--- a/sysdeps/unix/sysv/linux/ia64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/ia64/sysdep.h
@@ -44,12 +44,17 @@ 
 #undef SYS_ify
 #define SYS_ify(syscall_name)	__NR_##syscall_name
 
-#if defined USE_DL_SYSINFO \
+#ifndef IA64_USE_NEW_STUB
+# if defined USE_DL_SYSINFO \
 	&& (IS_IN (libc) \
 	    || IS_IN (libpthread) || IS_IN (librt))
-# define IA64_USE_NEW_STUB
-#else
-# undef IA64_USE_NEW_STUB
+#  define IA64_USE_NEW_STUB 1
+# else
+#  define IA64_USE_NEW_STUB 0
+# endif
+#endif
+#if IA64_USE_NEW_STUB && !USE_DL_SYSINFO
+# error IA64_USE_NEW_STUB needs USE_DL_SYSINFO
 #endif
 
 #ifdef __ASSEMBLER__
@@ -101,7 +106,7 @@ 
 	mov r15=num;				\
 	break __IA64_BREAK_SYSCALL
 
-#ifdef IA64_USE_NEW_STUB
+#if IA64_USE_NEW_STUB
 # ifdef SHARED
 #  define DO_CALL(num)				\
 	.prologue;				\
@@ -185,7 +190,7 @@ 
    (non-negative) errno on error or the return value on success.
  */
 
-#ifdef IA64_USE_NEW_STUB
+#if IA64_USE_NEW_STUB
 
 # define INTERNAL_SYSCALL_NCS(name, nr, args...)			      \
 ({									      \
@@ -277,7 +282,7 @@ 
 #define ASM_OUTARGS_5	ASM_OUTARGS_4, "=r" (_out4)
 #define ASM_OUTARGS_6	ASM_OUTARGS_5, "=r" (_out5)
 
-#ifdef IA64_USE_NEW_STUB
+#if IA64_USE_NEW_STUB
 #define ASM_ARGS_0
 #define ASM_ARGS_1	ASM_ARGS_0, "4" (_out0)
 #define ASM_ARGS_2	ASM_ARGS_1, "5" (_out1)
@@ -313,7 +318,7 @@ 
   /* Branch registers.  */						\
   "b6"
 
-#ifdef IA64_USE_NEW_STUB
+#if IA64_USE_NEW_STUB
 # define ASM_CLOBBERS_6	ASM_CLOBBERS_6_COMMON
 #else
 # define ASM_CLOBBERS_6	ASM_CLOBBERS_6_COMMON , "b7"