[PATCH v2] resolv, rt: Change some extern inline functions to static inline __always_inline
Peter Collingbourne
pcc@google.com
Mon May 4 17:50:54 GMT 2026
The following functions:
__aio_create_helper_thread
__aio_start_notify_thread
__gai_create_helper_thread
__gai_start_notify_thread
are declared as extern inline, but no translation unit provides their
real definitions. This can lead to a link failure if the functions are
not inlined. Fix it by declaring them as static inline __always_inline
instead.
---
v2:
- Add __always_inline
resolv/gai_misc.c | 2 +-
rt/aio_misc.c | 2 +-
sysdeps/mach/hurd/gai_misc.h | 4 ++--
sysdeps/nptl/gai_misc.h | 4 ++--
sysdeps/unix/sysv/linux/aio_misc.h | 4 ++--
5 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/resolv/gai_misc.c b/resolv/gai_misc.c
index 5cf6d7c149..df6e5f7617 100644
--- a/resolv/gai_misc.c
+++ b/resolv/gai_misc.c
@@ -28,7 +28,7 @@
#ifndef gai_create_helper_thread
# define gai_create_helper_thread __gai_create_helper_thread
-extern inline int
+static inline __always_inline int
__gai_create_helper_thread (pthread_t *threadp, void *(*tf) (void *),
void *arg)
{
diff --git a/rt/aio_misc.c b/rt/aio_misc.c
index 724486e66f..747b7edc61 100644
--- a/rt/aio_misc.c
+++ b/rt/aio_misc.c
@@ -33,7 +33,7 @@
#ifndef aio_create_helper_thread
# define aio_create_helper_thread __aio_create_helper_thread
-extern inline int
+static inline __always_inline int
__aio_create_helper_thread (pthread_t *threadp, void *(*tf) (void *), void *arg)
{
pthread_attr_t attr;
diff --git a/sysdeps/mach/hurd/gai_misc.h b/sysdeps/mach/hurd/gai_misc.h
index 0237e59bf6..e57ff0e82a 100644
--- a/sysdeps/mach/hurd/gai_misc.h
+++ b/sysdeps/mach/hurd/gai_misc.h
@@ -22,7 +22,7 @@
#define gai_start_notify_thread __gai_start_notify_thread
#define gai_create_helper_thread __gai_create_helper_thread
-extern inline void
+static inline __always_inline void
__gai_start_notify_thread (void)
{
sigset_t ss;
@@ -32,7 +32,7 @@ __gai_start_notify_thread (void)
assert_perror (sigerr);
}
-extern inline int
+static inline __always_inline int
__gai_create_helper_thread (pthread_t *threadp, void *(*tf) (void *),
void *arg)
{
diff --git a/sysdeps/nptl/gai_misc.h b/sysdeps/nptl/gai_misc.h
index 0416e271f4..998921da92 100644
--- a/sysdeps/nptl/gai_misc.h
+++ b/sysdeps/nptl/gai_misc.h
@@ -76,7 +76,7 @@
#define gai_start_notify_thread __gai_start_notify_thread
#define gai_create_helper_thread __gai_create_helper_thread
-extern inline void
+static inline __always_inline void
__gai_start_notify_thread (void)
{
sigset_t ss;
@@ -84,7 +84,7 @@ __gai_start_notify_thread (void)
(void) __pthread_sigmask (SIG_SETMASK, &ss, NULL);
}
-extern inline int
+static inline __always_inline int
__gai_create_helper_thread (pthread_t *threadp, void *(*tf) (void *),
void *arg)
{
diff --git a/sysdeps/unix/sysv/linux/aio_misc.h b/sysdeps/unix/sysv/linux/aio_misc.h
index 578ff1cf27..d7add3c720 100644
--- a/sysdeps/unix/sysv/linux/aio_misc.h
+++ b/sysdeps/unix/sysv/linux/aio_misc.h
@@ -25,7 +25,7 @@
# define aio_start_notify_thread __aio_start_notify_thread
# define aio_create_helper_thread __aio_create_helper_thread
-extern inline void
+static inline __always_inline void
__aio_start_notify_thread (void)
{
sigset_t ss;
@@ -34,7 +34,7 @@ __aio_start_notify_thread (void)
__NSIG_BYTES);
}
-extern inline int
+static inline __always_inline int
__aio_create_helper_thread (pthread_t *threadp, void *(*tf) (void *),
void *arg)
{
--
2.54.0.545.g6539524ca2-goog
More information about the Libc-alpha
mailing list