[v2] resolv, rt: Change some extern inline functions to static inline __always_inline
Checks
| Context |
Check |
Description |
| redhat-pt-bot/TryBot-apply_patch |
success
|
Patch applied to master at the time it was sent
|
| redhat-pt-bot/TryBot-32bit |
success
|
Build for i686
|
| redhat-pt-bot/TryBot-still_applies |
warning
|
Patch no longer applies to master
|
Commit Message
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(-)
Comments
* Peter Collingbourne:
> 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.
Well, that still results in build failures if the functions are not
inlined (though under different circumstances). The first patch was
better in that regard. Maybe we should go with that one for now, after
all.
Thanks,
Florian
On Mon, May 4, 2026 at 11:12 AM Florian Weimer <fweimer@redhat.com> wrote:
>
> * Peter Collingbourne:
>
> > 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.
>
> Well, that still results in build failures if the functions are not
> inlined (though under different circumstances).
I suppose, although I've always understood that the always_inline
inlining failure error should only happen if inlining is "impossible",
which is in principle something that's within the control of the
source code.
> The first patch was
> better in that regard. Maybe we should go with that one for now, after
> all.
I think that would be my preference. As I noted in my reply there, it
doesn't seem important whether this function is inlined.
Peter
@@ -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)
{
@@ -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;
@@ -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)
{
@@ -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)
{
@@ -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)
{