From patchwork Tue Jan 2 18:34:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 854685 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-88783-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="PmD3NoSr"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zB2lb3rBVz9s9Y for ; Wed, 3 Jan 2018 05:34:19 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; q=dns; s=default; b=htiQQtSnSDJUbhpfHyIaHNc6iUgAl XbzVaKioVMYwUDT5WxnUOJJiDuabwX8XZ+cUfVGqjwUhE8hK31wswsiNRm8FXZJd dnf3xqiuanigj9zPKCzDhDIRb6jSMp4b/lTgDGw3JfAcAegFgKnqiWtF9US4bg9S +pe2Jo1MS7usAU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; s=default; bh=ZFC/L/mUL3KFhDTl4DWk+sZso20=; b=PmD 3NoSr+xDW92vHrdLByWW1SJAL06q4JNQFFD8vcq5GlcBcCi2GONWzFInk68Q1zJW 5loOHrsPnB1zxOwV95O3wZ3Krwm6r6MiqD8PPSy+waD8dQ8xWgyOMeobELS8Gjmc shOJInrb2eFzEu2hBwOzDoXoNPyr2uXRqEpdEc4o= Received: (qmail 116874 invoked by alias); 2 Jan 2018 18:34:13 -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 116860 invoked by uid 89); 2 Jan 2018 18:34:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No 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, URIBL_RED autolearn=ham version=3.3.2 spammy= X-HELO: relay1.mentorg.com Date: Tue, 2 Jan 2018 18:34:06 +0000 From: Joseph Myers To: Subject: Reduce command length in regen-ulps [committed] Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) I found that "make regen-ulps" failed when building with unmodified GNU make 4.1, and an objdir /some/where/math/ longer than about 37 characters, because the list of tests in the "for run in $^" loop exceeded the Linux kernel's MAX_ARG_STRLEN limit (131072 bytes) on the length of a single argument passed to a command. Some GNU/Linux distributions have a patch to make to work around this limit (see e.g. Debian bug 688601), but clearly this ought to work without needing such a patch. This patch arranges for the shell loop to be over the test names without a $(objdir) prefix, which reduces the space used to less than half MAX_ARG_STRLEN. (I think we ought to aim to get rid of bits/mathinline.h completely - filing GCC bugs for any optimizations GCC can't currently do with -ffast-math - which would mean we could halve the number of libm tests run because separate inline function tests would no longer be needed. However, with a long directory name even half the number of tests could make this command exceed MAX_ARG_STRLEN without my patch.) Tested regen-ulps on a system where it failed before this patch. Committed. 2018-01-02 Joseph Myers * math/Makefile (run-regen-ulps): Add $(objpfx) to test name here. (regen-ulps): Use $(libm-tests) not $^ in shell loop. diff --git a/math/Makefile b/math/Makefile index e966c98..4c8703c 100644 --- a/math/Makefile +++ b/math/Makefile @@ -521,12 +521,12 @@ include $(o-iterator) run-regen-ulps = $(test-wrapper-env) \ $(run-program-env) \ - $($*-ENV) $(rtld-prefix) $${run} + $($*-ENV) $(rtld-prefix) $(objpfx)$${run} regen-ulps: $(addprefix $(objpfx),$(libm-tests)) rm -f $(objpfx)ULPs; rm -f $(objpfx)NewUlps; \ cp $(ulps-file) $(objpfx)libm-test-ulps; \ - for run in $^; do \ + for run in $(libm-tests); do \ echo "Regenerating ULPs for $${run}"; \ $(run-regen-ulps) -u -o $(objpfx); \ cat $(objpfx)ULPs >> $(objpfx)libm-test-ulps; \