From patchwork Tue Sep 17 22:15:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 34556 Received: (qmail 96271 invoked by alias); 17 Sep 2019 22:15:35 -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 96062 invoked by uid 89); 17 Sep 2019 22:15:29 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=53, 5.3, inclusion X-HELO: esa3.mentor.iphmx.com IronPort-SDR: jflS1NYX41c2OrA3uRpa/YQQ3gKpeWC1SDJm1Q2Gdh/ldnf0QDVrOS3J48PvHa8X0b2MwzARaD dxNZX4EifgWgs3cG9XCrZqqcYuJjKrOS0mxQCHZ53j5+qg23bU69YjDvPPaOw+KYBTsoI6BLdQ WIXxPPRlQptz36DE1SgAzOrNtHg34L9QdumJJJDKrQG/5XWCXjR45Cd7DMxcjpkts86ULmJGBc LfxiLnAZQBR71RbFHBDpPuDcMnIDyEBcO0rKdo9SRxthWZ4t2STHj3RjVF2FxoeNGK5fvdSNKW 9UM= IronPort-SDR: 7laBVEcafPFGniK71zgQetLG78qHKVG1znhvYgUgE2lJU99EWeS4G655hMh8gnWtXTJFP8RnsD DY0um27hhZZ6P+BupENkW8Jea/kvbtWtCcRLHLStwNe3lRNUidnQ9PXb6HUqwk1Lh6Dvbz+czm EIa7Ne5uH/RL0/hMQRyHPAudA/p86LH8bwbeuFsErmI7yWJ/+g0rGWTCc0v1wi/aKXw732gabw Mrlh7/hqAhqpEuwFljBF8hcP8tde09bt00AVAfHxZ6Th114hkf7zeWqqTPegRy2r524kp4Toky D+k= Date: Tue, 17 Sep 2019 22:15:09 +0000 From: Joseph Myers To: Subject: Fix RISC-V vfork build with Linux 5.3 kernel headers Message-ID: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Return-Path: joseph@codesourcery.com Building glibc for RISC-V with Linux 5.3 kernel headers fails because , included in vfork.S for CLONE_* constants, contains a structure definition not safe for inclusion in assembly code. All other architectures already avoid use of that header in vfork.S, either defining the CLONE_* constants locally or embedding the required values directly in the relevant instruction, where they implement vfork using the clone syscall (see the implementations for aarch64, ia64, mips and nios2). This patch makes the RISC-V version define the constants locally like the other architectures. Tested build for all three RISC-V configurations in build-many-glibcs.py with Linux 5.3 headers. 2019-09-17 Joseph Myers * sysdeps/unix/sysv/linux/riscv/vfork.S: Do not include . (CLONE_VM): New macro. (CLONE_VFORK): Likewise. Reviewed-by: Palmer Dabbelt diff --git a/sysdeps/unix/sysv/linux/riscv/vfork.S b/sysdeps/unix/sysv/linux/riscv/vfork.S index e68dbc7d5d..062a562e72 100644 --- a/sysdeps/unix/sysv/linux/riscv/vfork.S +++ b/sysdeps/unix/sysv/linux/riscv/vfork.S @@ -21,9 +21,12 @@ #include #include #define __ASSEMBLY__ -#include #include +#define CLONE_VM 0x00000100 /* Set if VM shared between processes. */ +#define CLONE_VFORK 0x00004000 /* Set if the parent wants the child to + wake it up on mm_release. */ + .text LEAF (__libc_vfork)