diff --git a/sysdeps/unix/sysv/linux/i386/Makefile b/sysdeps/unix/sysv/linux/i386/Makefile
index da716e2c1b..983b02e081 100644
--- a/sysdeps/unix/sysv/linux/i386/Makefile
+++ b/sysdeps/unix/sysv/linux/i386/Makefile
@@ -28,22 +28,9 @@ gen-as-const-headers += ucontext_i.sym
endif
ifeq ($(subdir),csu)
-sysdep-dl-routines += sysdep
ifeq (yes,$(build-shared))
sysdep_routines += divdi3
shared-only-routines += divdi3
CPPFLAGS-divdi3.c = -Din_divdi3_c
endif
endif
-
-ifeq ($(subdir),nptl)
-# pull in __syscall_error routine
-libpthread-routines += sysdep
-libpthread-shared-only-routines += sysdep
-endif
-
-ifeq ($(subdir),rt)
-# pull in __syscall_error routine
-librt-routines += sysdep
-librt-shared-only-routines += sysdep
-endif
diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.c b/sysdeps/unix/sysv/linux/i386/sysdep.c
deleted file mode 100644
index e6228406dd..0000000000
--- a/sysdeps/unix/sysv/linux/i386/sysdep.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Copyright (C) 2015-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
- . */
-
-#include
-
-/* This routine is jumped to by all the syscall handlers, to stash
- an error number into errno. ERROR is the negative error number
- returned from the x86 kernel. */
-int
-__attribute__ ((__regparm__ (1)))
-__syscall_error (int error)
-{
- __set_errno (-error);
- return -1;
-}
diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.h b/sysdeps/unix/sysv/linux/i386/sysdep.h
index 4680013de4..977dc1ab42 100644
--- a/sysdeps/unix/sysv/linux/i386/sysdep.h
+++ b/sysdeps/unix/sysv/linux/i386/sysdep.h
@@ -19,6 +19,9 @@
#ifndef _LINUX_I386_SYSDEP_H
#define _LINUX_I386_SYSDEP_H 1
+#define SYSCALL_ERROR_FUNC
+#define SYSCALL_ERROR_FUNC_ATTR __attribute__ ((__regparm__ (1)))
+
/* There is some commonality. */
#include
#include