From patchwork Tue Nov 6 22:56:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 30051 Received: (qmail 40554 invoked by alias); 6 Nov 2018 22:56:24 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 40517 invoked by uid 89); 6 Nov 2018 22:56:22 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=duly X-HELO: relay1.mentorg.com Date: Tue, 6 Nov 2018 22:56:14 +0000 From: Joseph Myers To: Subject: Fix __ASSUME_MLOCK2 for ARM, MicroBlaze (bug 23867) Message-ID: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 The generic kernel-features.h defines __ASSUME_MLOCK2 for 4.4 and later kernels. However, for 32-bit ARM binaries running on 64-bit ARM kernels, and for MicroBlaze, the syscall was only wired up in the 4.7 kernel. (32-bit ARM kernels did have the syscall from 4.4 onwards.) This patch duly arranges for the macro to be undefined for those architectures for kernels before 4.7. Tested with build-many-glibcs.py for its ARM and MicroBlaze configurations. 2018-11-06 Joseph Myers [BZ #23867] * sysdeps/unix/sysv/linux/arm/kernel-features.h [__LINUX_KERNEL_VERSION < 0x040700] (__ASSUME_MLOCK2): Undefine. * sysdeps/unix/sysv/linux/microblaze/kernel-features.h [__LINUX_KERNEL_VERSION < 0x040700] (__ASSUME_MLOCK2): Undefine. diff --git a/sysdeps/unix/sysv/linux/arm/kernel-features.h b/sysdeps/unix/sysv/linux/arm/kernel-features.h index 7831ab1e0f..c6e745227c 100644 --- a/sysdeps/unix/sysv/linux/arm/kernel-features.h +++ b/sysdeps/unix/sysv/linux/arm/kernel-features.h @@ -40,5 +40,12 @@ #define __ASSUME_RECV_SYSCALL 1 #define __ASSUME_SEND_SYSCALL 1 +/* Support for the mlock2 syscall was added to the compat syscall + table for 64-bit kernels in 4.7, although present in 32-bit kernels + from 4.4. */ +#if __LINUX_KERNEL_VERSION < 0x040700 +# undef __ASSUME_MLOCK2 +#endif + #undef __ASSUME_CLONE_DEFAULT #define __ASSUME_CLONE_BACKWARDS 1 diff --git a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h index e8e2ac6a87..dfee428f49 100644 --- a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h +++ b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h @@ -58,6 +58,11 @@ # undef __ASSUME_EXECVEAT #endif +/* Support for the mlock2 syscall was added in 4.7. */ +#if __LINUX_KERNEL_VERSION < 0x040700 +# undef __ASSUME_MLOCK2 +#endif + /* Support for the copy_file_range syscall was added in 4.10. */ #if __LINUX_KERNEL_VERSION < 0x040A00 # undef __ASSUME_COPY_FILE_RANGE