[v2,23/23] linux: Make SYSCALL_ERROR_FUNC as default

Message ID 20201113165837.121629-24-adhemerval.zanella@linaro.org
State Superseded
Headers
Series Simplify internal Linux syscall |

Commit Message

Adhemerval Zanella Nov. 13, 2020, 4:58 p.m. UTC
  It is the more common option overall, only alpha, ia64, mips, and
x86_64 inline the __syscall_erro call.
---
 .../unix/sysv/linux/aarch64/syscall_error.h   | 25 -------------------
 .../sysv/linux/{arm => alpha}/syscall_error.h |  4 +--
 sysdeps/unix/sysv/linux/arc/syscall_error.h   | 25 -------------------
 sysdeps/unix/sysv/linux/i386/syscall_error.h  | 25 -------------------
 .../sysv/linux/{hppa => ia64}/syscall_error.h |  4 +--
 .../sysv/linux/microblaze/syscall_error.h     | 25 -------------------
 .../sysv/linux/{m68k => mips}/syscall_error.h |  4 +--
 sysdeps/unix/sysv/linux/nios2/syscall_error.h | 25 -------------------
 .../unix/sysv/linux/powerpc/syscall_error.h   | 25 -------------------
 sysdeps/unix/sysv/linux/riscv/syscall_error.h | 25 -------------------
 sysdeps/unix/sysv/linux/sh/syscall_error.h    | 25 -------------------
 sysdeps/unix/sysv/linux/sparc/syscall_error.h | 25 -------------------
 sysdeps/unix/sysv/linux/syscall_error.h       |  4 +--
 .../linux/{csky => x86_64}/syscall_error.h    |  4 +--
 14 files changed, 10 insertions(+), 235 deletions(-)
 delete mode 100644 sysdeps/unix/sysv/linux/aarch64/syscall_error.h
 rename sysdeps/unix/sysv/linux/{arm => alpha}/syscall_error.h (90%)
 delete mode 100644 sysdeps/unix/sysv/linux/arc/syscall_error.h
 delete mode 100644 sysdeps/unix/sysv/linux/i386/syscall_error.h
 rename sysdeps/unix/sysv/linux/{hppa => ia64}/syscall_error.h (90%)
 delete mode 100644 sysdeps/unix/sysv/linux/microblaze/syscall_error.h
 rename sysdeps/unix/sysv/linux/{m68k => mips}/syscall_error.h (90%)
 delete mode 100644 sysdeps/unix/sysv/linux/nios2/syscall_error.h
 delete mode 100644 sysdeps/unix/sysv/linux/powerpc/syscall_error.h
 delete mode 100644 sysdeps/unix/sysv/linux/riscv/syscall_error.h
 delete mode 100644 sysdeps/unix/sysv/linux/sh/syscall_error.h
 delete mode 100644 sysdeps/unix/sysv/linux/sparc/syscall_error.h
 rename sysdeps/unix/sysv/linux/{csky => x86_64}/syscall_error.h (90%)
  

Comments

Adhemerval Zanella Nov. 16, 2020, 1:45 p.m. UTC | #1
On 13/11/2020 13:58, Adhemerval Zanella wrote:
> diff --git a/sysdeps/unix/sysv/linux/i386/syscall_error.h b/sysdeps/unix/sysv/linux/i386/syscall_error.h
> deleted file mode 100644
> index 0b63c07a4e..0000000000
> --- a/sysdeps/unix/sysv/linux/i386/syscall_error.h
> +++ /dev/null
> @@ -1,25 +0,0 @@
> -/* Linux wrappers for setting errno.  i386 version.
> -   Copyright (C) 2020 Free Software Foundation, Inc.
> -   This file is part of the GNU C Library.
> -
> -   The GNU C Library is free software; you can redistribute it and/or
> -   modify it under the terms of the GNU Lesser General Public
> -   License as published by the Free Software Foundation; either
> -   version 2.1 of the License, or (at your option) any later version.
> -
> -   The GNU C Library is distributed in the hope that it will be useful,
> -   but WITHOUT ANY WARRANTY; without even the implied warranty of
> -   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> -   Lesser General Public License for more details.
> -
> -   You should have received a copy of the GNU Lesser General Public
> -   License along with the GNU C Library; if not, see
> -   <https://www.gnu.org/licenses/>.  */
> -
> -#ifndef _SYSCALL_ERROR_H
> -#define _SYSCALL_ERROR_H
> -
> -#define SYSCALL_ERROR_FUNC      1
> -#define SYSCALL_ERROR_FUNC_ATTR __attribute__ ((__regparm__ (1)))
> -
> -#endif

This is wrong since some assembly routines call __syscall_error assuming
the __regparm__ (1) attribute.  This file can't be removed without changing
the assembly implementations.
  

Patch

diff --git a/sysdeps/unix/sysv/linux/aarch64/syscall_error.h b/sysdeps/unix/sysv/linux/aarch64/syscall_error.h
deleted file mode 100644
index a45e02dbe4..0000000000
--- a/sysdeps/unix/sysv/linux/aarch64/syscall_error.h
+++ /dev/null
@@ -1,25 +0,0 @@ 
-/* Linux wrappers for setting errno.  AArch64 version.
-   Copyright (C) 2020 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <https://www.gnu.org/licenses/>.  */
-
-#ifndef _SYSCALL_ERROR_H
-#define _SYSCALL_ERROR_H
-
-#define SYSCALL_ERROR_FUNC        1
-#define SYSCALL_ERROR_FUNC_ATTR
-
-#endif
diff --git a/sysdeps/unix/sysv/linux/arm/syscall_error.h b/sysdeps/unix/sysv/linux/alpha/syscall_error.h
similarity index 90%
rename from sysdeps/unix/sysv/linux/arm/syscall_error.h
rename to sysdeps/unix/sysv/linux/alpha/syscall_error.h
index 71f74e2bd3..28ca78de91 100644
--- a/sysdeps/unix/sysv/linux/arm/syscall_error.h
+++ b/sysdeps/unix/sysv/linux/alpha/syscall_error.h
@@ -1,4 +1,4 @@ 
-/* Linux wrappers for setting errno.  ARM version.
+/* Linux wrappers for setting errno.  Alpha version.
    Copyright (C) 2020 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -19,7 +19,7 @@ 
 #ifndef _SYSCALL_ERROR_H
 #define _SYSCALL_ERROR_H
 
-#define SYSCALL_ERROR_FUNC        1
+#define SYSCALL_ERROR_FUNC        0
 #define SYSCALL_ERROR_FUNC_ATTR
 
 #endif
diff --git a/sysdeps/unix/sysv/linux/arc/syscall_error.h b/sysdeps/unix/sysv/linux/arc/syscall_error.h
deleted file mode 100644
index a45e02dbe4..0000000000
--- a/sysdeps/unix/sysv/linux/arc/syscall_error.h
+++ /dev/null
@@ -1,25 +0,0 @@ 
-/* Linux wrappers for setting errno.  AArch64 version.
-   Copyright (C) 2020 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <https://www.gnu.org/licenses/>.  */
-
-#ifndef _SYSCALL_ERROR_H
-#define _SYSCALL_ERROR_H
-
-#define SYSCALL_ERROR_FUNC        1
-#define SYSCALL_ERROR_FUNC_ATTR
-
-#endif
diff --git a/sysdeps/unix/sysv/linux/i386/syscall_error.h b/sysdeps/unix/sysv/linux/i386/syscall_error.h
deleted file mode 100644
index 0b63c07a4e..0000000000
--- a/sysdeps/unix/sysv/linux/i386/syscall_error.h
+++ /dev/null
@@ -1,25 +0,0 @@ 
-/* Linux wrappers for setting errno.  i386 version.
-   Copyright (C) 2020 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <https://www.gnu.org/licenses/>.  */
-
-#ifndef _SYSCALL_ERROR_H
-#define _SYSCALL_ERROR_H
-
-#define SYSCALL_ERROR_FUNC      1
-#define SYSCALL_ERROR_FUNC_ATTR __attribute__ ((__regparm__ (1)))
-
-#endif
diff --git a/sysdeps/unix/sysv/linux/hppa/syscall_error.h b/sysdeps/unix/sysv/linux/ia64/syscall_error.h
similarity index 90%
rename from sysdeps/unix/sysv/linux/hppa/syscall_error.h
rename to sysdeps/unix/sysv/linux/ia64/syscall_error.h
index f5947ccd7c..82d37a0d35 100644
--- a/sysdeps/unix/sysv/linux/hppa/syscall_error.h
+++ b/sysdeps/unix/sysv/linux/ia64/syscall_error.h
@@ -1,4 +1,4 @@ 
-/* Linux wrappers for setting errno.  HPPA version.
+/* Linux wrappers for setting errno.  IA64 version.
    Copyright (C) 2020 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -19,7 +19,7 @@ 
 #ifndef _SYSCALL_ERROR_H
 #define _SYSCALL_ERROR_H
 
-#define SYSCALL_ERROR_FUNC        1
+#define SYSCALL_ERROR_FUNC        0
 #define SYSCALL_ERROR_FUNC_ATTR
 
 #endif
diff --git a/sysdeps/unix/sysv/linux/microblaze/syscall_error.h b/sysdeps/unix/sysv/linux/microblaze/syscall_error.h
deleted file mode 100644
index 3632dfddd7..0000000000
--- a/sysdeps/unix/sysv/linux/microblaze/syscall_error.h
+++ /dev/null
@@ -1,25 +0,0 @@ 
-/* Linux wrappers for setting errno.  Microblaze version.
-   Copyright (C) 2020 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <https://www.gnu.org/licenses/>.  */
-
-#ifndef _SYSCALL_ERROR_H
-#define _SYSCALL_ERROR_H
-
-#define SYSCALL_ERROR_FUNC        1
-#define SYSCALL_ERROR_FUNC_ATTR
-
-#endif
diff --git a/sysdeps/unix/sysv/linux/m68k/syscall_error.h b/sysdeps/unix/sysv/linux/mips/syscall_error.h
similarity index 90%
rename from sysdeps/unix/sysv/linux/m68k/syscall_error.h
rename to sysdeps/unix/sysv/linux/mips/syscall_error.h
index 4ea7cbdad5..2e3536c0ab 100644
--- a/sysdeps/unix/sysv/linux/m68k/syscall_error.h
+++ b/sysdeps/unix/sysv/linux/mips/syscall_error.h
@@ -1,4 +1,4 @@ 
-/* Linux wrappers for setting errno.  m68k version.
+/* Linux wrappers for setting errno.  MIPS version.
    Copyright (C) 2020 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -19,7 +19,7 @@ 
 #ifndef _SYSCALL_ERROR_H
 #define _SYSCALL_ERROR_H
 
-#define SYSCALL_ERROR_FUNC        1
+#define SYSCALL_ERROR_FUNC        0
 #define SYSCALL_ERROR_FUNC_ATTR
 
 #endif
diff --git a/sysdeps/unix/sysv/linux/nios2/syscall_error.h b/sysdeps/unix/sysv/linux/nios2/syscall_error.h
deleted file mode 100644
index c13958a07d..0000000000
--- a/sysdeps/unix/sysv/linux/nios2/syscall_error.h
+++ /dev/null
@@ -1,25 +0,0 @@ 
-/* Linux wrappers for setting errno.  NIOS2 version.
-   Copyright (C) 2020 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <https://www.gnu.org/licenses/>.  */
-
-#ifndef _SYSCALL_ERROR_H
-#define _SYSCALL_ERROR_H
-
-#define SYSCALL_ERROR_FUNC        1
-#define SYSCALL_ERROR_FUNC_ATTR
-
-#endif
diff --git a/sysdeps/unix/sysv/linux/powerpc/syscall_error.h b/sysdeps/unix/sysv/linux/powerpc/syscall_error.h
deleted file mode 100644
index 924f12435d..0000000000
--- a/sysdeps/unix/sysv/linux/powerpc/syscall_error.h
+++ /dev/null
@@ -1,25 +0,0 @@ 
-/* Linux wrappers for setting errno.  PowerPC version.
-   Copyright (C) 2020 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <https://www.gnu.org/licenses/>.  */
-
-#ifndef _SYSCALL_ERROR_H
-#define _SYSCALL_ERROR_H
-
-#define SYSCALL_ERROR_FUNC        1
-#define SYSCALL_ERROR_FUNC_ATTR
-
-#endif
diff --git a/sysdeps/unix/sysv/linux/riscv/syscall_error.h b/sysdeps/unix/sysv/linux/riscv/syscall_error.h
deleted file mode 100644
index 932f34aa0f..0000000000
--- a/sysdeps/unix/sysv/linux/riscv/syscall_error.h
+++ /dev/null
@@ -1,25 +0,0 @@ 
-/* Linux wrappers for setting errno.  RISCV version.
-   Copyright (C) 2020 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <https://www.gnu.org/licenses/>.  */
-
-#ifndef _SYSCALL_ERROR_H
-#define _SYSCALL_ERROR_H
-
-#define SYSCALL_ERROR_FUNC        1
-#define SYSCALL_ERROR_FUNC_ATTR
-
-#endif
diff --git a/sysdeps/unix/sysv/linux/sh/syscall_error.h b/sysdeps/unix/sysv/linux/sh/syscall_error.h
deleted file mode 100644
index 5b75619168..0000000000
--- a/sysdeps/unix/sysv/linux/sh/syscall_error.h
+++ /dev/null
@@ -1,25 +0,0 @@ 
-/* Linux wrappers for setting errno.  SH version.
-   Copyright (C) 2020 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <https://www.gnu.org/licenses/>.  */
-
-#ifndef _SYSCALL_ERROR_H
-#define _SYSCALL_ERROR_H
-
-#define SYSCALL_ERROR_FUNC        1
-#define SYSCALL_ERROR_FUNC_ATTR
-
-#endif
diff --git a/sysdeps/unix/sysv/linux/sparc/syscall_error.h b/sysdeps/unix/sysv/linux/sparc/syscall_error.h
deleted file mode 100644
index 6a9fac278a..0000000000
--- a/sysdeps/unix/sysv/linux/sparc/syscall_error.h
+++ /dev/null
@@ -1,25 +0,0 @@ 
-/* Linux wrappers for setting errno.  SPARC version.
-   Copyright (C) 2020 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <https://www.gnu.org/licenses/>.  */
-
-#ifndef _SYSCALL_ERROR_H
-#define _SYSCALL_ERROR_H
-
-#define SYSCALL_ERROR_FUNC        1
-#define SYSCALL_ERROR_FUNC_ATTR
-
-#endif
diff --git a/sysdeps/unix/sysv/linux/syscall_error.h b/sysdeps/unix/sysv/linux/syscall_error.h
index 6523eb5269..3c9737b734 100644
--- a/sysdeps/unix/sysv/linux/syscall_error.h
+++ b/sysdeps/unix/sysv/linux/syscall_error.h
@@ -20,9 +20,9 @@ 
 #define _SYSCALL_ERROR_H
 
 /* Each architecture might how __syscall_error is called, either by defining
-   an inline function (default) or by calling a hidden function.  Check the
+   an inline function or by calling a hidden function (default).  Check the
    sysdep.h file for the implementation.  */
-#define SYSCALL_ERROR_FUNC        0
+#define SYSCALL_ERROR_FUNC        1
 
 /* Any function attribute used to define the __syscall_error in case of
    __SYSCALL_ERROR_FUNC (for instance by using a different calling covention
diff --git a/sysdeps/unix/sysv/linux/csky/syscall_error.h b/sysdeps/unix/sysv/linux/x86_64/syscall_error.h
similarity index 90%
rename from sysdeps/unix/sysv/linux/csky/syscall_error.h
rename to sysdeps/unix/sysv/linux/x86_64/syscall_error.h
index dbdd6ab44f..94ae05cf58 100644
--- a/sysdeps/unix/sysv/linux/csky/syscall_error.h
+++ b/sysdeps/unix/sysv/linux/x86_64/syscall_error.h
@@ -1,4 +1,4 @@ 
-/* Linux wrappers for setting errno.  CSKY version.
+/* Linux wrappers for setting errno.  x86_64 version.
    Copyright (C) 2020 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -19,7 +19,7 @@ 
 #ifndef _SYSCALL_ERROR_H
 #define _SYSCALL_ERROR_H
 
-#define SYSCALL_ERROR_FUNC        1
+#define SYSCALL_ERROR_FUNC        0
 #define SYSCALL_ERROR_FUNC_ATTR
 
 #endif