diff --git a/sysdeps/unix/sysv/linux/alpha/kernel-posix-timers.h b/sysdeps/unix/sysv/linux/alpha/kernel-posix-timers.h
new file mode 100644
index 0000000000..e84dfb97e5
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/kernel-posix-timers.h
@@ -0,0 +1,22 @@
+/* POSIX timers support functionality. alpha version.
+ Copyright (C) 2021 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; see the file COPYING.LIB. If
+ not, see . */
+
+#include
+
+#undef TIMER_T_WAS_INT_COMPAT
+#define TIMER_T_WAS_INT_COMPAT 1
diff --git a/sysdeps/unix/sysv/linux/ia64/kernel-posix-timers.h b/sysdeps/unix/sysv/linux/ia64/kernel-posix-timers.h
new file mode 100644
index 0000000000..fb00698cf7
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/ia64/kernel-posix-timers.h
@@ -0,0 +1,22 @@
+/* POSIX timers support functionality. ia64 version.
+ Copyright (C) 2021 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; see the file COPYING.LIB. If
+ not, see . */
+
+#include
+
+#undef TIMER_T_WAS_INT_COMPAT
+#define TIMER_T_WAS_INT_COMPAT 1
diff --git a/sysdeps/unix/sysv/linux/kernel-posix-timers.h b/sysdeps/unix/sysv/linux/kernel-posix-timers.h
index 17fc32d48f..874b809eba 100644
--- a/sysdeps/unix/sysv/linux/kernel-posix-timers.h
+++ b/sysdeps/unix/sysv/linux/kernel-posix-timers.h
@@ -103,3 +103,7 @@ timerid_to_kernel_timer (timer_t timerid)
else
return (kernel_timer_t) ((uintptr_t) timerid);
}
+
+/* New targets use int instead of timer_t. The difference only
+ matters on 64-bit targets. */
+#define TIMER_T_WAS_INT_COMPAT 0
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/kernel-posix-timers.h b/sysdeps/unix/sysv/linux/powerpc/powerpc64/kernel-posix-timers.h
new file mode 100644
index 0000000000..718750db92
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/kernel-posix-timers.h
@@ -0,0 +1,22 @@
+/* POSIX timers support functionality. powerpc64 version.
+ Copyright (C) 2021 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; see the file COPYING.LIB. If
+ not, see . */
+
+#include
+
+#undef TIMER_T_WAS_INT_COMPAT
+#define TIMER_T_WAS_INT_COMPAT 1
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/kernel-posix-timers.h b/sysdeps/unix/sysv/linux/s390/s390-64/kernel-posix-timers.h
new file mode 100644
index 0000000000..c8870c2dc1
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/kernel-posix-timers.h
@@ -0,0 +1,22 @@
+/* POSIX timers support functionality. s390x version.
+ Copyright (C) 2021 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; see the file COPYING.LIB. If
+ not, see . */
+
+#include
+
+#undef TIMER_T_WAS_INT_COMPAT
+#define TIMER_T_WAS_INT_COMPAT 1
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/kernel-posix-timers.h b/sysdeps/unix/sysv/linux/sparc/sparc64/kernel-posix-timers.h
new file mode 100644
index 0000000000..b8485379ca
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/kernel-posix-timers.h
@@ -0,0 +1,22 @@
+/* POSIX timers support functionality. sparc64 version.
+ Copyright (C) 2021 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; see the file COPYING.LIB. If
+ not, see . */
+
+#include
+
+#undef TIMER_T_WAS_INT_COMPAT
+#define TIMER_T_WAS_INT_COMPAT 1
diff --git a/sysdeps/unix/sysv/linux/timer_create.c b/sysdeps/unix/sysv/linux/timer_create.c
index b21b0ca949..3dcd5455fc 100644
--- a/sysdeps/unix/sysv/linux/timer_create.c
+++ b/sysdeps/unix/sysv/linux/timer_create.c
@@ -25,7 +25,7 @@
#include
#include
#include
-#include "kernel-posix-timers.h"
+#include
#include "kernel-posix-cpu-timers.h"
diff --git a/sysdeps/unix/sysv/linux/timer_delete.c b/sysdeps/unix/sysv/linux/timer_delete.c
index a7a183591e..ee8c364d95 100644
--- a/sysdeps/unix/sysv/linux/timer_delete.c
+++ b/sysdeps/unix/sysv/linux/timer_delete.c
@@ -20,7 +20,7 @@
#include
#include
#include
-#include "kernel-posix-timers.h"
+#include
#ifdef timer_delete_alias
diff --git a/sysdeps/unix/sysv/linux/timer_getoverr.c b/sysdeps/unix/sysv/linux/timer_getoverr.c
index 9c7ba3acad..b997290768 100644
--- a/sysdeps/unix/sysv/linux/timer_getoverr.c
+++ b/sysdeps/unix/sysv/linux/timer_getoverr.c
@@ -19,7 +19,7 @@
#include
#include
#include
-#include "kernel-posix-timers.h"
+#include
#ifdef timer_getoverrun_alias
diff --git a/sysdeps/unix/sysv/linux/timer_gettime.c b/sysdeps/unix/sysv/linux/timer_gettime.c
index 193fe3b140..0b31324da7 100644
--- a/sysdeps/unix/sysv/linux/timer_gettime.c
+++ b/sysdeps/unix/sysv/linux/timer_gettime.c
@@ -21,7 +21,7 @@
#include
#include
#include
-#include "kernel-posix-timers.h"
+#include
int
__timer_gettime64 (timer_t timerid, struct __itimerspec64 *value)
diff --git a/sysdeps/unix/sysv/linux/timer_routines.c b/sysdeps/unix/sysv/linux/timer_routines.c
index 8d8c1a1e76..fc3aa894ab 100644
--- a/sysdeps/unix/sysv/linux/timer_routines.c
+++ b/sysdeps/unix/sysv/linux/timer_routines.c
@@ -22,7 +22,7 @@
#include
#include
#include
-#include "kernel-posix-timers.h"
+#include
/* List of active SIGEV_THREAD timers. */
diff --git a/sysdeps/unix/sysv/linux/timer_settime.c b/sysdeps/unix/sysv/linux/timer_settime.c
index f8bb16a4c2..b8326e36a4 100644
--- a/sysdeps/unix/sysv/linux/timer_settime.c
+++ b/sysdeps/unix/sysv/linux/timer_settime.c
@@ -21,7 +21,7 @@
#include
#include
#include
-#include "kernel-posix-timers.h"
+#include
int
__timer_settime64 (timer_t timerid, int flags,
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/kernel-posix-timers.h b/sysdeps/unix/sysv/linux/x86_64/64/kernel-posix-timers.h
new file mode 100644
index 0000000000..db0beb5920
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86_64/64/kernel-posix-timers.h
@@ -0,0 +1,22 @@
+/* POSIX timers support functionality. x86_64 version.
+ Copyright (C) 2021 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; see the file COPYING.LIB. If
+ not, see . */
+
+#include
+
+#undef TIMER_T_WAS_INT_COMPAT
+#define TIMER_T_WAS_INT_COMPAT 1
diff --git a/sysdeps/unix/sysv/linux/x86_64/timer_gettime.c b/sysdeps/unix/sysv/linux/x86_64/timer_gettime.c
index 3f3ae12d6b..107b1f97c7 100644
--- a/sysdeps/unix/sysv/linux/x86_64/timer_gettime.c
+++ b/sysdeps/unix/sysv/linux/x86_64/timer_gettime.c
@@ -18,7 +18,7 @@
#include
#include
-#include "kernel-posix-timers.h"
+#include
#include "compat-timer.h"
int
diff --git a/sysdeps/unix/sysv/linux/x86_64/timer_settime.c b/sysdeps/unix/sysv/linux/x86_64/timer_settime.c
index 14a05965a3..f987cd16d3 100644
--- a/sysdeps/unix/sysv/linux/x86_64/timer_settime.c
+++ b/sysdeps/unix/sysv/linux/x86_64/timer_settime.c
@@ -18,7 +18,7 @@
#include
#include
-#include "kernel-posix-timers.h"
+#include
#include "compat-timer.h"
int