[hurd,commited,4/4] hurd: Fix `getifaddrs' and `freeifaddrs' symbol exposition
Commit Message
On 9/27/17, Samuel Thibault <samuel.thibault@ens-lyon.org> wrote:
> from `freeaddrinfo'.
>
> `getifaddrs' and `freeifaddrs' are not in POSIX, they should not be
> exposed along `freeaddrinfo' (through `__check_pf') which is POSIX.
>
> * include/ifaddrs.h (__getifaddrs, __freeifaddrs): New declarations,
> and use libc_hidden_def on them.
> * inet/ifaddrs.c (__getifaddrs, __freeifaddrs): Use libc_hidden_def on
> them.
> * sysdeps/gnu/ifaddrs.c (__getifaddrs, __freeifaddrs): Likewise.
> * inet/check_pf.c (__check_pf): Use __getifaddrs and __freeifaddrs
> instead of getifaddrs and freeifaddrs.
>
I checked in this patch to fix Linux build.
Comments
Hello,
H.J. Lu, on mer. 27 sept. 2017 17:21:40 -0700, wrote:
> On 9/27/17, Samuel Thibault <samuel.thibault@ens-lyon.org> wrote:
> > from `freeaddrinfo'.
> >
> > `getifaddrs' and `freeifaddrs' are not in POSIX, they should not be
> > exposed along `freeaddrinfo' (through `__check_pf') which is POSIX.
> >
> > * include/ifaddrs.h (__getifaddrs, __freeifaddrs): New declarations,
> > and use libc_hidden_def on them.
> > * inet/ifaddrs.c (__getifaddrs, __freeifaddrs): Use libc_hidden_def on
> > them.
> > * sysdeps/gnu/ifaddrs.c (__getifaddrs, __freeifaddrs): Likewise.
> > * inet/check_pf.c (__check_pf): Use __getifaddrs and __freeifaddrs
> > instead of getifaddrs and freeifaddrs.
> >
>
> I checked in this patch to fix Linux build.
>
> ../sysdeps/unix/sysv/linux/ifaddrs.c:835:27: error: ‘getifaddrs’ aliased to undefined symbol ‘__getifaddrs’
> weak_alias (__getifaddrs, getifaddrs)
> ^
> ../sysdeps/unix/sysv/linux/ifaddrs.c:844:28: error: ‘freeifaddrs’ aliased to undefined symbol ‘__freeifaddrs’
> weak_alias (__freeifaddrs, freeifaddrs)
>
> caused by
>
> commit 4009ddc69225d571772aaea597615a0c032e14ab
Oh, sorry, I missed that the mere addition of libc_hidden_proto would
change the needs of other archs.
Thanks,
Samuel
From 7edd06916d0f18714f323b180b890f1fea39e1ff Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Wed, 27 Sep 2017 17:18:32 -0700
Subject: [PATCH] Update sysdeps/unix/sysv/linux/ifaddrs.c
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fix
../sysdeps/unix/sysv/linux/ifaddrs.c:835:27: error: ‘getifaddrs’ aliased to undefined symbol ‘__getifaddrs’
weak_alias (__getifaddrs, getifaddrs)
^
../sysdeps/unix/sysv/linux/ifaddrs.c:844:28: error: ‘freeifaddrs’ aliased to undefined symbol ‘__freeifaddrs’
weak_alias (__freeifaddrs, freeifaddrs)
caused by
commit 4009ddc69225d571772aaea597615a0c032e14ab
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Thu Sep 28 00:19:18 2017 +0200
hurd: Fix `getifaddrs' and `freeifaddrs' symbol exposition
* sysdeps/unix/sysv/linux/ifaddrs.c (__getifaddrs): Add
libc_hidden_def.
(__freeifaddrs): Likewise.
---
ChangeLog | 6 ++++++
sysdeps/unix/sysv/linux/ifaddrs.c | 2 ++
2 files changed, 8 insertions(+)
@@ -1,3 +1,9 @@
+2017-09-27 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/unix/sysv/linux/ifaddrs.c (__getifaddrs): Add
+ libc_hidden_def.
+ (__freeifaddrs): Likewise.
+
2017-09-27 Samuel Thibault <samuel.thibault@ens-lyon.org>
* include/dirent.h (__dirfd): New declaration.
@@ -833,6 +833,7 @@ __getifaddrs (struct ifaddrs **ifap)
return res;
}
weak_alias (__getifaddrs, getifaddrs)
+libc_hidden_def (__getifaddrs)
libc_hidden_weak (getifaddrs)
@@ -842,4 +843,5 @@ __freeifaddrs (struct ifaddrs *ifa)
free (ifa);
}
weak_alias (__freeifaddrs, freeifaddrs)
+libc_hidden_def (__freeifaddrs)
libc_hidden_weak (freeifaddrs)
--
2.13.5