diff mbox

statfs: fix compile error when UCLIBC_LINUX_SPECIFIC is not set

Message ID 1410047134-32263-1-git-send-email-basile@opensource.dyc.edu
State Accepted
Commit 8c57a5d9c2357dab48e80787a413f89405df1df3
Headers show

Commit Message

Anthony Basile Sept. 6, 2014, 11:45 p.m. UTC
From: "Anthony G. Basile" <blueness@gentoo.org>

statfs() is a Linux-specific function.  When building without
UCLIBC_LINUX_SPECIFIC set, libc_hidden_proto(statfs) in
include/sys/statfs.h is unmatched with libc_hidden_def(statfs)
in libc/sysdeps/linux/common/statfs.c, leading to a compile
error.  This patch fixes this, as well as adds statfs() to the
list of Linux-specific functions in extra/Configs/Config.in.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
---
 extra/Configs/Config.in            | 6 +++---
 libc/sysdeps/linux/common/statfs.c | 3 ++-
 2 files changed, 5 insertions(+), 4 deletions(-)

Comments

Bernhard Reutner-Fischer Sept. 16, 2014, 10:08 p.m. UTC | #1
On 7 September 2014 01:45,  <basile@opensource.dyc.edu> wrote:
> From: "Anthony G. Basile" <blueness@gentoo.org>
>
> statfs() is a Linux-specific function.  When building without
> UCLIBC_LINUX_SPECIFIC set, libc_hidden_proto(statfs) in
> include/sys/statfs.h is unmatched with libc_hidden_def(statfs)
> in libc/sysdeps/linux/common/statfs.c, leading to a compile
> error.  This patch fixes this, as well as adds statfs() to the
> list of Linux-specific functions in extra/Configs/Config.in.

Good point about the help-text.
Can you send me the failing .config, please?

TIA,
Anthony Basile Sept. 16, 2014, 11:22 p.m. UTC | #2
On 09/16/14 18:08, Bernhard Reutner-Fischer wrote:
> On 7 September 2014 01:45,  <basile@opensource.dyc.edu> wrote:
>> From: "Anthony G. Basile" <blueness@gentoo.org>
>>
>> statfs() is a Linux-specific function.  When building without
>> UCLIBC_LINUX_SPECIFIC set, libc_hidden_proto(statfs) in
>> include/sys/statfs.h is unmatched with libc_hidden_def(statfs)
>> in libc/sysdeps/linux/common/statfs.c, leading to a compile
>> error.  This patch fixes this, as well as adds statfs() to the
>> list of Linux-specific functions in extra/Configs/Config.in.
>
> Good point about the help-text.
> Can you send me the failing .config, please?
>
> TIA,
>

Attached is the failing config.  It dies with:

amd64-uclibc-hardened-latest uClibc # UCLIBC_ONLY=1 make check
make[2]: `lib/ld64-uClibc.so' is up to date.
   CC libc/sysdeps/linux/common/umask.os
   CC libc/sysdeps/linux/common/close.os
   CC libc/sysdeps/linux/common/__syscall_rt_sigaction.os
   CC libc/sysdeps/linux/common/longjmp.os
   CC libc/sysdeps/linux/common/statfs.os
libc/sysdeps/linux/common/statfs.c:51:1: error: '__EI_statfs' aliased to 
undefined symbol '__GI_statfs'
make[1]: *** [libc/sysdeps/linux/common/statfs.os] Error 1
make: *** [install_dir] Error 2
Bernhard Reutner-Fischer Nov. 13, 2014, 7:02 p.m. UTC | #3
On 17 September 2014 00:08, Bernhard Reutner-Fischer
<rep.dot.nop@gmail.com> wrote:
> On 7 September 2014 01:45,  <basile@opensource.dyc.edu> wrote:
>> From: "Anthony G. Basile" <blueness@gentoo.org>
>>
>> statfs() is a Linux-specific function.  When building without
>> UCLIBC_LINUX_SPECIFIC set, libc_hidden_proto(statfs) in
>> include/sys/statfs.h is unmatched with libc_hidden_def(statfs)
>> in libc/sysdeps/linux/common/statfs.c, leading to a compile
>> error.  This patch fixes this, as well as adds statfs() to the
>> list of Linux-specific functions in extra/Configs/Config.in.
>
> Good point about the help-text.
> Can you send me the failing .config, please?

Applied, thanks!
diff mbox

Patch

diff --git a/extra/Configs/Config.in b/extra/Configs/Config.in
index 7789002..cdb2cb1 100644
--- a/extra/Configs/Config.in
+++ b/extra/Configs/Config.in
@@ -1021,9 +1021,9 @@  config UCLIBC_LINUX_SPECIFIC
 	  ppoll(), readahead(), reboot(), remap_file_pages(),
 	  sched_getaffinity(), sched_setaffinity(), sendfile(),
 	  setfsgid(), setfsuid(), setresgid(), setresuid(),
-	  splice(), vmsplice(), tee(), signalfd(), swapoff(), swapon(),
-	  sync_file_range(), _sysctl(), sysinfo(), timerfd_*(), vhangup(),
-	  umount(), umount2()
+	  splice(), vmsplice(), tee(), signalfd(), statfs(),
+	  swapoff(), swapon(), sync_file_range(), _sysctl(),
+	  sysinfo(), timerfd_*(), vhangup(), umount(), umount2()
 
 config UCLIBC_HAS_GNU_ERROR
 	bool "Support GNU extensions for error-reporting"
diff --git a/libc/sysdeps/linux/common/statfs.c b/libc/sysdeps/linux/common/statfs.c
index aae4738..3dfeb0b 100644
--- a/libc/sysdeps/linux/common/statfs.c
+++ b/libc/sysdeps/linux/common/statfs.c
@@ -34,6 +34,7 @@  int __libc_statfs(const char *path, struct statfs *buf)
 # if defined __UCLIBC_LINUX_SPECIFIC__ || defined __UCLIBC_HAS_THREADS_NATIVE__
 /* statfs is used by NPTL, so it must exported in case */
 weak_alias(__libc_statfs, statfs)
+libc_hidden_def(statfs)
 # endif
 
 /* For systems which have both, prefer the old one */
@@ -45,7 +46,7 @@  _syscall2(int, __libc_statfs, const char *, path, struct statfs *, buf)
 # if defined __UCLIBC_LINUX_SPECIFIC__ || defined __UCLIBC_HAS_THREADS_NATIVE__
 /* statfs is used by NPTL, so it must exported in case */
 weak_alias(__libc_statfs, statfs)
+libc_hidden_def(statfs)
 # endif
 
 #endif
-libc_hidden_def(statfs)