Patchwork [0/4] Fix getrlimit/setrlimit/prlimit on Alpha and 32-bit machines

login
register
mail settings
Submitter Aurelien Jarno
Date Jan. 6, 2018, 10 a.m.
Message ID <20180106100044.GA28831@aurel32.net>
Download mbox | patch
Permalink /patch/25250/
State New
Headers show

Comments

Aurelien Jarno - Jan. 6, 2018, 10 a.m.
On 2018-01-05 23:55, Joseph Myers wrote:
> One of these patches breaks the testsuite build for various (but not all) 
> 32-bit configurations.
> 
> https://sourceware.org/ml/libc-testresults/2018-q1/msg00035.html
> 
> The failures are all of the form:
> 
> /scratch/jmyers/glibc-bot/build/glibcs/arm-linux-gnueabi/glibc/io/test-lfs.o: In function `do_prepare':
> /scratch/jmyers/glibc-bot/build/glibcs/arm-linux-gnueabi/glibc-src/io/test-lfs.c:75: undefined reference to `getrlimit64'
> collect2: error: ld returned 1 exit status
> ../Rules:202: recipe for target '/scratch/jmyers/glibc-bot/build/glibcs/arm-linux-gnueabi/glibc/io/test-lfs' failed
> make[3]: *** [/scratch/jmyers/glibc-bot/build/glibcs/arm-linux-gnueabi/glibc/io/test-lfs] Error 1

Sorry about that. The issue happens on 32-bit configurations which have
a minimum version >= 2.2, and thus which don't need the 2GiB limited
compat getrlimit64. I wrongly moved one case under the #ifdef
__RLIM_T_MATCHES_RLIM64_T case, while it should have been copied
instead.

I am currently testing the following patch:

Patch

diff --git a/sysdeps/unix/sysv/linux/getrlimit64.c b/sysdeps/unix/sysv/linux/getrlimit64.c
index 1cc82e364d..a14ca58096 100644
--- a/sysdeps/unix/sysv/linux/getrlimit64.c
+++ b/sysdeps/unix/sysv/linux/getrlimit64.c
@@ -81,4 +81,7 @@  __old_getrlimit64 (enum __rlimit_resource resource, struct rlimit64 *rlimits)
 }
 versioned_symbol (libc, __getrlimit64, getrlimit64, GLIBC_2_2);
 compat_symbol (libc, __old_getrlimit64, getrlimit64, GLIBC_2_1);
+#else
+weak_alias (__getrlimit64, getrlimit64)
+libc_hidden_weak (getrlimit64)
 #endif /* __RLIM_T_MATCHES_RLIM64_T  */