From unknown Mon Jun 23 18:33:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13472: Execution mode can hang pc when parameter refers to big file Resent-From: Pavel Raiskup Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-libtool@gnu.org Resent-Date: Thu, 17 Jan 2013 11:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 13472 X-GNU-PR-Package: libtool X-GNU-PR-Keywords: To: 13472@debbugs.gnu.org X-Debbugs-Original-To: bug-libtool@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.135842103720435 (code B ref -1); Thu, 17 Jan 2013 11:11:02 +0000 Received: (at submit) by debbugs.gnu.org; 17 Jan 2013 11:10:37 +0000 Received: from localhost ([127.0.0.1]:36266 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TvnMj-0005JY-50 for submit@debbugs.gnu.org; Thu, 17 Jan 2013 06:10:37 -0500 Received: from eggs.gnu.org ([208.118.235.92]:33050) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TvnMe-0005JP-VD for submit@debbugs.gnu.org; Thu, 17 Jan 2013 06:10:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TvnLy-0007QC-SE for submit@debbugs.gnu.org; Thu, 17 Jan 2013 06:09:52 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-106.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, USER_IN_WHITELIST autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:49779) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvnLy-0007Q6-Pb for submit@debbugs.gnu.org; Thu, 17 Jan 2013 06:09:50 -0500 Received: from eggs.gnu.org ([208.118.235.92]:44412) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvnLx-0004Fe-8M for bug-libtool@gnu.org; Thu, 17 Jan 2013 06:09:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TvnLv-0007Pj-NG for bug-libtool@gnu.org; Thu, 17 Jan 2013 06:09:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33828) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvnLv-0007Pc-FI for bug-libtool@gnu.org; Thu, 17 Jan 2013 06:09:47 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r0HB9khf006042 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 17 Jan 2013 06:09:46 -0500 Received: from [10.34.4.168] (unused-4-168.brq.redhat.com [10.34.4.168]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r0HB9jRk023081 for ; Thu, 17 Jan 2013 06:09:45 -0500 Message-ID: <1358420984.3016.2.camel@dhcp-25-209.brq.redhat.com> From: Pavel Raiskup Date: Thu, 17 Jan 2013 12:09:44 +0100 Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id r0HB9khf006042 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -4.2 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.0 (-----) Hi liboolers, the problem =E2=80=94 e.g. running the: libtool execute ls BIGfile could stack computer atm (if user has swap enabled and) if the BIGfile refers to really big file not containing new-lines. For more info see the bug: http://bugzilla.redhat.com/636045 =3D=3D=3D=3D=3D The problem is that libtool is trying to guess whether the 'BIGfile' is ltwrapper or not (I guess). One step in this check is that libtool runs sed for 'head' purposes: sed -e 4q BIGfile The problem of this sed command is that it is probably buffering whole "binary lines" (which may have gigabytes) into memory. Don't know "how" it is doing there, but 'head' utility hes _smaller_ space complexity (two runs?). Unfortunately, both sed & head could go through whole really big file and it can take too long (+ sed costs too much memory). If you see the Comment #7 in referenced bug, Paolo suggest to use 'dd' utility. It would be easy to use dd as sed's "limiter": diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in index c8cdb9c..a92b3bb 100644 --- a/build-aux/ltmain.in +++ b/build-aux/ltmain.in @@ -575,7 +575,7 @@ _LTECHO_EOF' func_lalib_p () { test -f "$1" && - $SED -e 4q "$1" 2>/dev/null \ + dd if=3D"$1" bs=3D16K count=3D1 2>/dev/null | $SED -e 4q 2>/dev/nu= ll \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } Using sed as the head utility is quite common in libtool project, probabl= y it would be fine to generalize head task that (or other) way. I am able to prepare patch if you are interested. Pavel From unknown Mon Jun 23 18:33:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13472: Execution mode can hang pc when parameter refers to big file Resent-From: Bob Friesenhahn Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-libtool@gnu.org Resent-Date: Thu, 17 Jan 2013 15:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13472 X-GNU-PR-Package: libtool X-GNU-PR-Keywords: To: Pavel Raiskup Cc: 13472@debbugs.gnu.org X-Debbugs-Original-Cc: 13472@debbugs.gnu.org, bug-libtool@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.135843665215044 (code B ref -1); Thu, 17 Jan 2013 15:31:01 +0000 Received: (at submit) by debbugs.gnu.org; 17 Jan 2013 15:30:52 +0000 Received: from localhost ([127.0.0.1]:37128 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TvrQY-0003uZ-9i for submit@debbugs.gnu.org; Thu, 17 Jan 2013 10:30:51 -0500 Received: from eggs.gnu.org ([208.118.235.92]:45368) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TvrQV-0003uS-QK for submit@debbugs.gnu.org; Thu, 17 Jan 2013 10:30:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TvrPm-0008MH-51 for submit@debbugs.gnu.org; Thu, 17 Jan 2013 10:30:05 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-101.9 required=5.0 tests=BAYES_00, USER_IN_WHITELIST autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:51647) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvrPm-0008LI-2Q for submit@debbugs.gnu.org; Thu, 17 Jan 2013 10:30:02 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56711) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvrPk-0005WC-05 for bug-libtool@gnu.org; Thu, 17 Jan 2013 10:30:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TvrPc-0008Io-00 for bug-libtool@gnu.org; Thu, 17 Jan 2013 10:29:59 -0500 Received: from blade.simplesystems.org ([65.66.246.74]:43784) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvrPb-0008Hh-O5 for bug-libtool@gnu.org; Thu, 17 Jan 2013 10:29:51 -0500 Received: from freddy.simplesystems.org (freddy.simplesystems.org [65.66.246.65]) by blade.simplesystems.org (8.14.4+Sun/8.14.4) with ESMTP id r0HFTlK1012879; Thu, 17 Jan 2013 09:29:47 -0600 (CST) Date: Thu, 17 Jan 2013 09:29:47 -0600 (CST) From: Bob Friesenhahn X-X-Sender: bfriesen@freddy.simplesystems.org In-Reply-To: <1358420984.3016.2.camel@dhcp-25-209.brq.redhat.com> Message-ID: References: <1358420984.3016.2.camel@dhcp-25-209.brq.redhat.com> User-Agent: Alpine 2.01 (GSO 1266 2009-07-14) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-559023410-1722577381-1358436587=:11141" X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (blade.simplesystems.org [65.66.246.90]); Thu, 17 Jan 2013 09:29:47 -0600 (CST) X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---559023410-1722577381-1358436587=:11141 Content-Type: TEXT/PLAIN; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by blade.simplesystems.org id r0HFTlK1012879 On Thu, 17 Jan 2013, Pavel Raiskup wrote: > Hi liboolers, > > the problem =E2=80=94 e.g. running the: > > libtool execute ls BIGfile > > could stack computer atm (if user has swap enabled and) if the BIGfile > refers to really big file not containing new-lines. > > For more info see the bug: > > http://bugzilla.redhat.com/636045 > > =3D=3D=3D=3D=3D > > The problem is that libtool is trying to guess whether the 'BIGfile' is > ltwrapper or not (I guess). One step in this check is that libtool run= s > sed for 'head' purposes: > > sed -e 4q BIGfile > > The problem of this sed command is that it is probably buffering whole > "binary lines" (which may have gigabytes) into memory. Don't know "how= " This seems like a problem even on larger machines. Executables and=20 libraries can be rather large files. If sed does absorb the whole=20 file (reading tens of megabytes, or even over 100 MB, for debug=20 builds) then there is an efficiency loss. Since libtool has a configure script, it can test for whatever=20 features are needed and provide a portable fallback in case 'dd' is=20 not available. Everything would be easier if libtool would arrange to build a small=20 helper executable in the build tree which it can used instead of=20 system tools. Libtool already builds a native executable in some=20 cases. This would diminish portability concerns and improve=20 performance. The main issue with this is that for cross-builds, a=20 system native compiler needs to be used to build the helper=20 executable. Bob --=20 Bob Friesenhahn bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen= / GraphicsMagick Maintainer, http://www.GraphicsMagick.org/ ---559023410-1722577381-1358436587=:11141-- From unknown Mon Jun 23 18:33:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13472: Execution mode can hang pc when parameter refers to big file References: <1358420984.3016.2.camel@dhcp-25-209.brq.redhat.com> Resent-From: Petr Hracek Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-libtool@gnu.org Resent-Date: Tue, 22 Jan 2013 16:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13472 X-GNU-PR-Package: libtool X-GNU-PR-Keywords: To: 13472@debbugs.gnu.org Cc: praiskup@redhat.com, bfriesen@simple.dallas.tx.us X-Debbugs-Original-To: bug-libtool@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.135887337515520 (code B ref -1); Tue, 22 Jan 2013 16:50:01 +0000 Received: (at submit) by debbugs.gnu.org; 22 Jan 2013 16:49:35 +0000 Received: from localhost ([127.0.0.1]:44858 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Txh2T-00042E-7O for submit@debbugs.gnu.org; Tue, 22 Jan 2013 11:49:35 -0500 Received: from eggs.gnu.org ([208.118.235.92]:52320) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TxfOu-0001gy-Fi for submit@debbugs.gnu.org; Tue, 22 Jan 2013 10:04:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TxfNi-0002Sl-B0 for submit@debbugs.gnu.org; Tue, 22 Jan 2013 10:03:26 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:35578) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TxfNi-0002Sh-7p for submit@debbugs.gnu.org; Tue, 22 Jan 2013 10:03:22 -0500 Received: from eggs.gnu.org ([208.118.235.92]:35389) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TxfNa-0003jW-ME for bug-libtool@gnu.org; Tue, 22 Jan 2013 10:03:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TxfNS-0002MY-PY for bug-libtool@gnu.org; Tue, 22 Jan 2013 10:03:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:16139) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TxfNS-0002MA-IJ for bug-libtool@gnu.org; Tue, 22 Jan 2013 10:03:06 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r0MF35LZ006098 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 22 Jan 2013 10:03:05 -0500 Received: from [10.34.4.190] (unused-4-190.brq.redhat.com [10.34.4.190]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r0MF330e003417; Tue, 22 Jan 2013 10:03:03 -0500 Message-ID: <1358866982.23347.6.camel@unused-4-190.brq.redhat.com> From: Petr Hracek Date: Tue, 22 Jan 2013 16:03:02 +0100 In-Reply-To: alpine.GSO.2.01.1301170921030.11141@freddy.simplesystems.org Organization: Red Hat s.r.o. Content-Type: multipart/mixed; boundary="=-bTBLUJLE4UHVXnYSR81N" Mime-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -4.2 (----) X-Mailman-Approved-At: Tue, 22 Jan 2013 11:49:31 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) --=-bTBLUJLE4UHVXnYSR81N Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Hello Bob, I have created simple helper binary which can be replaced with sed in case that dd is not available. Patch is in attachment including new c source file. best regards Petr -- Greetings, Petr Hracek BaseOS Core Services Brno --=-bTBLUJLE4UHVXnYSR81N Content-Disposition: attachment; filename="helper_dd.patch" Content-Type: text/x-patch; name="helper_dd.patch"; charset="UTF-8" Content-Transfer-Encoding: 7bit diff --git a/Makefile.am b/Makefile.am index a3e3c7d..c29373b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -464,6 +464,7 @@ pkgltdl_files = COPYING.LIB \ loaders/loadlibrary.c \ loaders/preopen.c \ loaders/shl_load.c \ + loaders/load_head.c \ lt__alloc.c \ lt__dirent.c \ lt__strl.c \ diff --git a/bootstrap b/bootstrap index 9c7c01f..44681b3 100755 --- a/bootstrap +++ b/bootstrap @@ -154,6 +154,7 @@ fi : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} +: ${DD="/bin/dd"} : ${SED="sed"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in index c8cdb9c..750f34e 100644 --- a/build-aux/ltmain.in +++ b/build-aux/ltmain.in @@ -575,7 +575,7 @@ _LTECHO_EOF' func_lalib_p () { test -f "$1" && - $SED -e 4q "$1" 2>/dev/null \ + if [ -x "$DD" ]; then $DD if=$1 bs=16K count=1 2>/dev/null; else load_head $1 2>/dev/null; fi \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } diff --git a/libltdl/loaders/load_head.c b/libltdl/loaders/load_head.c new file mode 100644 index 0000000..f0835d4 --- /dev/null +++ b/libltdl/loaders/load_head.c @@ -0,0 +1,68 @@ +/* loader-loadlibrary.c -- dynamic linking for Win32 + + Copyright (C) 1998-2000, 2004-2008, 2010-2013 Free Software + Foundation, Inc. + Written by Thomas Tanner, 1998 + + NOTE: The canonical source of this file is maintained with the + GNU Libtool package. Report bugs to bug-libtool@gnu.org. + +GNU Libltdl is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +As a special exception to the GNU Lesser General Public License, +if you distribute this file as part of a program or library that +is built using GNU Libtool, you may include this file under the +same distribution terms that you use for the rest of that program. + +GNU Libltdl is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with GNU Libltdl; see the file COPYING.LIB. If not, a +copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, +or obtained by writing to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#define MAX_SIZE 16384 +int main(int argc, char * argv[]) +{ + unsigned char buffer[MAX_SIZE]; + FILE * pFile; + int n=0; + + if(argc < 2) + { + printf("Filename as argument is missing\n"); + exit(1); + } + if(argc > 2) + { + printf("There is a lot of arguments. Only filename is allowed\n"); + exit(1); + } + pFile = fopen(argv[1],"r"); + if(pFile == NULL) + { + printf("Problem with openning file %s\n",argv[1]); + exit(1); + } + n = fread(buffer,1,MAX_SIZE,pFile); + if(n==0) + { + printf("Problem with reading file\n"); + exit(1); + } + printf("%s",buffer); + fclose(pFile); + exit (0); + +} --=-bTBLUJLE4UHVXnYSR81N-- From unknown Mon Jun 23 18:33:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13472: Execution mode can hang pc when parameter refers to big file Resent-From: Peter Rosin Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-libtool@gnu.org Resent-Date: Tue, 29 Jan 2013 14:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13472 X-GNU-PR-Package: libtool X-GNU-PR-Keywords: To: Bob Friesenhahn Cc: Pavel Raiskup , 13472@debbugs.gnu.org Received: via spool by 13472-submit@debbugs.gnu.org id=B13472.135947062818825 (code B ref 13472); Tue, 29 Jan 2013 14:44:02 +0000 Received: (at 13472) by debbugs.gnu.org; 29 Jan 2013 14:43:48 +0000 Received: from localhost ([127.0.0.1]:53927 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U0CPa-0004tZ-Ek for submit@debbugs.gnu.org; Tue, 29 Jan 2013 09:43:47 -0500 Received: from mail.lysator.liu.se ([130.236.254.3]:59852) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U0CPU-0004tM-3i for 13472@debbugs.gnu.org; Tue, 29 Jan 2013 09:43:42 -0500 Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id E0FA040007; Tue, 29 Jan 2013 15:43:07 +0100 (CET) Received: from [192.168.0.64] (90-227-119-137-no95.business.telia.com [90.227.119.137]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 1337D40004; Tue, 29 Jan 2013 15:43:06 +0100 (CET) Message-ID: <5107DFFA.4070706@lysator.liu.se> Date: Tue, 29 Jan 2013 15:43:06 +0100 From: Peter Rosin User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 References: <1358420984.3016.2.camel@dhcp-25-209.brq.redhat.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.3 (/) Hi Bob, On 2013-01-17 16:29, Bob Friesenhahn wrote: > Everything would be easier if libtool would arrange to build a small helper > executable in the build tree which it can used instead of system tools. > Libtool already builds a native executable in some cases. This would > diminish portability concerns and improve performance. The main issue > with this is that for cross-builds, a system native compiler needs to be > used to build the helper executable. Forgive me for my ignorance, but when does libtool build something with the $build compiler in the cross case? The only thing I can find that looks like an alternative compiler is $LTCC, but that's just another name for the normal $host C compiler. What am I missing? Cheers, Peter From unknown Mon Jun 23 18:33:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13472: Execution mode can hang pc when parameter refers to big file Resent-From: Bob Friesenhahn Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-libtool@gnu.org Resent-Date: Tue, 29 Jan 2013 15:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13472 X-GNU-PR-Package: libtool X-GNU-PR-Keywords: To: Peter Rosin Cc: Pavel Raiskup , 13472@debbugs.gnu.org Received: via spool by 13472-submit@debbugs.gnu.org id=B13472.135947345323344 (code B ref 13472); Tue, 29 Jan 2013 15:31:01 +0000 Received: (at 13472) by debbugs.gnu.org; 29 Jan 2013 15:30:53 +0000 Received: from localhost ([127.0.0.1]:54539 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U0D9A-00064T-LI for submit@debbugs.gnu.org; Tue, 29 Jan 2013 10:30:53 -0500 Received: from blade.simplesystems.org ([65.66.246.74]:45594) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U0D94-00064B-Nx for 13472@debbugs.gnu.org; Tue, 29 Jan 2013 10:30:51 -0500 Received: from freddy.simplesystems.org (freddy.simplesystems.org [65.66.246.65]) by blade.simplesystems.org (8.14.4+Sun/8.14.4) with ESMTP id r0TFU7IY009516; Tue, 29 Jan 2013 09:30:07 -0600 (CST) Date: Tue, 29 Jan 2013 09:30:07 -0600 (CST) From: Bob Friesenhahn X-X-Sender: bfriesen@freddy.simplesystems.org In-Reply-To: <5107DFFA.4070706@lysator.liu.se> Message-ID: References: <1358420984.3016.2.camel@dhcp-25-209.brq.redhat.com> <5107DFFA.4070706@lysator.liu.se> User-Agent: Alpine 2.01 (GSO 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (blade.simplesystems.org [65.66.246.90]); Tue, 29 Jan 2013 09:30:08 -0600 (CST) X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) On Tue, 29 Jan 2013, Peter Rosin wrote: > Hi Bob, > > On 2013-01-17 16:29, Bob Friesenhahn wrote: >> Everything would be easier if libtool would arrange to build a small helper >> executable in the build tree which it can used instead of system tools. >> Libtool already builds a native executable in some cases. This would >> diminish portability concerns and improve performance. The main issue >> with this is that for cross-builds, a system native compiler needs to be >> used to build the helper executable. > > Forgive me for my ignorance, but when does libtool build something with > the $build compiler in the cross case? The only thing I can find that > looks like an alternative compiler is $LTCC, but that's just another > name for the normal $host C compiler. What am I missing? As I recall, libtool builds an execution test wrapper for a Windows native build. It would (should) not do that for a cross-build. However, the C test wrapper was written using portable interfaces so it could compile under POSIX (even if we don't currently do that). Autoconf/libtool in general does not seem to support the notion of supporting both a cross-compiler for the target and a native compiler for producing programs supporting the build, or remote/emulated testing of the "target". If this hurdle was solved in a clean way, then many implementation opportunities would appear. Bob -- Bob Friesenhahn bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/ GraphicsMagick Maintainer, http://www.GraphicsMagick.org/ From unknown Mon Jun 23 18:33:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13472: Execution mode can hang pc when parameter refers to big file Resent-From: Peter Rosin Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-libtool@gnu.org Resent-Date: Tue, 29 Jan 2013 16:05:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13472 X-GNU-PR-Package: libtool X-GNU-PR-Keywords: To: Bob Friesenhahn Cc: Pavel Raiskup , 13472@debbugs.gnu.org Received: via spool by 13472-submit@debbugs.gnu.org id=B13472.135947548826356 (code B ref 13472); Tue, 29 Jan 2013 16:05:04 +0000 Received: (at 13472) by debbugs.gnu.org; 29 Jan 2013 16:04:48 +0000 Received: from localhost ([127.0.0.1]:54554 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U0Dfz-0006r3-JF for submit@debbugs.gnu.org; Tue, 29 Jan 2013 11:04:48 -0500 Received: from mail.lysator.liu.se ([130.236.254.3]:60300) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U0Dfy-0006qv-5c for 13472@debbugs.gnu.org; Tue, 29 Jan 2013 11:04:47 -0500 Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 5ECCB4000A; Tue, 29 Jan 2013 17:04:13 +0100 (CET) Received: from [192.168.0.64] (90-227-119-137-no95.business.telia.com [90.227.119.137]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 986D140007; Tue, 29 Jan 2013 17:04:12 +0100 (CET) Message-ID: <5107F2FB.50103@lysator.liu.se> Date: Tue, 29 Jan 2013 17:04:11 +0100 From: Peter Rosin User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 References: <1358420984.3016.2.camel@dhcp-25-209.brq.redhat.com> <5107DFFA.4070706@lysator.liu.se> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.4 (--) On 2013-01-29 16:30, Bob Friesenhahn wrote: > On Tue, 29 Jan 2013, Peter Rosin wrote: >> On 2013-01-17 16:29, Bob Friesenhahn wrote: >>> Everything would be easier if libtool would arrange to build a small helper >>> executable in the build tree which it can used instead of system tools. >>> Libtool already builds a native executable in some cases. This would >>> diminish portability concerns and improve performance. The main issue >>> with this is that for cross-builds, a system native compiler needs to be >>> used to build the helper executable. >> >> Forgive me for my ignorance, but when does libtool build something with >> the $build compiler in the cross case? The only thing I can find that >> looks like an alternative compiler is $LTCC, but that's just another >> name for the normal $host C compiler. What am I missing? > > As I recall, libtool builds an execution test wrapper for a Windows native > build. It would (should) not do that for a cross-build. However, the C > test wrapper was written using portable interfaces so it could compile > under POSIX (even if we don't currently do that). The cwrapper compiles under POSIX because it is needed on Cygwin and it compiles under Win32 because it is needed on MinGW. The cwrapper is compiled with $LTCC, i.e. the standard $host C compiler. > Autoconf/libtool in general does not seem to support the notion of > supporting both a cross-compiler for the target and a native compiler for > producing programs supporting the build, or remote/emulated testing of > the "target". If this hurdle was solved in a clean way, then many > implementation opportunities would appear. Agreed. The conclusion is that there is no existing infrastructure for building helper executables in libtool. BTW, here's an alternative to "dd if="$1" bs=16K count=1" od -bvN 16K "$1" | sed 's/^[^ ]*//;/^ *$/d;s/ */\\\\/g' | while read l; do printf $l; done Sadly "od -bvN" isn't portable, an alternative seems to be "hexdump -bvn". Cheers, Peter From unknown Mon Jun 23 18:33:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13472: Execution mode can hang pc when parameter refers to big file Resent-From: Roumen Petrov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-libtool@gnu.org Resent-Date: Tue, 29 Jan 2013 20:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13472 X-GNU-PR-Package: libtool X-GNU-PR-Keywords: To: 13472@debbugs.gnu.org Cc: Pavel Raiskup , Peter Rosin , Bob Friesenhahn Received: via spool by 13472-submit@debbugs.gnu.org id=B13472.135949076217141 (code B ref 13472); Tue, 29 Jan 2013 20:20:02 +0000 Received: (at 13472) by debbugs.gnu.org; 29 Jan 2013 20:19:22 +0000 Received: from localhost ([127.0.0.1]:54682 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U0HeL-0004SP-Rj for submit@debbugs.gnu.org; Tue, 29 Jan 2013 15:19:22 -0500 Received: from rila.superhosting.bg ([91.196.124.212]:54780) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U0HeI-0004SH-Jw for 13472@debbugs.gnu.org; Tue, 29 Jan 2013 15:19:20 -0500 Received: from [78.128.48.21] (port=51869 helo=[192.168.0.10]) by rila.superhosting.bg with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.80) (envelope-from ) id 1U0Hdi-0035RL-GC; Tue, 29 Jan 2013 22:18:42 +0200 Message-ID: <51082EA2.7000307@roumenpetrov.info> Date: Tue, 29 Jan 2013 22:18:42 +0200 From: Roumen Petrov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0 SeaMonkey/2.15.1 MIME-Version: 1.0 References: <1358420984.3016.2.camel@dhcp-25-209.brq.redhat.com> <5107DFFA.4070706@lysator.liu.se> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - rila.superhosting.bg X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roumenpetrov.info X-Get-Message-Sender-Via: rila.superhosting.bg: authenticated_id: master78@roumenpetrov.info X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: 0.8 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.5 (/) Bob Friesenhahn wrote: > On Tue, 29 Jan 2013, Peter Rosin wrote: > >> Hi Bob, >> >> On 2013-01-17 16:29, Bob Friesenhahn wrote: >>> Everything would be easier if libtool would arrange to build a small >>> helper >>> executable in the build tree which it can used instead of system tools. >>> Libtool already builds a native executable in some cases. This would >>> diminish portability concerns and improve performance. The main issue >>> with this is that for cross-builds, a system native compiler needs >>> to be >>> used to build the helper executable. >> >> Forgive me for my ignorance, but when does libtool build something with >> the $build compiler in the cross case? The only thing I can find that >> looks like an alternative compiler is $LTCC, but that's just another >> name for the normal $host C compiler. What am I missing? > > As I recall, libtool builds an execution test wrapper for a Windows > native build. It would (should) not do that for a cross-build. > However, the C test wrapper was written using portable interfaces so > it could compile under POSIX (even if we don't currently do that). In windows case I would like to disagree. this is a way to run test in emulated environment. Build system run in emulator a native executable (libtool wrapper executable) , then wrapper set environment and spawn real executable. This is specific for this case and know emulator. I would like to inform you that shell-wrapper from pre-libtool 2(.2?) era can not be used in this case. May be I misunderstand you idea . Please detail you case. > [SNIP] > > Bob Roumen From unknown Mon Jun 23 18:33:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13472: [PATCH 0/1] Execution mode can hang pc when parameter refers to big file Resent-From: Pavel Raiskup Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-libtool@gnu.org Resent-Date: Thu, 25 Apr 2013 11:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13472 X-GNU-PR-Package: libtool X-GNU-PR-Keywords: To: 13472@debbugs.gnu.org Cc: peda@lysator.liu.se, bfriesen@simple.dallas.tx.us Received: via spool by 13472-submit@debbugs.gnu.org id=B13472.13668908393673 (code B ref 13472); Thu, 25 Apr 2013 11:54:02 +0000 Received: (at 13472) by debbugs.gnu.org; 25 Apr 2013 11:53:59 +0000 Received: from localhost ([127.0.0.1]:42439 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UVKkR-0000xA-6H for submit@debbugs.gnu.org; Thu, 25 Apr 2013 07:53:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1597) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UVKkN-0000wn-Ei for 13472@debbugs.gnu.org; Thu, 25 Apr 2013 07:53:56 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3PBmkst017420 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 25 Apr 2013 07:48:46 -0400 Received: from praiskup.usersys.redhat.com (unused-4-121.brq.redhat.com [10.34.4.121]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r3PBmiju008007; Thu, 25 Apr 2013 07:48:45 -0400 Received: by praiskup.usersys.redhat.com (Postfix, from userid 1000) id 1E8FCE1AB4; Thu, 25 Apr 2013 13:48:44 +0200 (CEST) From: Pavel Raiskup Date: Thu, 25 Apr 2013 13:48:34 +0200 Message-Id: <1366890515-6388-1-git-send-email-praiskup@redhat.com> In-Reply-To: <5107F2FB.50103@lysator.liu.se> References: <5107F2FB.50103@lysator.liu.se> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id r3PBmkst017420 X-Spam-Score: -4.2 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) Hi, sorry for the delay, here comes my (quite simple) proposal, >> Autoconf/libtool in general does not seem to support the notion of >> supporting both a cross-compiler for the target and a native compiler = for >> producing programs supporting the build, or remote/emulated testing of >> the "target". If this hurdle was solved in a clean way, then many >> implementation opportunities would appear. > > Agreed. > > The conclusion is that there is no existing infrastructure for building > helper executables in libtool. this idea is not included, sadly - I'm unable to provide enough error prone solution and design such architecture. > BTW, here's an alternative to "dd if=3D"$1" bs=3D16K count=3D1" > > od -bvN 16K "$1" | > sed 's/^[^ ]*//;/^ *$/d;s/ */\\\\/g' | > while read l; do printf $l; done > > Sadly "od -bvN" isn't portable, an alternative seems to be "hexdump -bv= n". Thanks for this suggestion! I was thinking about it and it looks that the 'dd' utility should be enough portable for POSIX systems as it will be used with basic arguments. And if the 'dd' is not found, no so big issue happens; libtool has the same behaviour as before =E2=80=94 read the whole file. Anyway, use of 'hexdump' or 'od' (which is at least on linux usually part of coreutils (same as dd)) may easily be incorporated when necessary whic= h will cost just another one bash if-branch. [PATCH] libtool: speed up by pre-cutting sed's input by dd Pavel From unknown Mon Jun 23 18:33:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13472: [PATCH] libtool: speed up by pre-cutting sed's input by dd Resent-From: Pavel Raiskup Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-libtool@gnu.org Resent-Date: Thu, 25 Apr 2013 11:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13472 X-GNU-PR-Package: libtool X-GNU-PR-Keywords: To: 13472@debbugs.gnu.org Cc: peda@lysator.liu.se, bfriesen@simple.dallas.tx.us Received: via spool by 13472-submit@debbugs.gnu.org id=B13472.13668908403678 (code B ref 13472); Thu, 25 Apr 2013 11:54:02 +0000 Received: (at 13472) by debbugs.gnu.org; 25 Apr 2013 11:54:00 +0000 Received: from localhost ([127.0.0.1]:42441 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UVKkR-0000xD-MN for submit@debbugs.gnu.org; Thu, 25 Apr 2013 07:54:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:64394) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UVKkN-0000wm-Ef for 13472@debbugs.gnu.org; Thu, 25 Apr 2013 07:53:57 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3PBmkL8027417 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 25 Apr 2013 07:48:46 -0400 Received: from praiskup.usersys.redhat.com (unused-4-121.brq.redhat.com [10.34.4.121]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r3PBmiIU006938; Thu, 25 Apr 2013 07:48:45 -0400 Received: by praiskup.usersys.redhat.com (Postfix, from userid 1000) id 2F556E09E4; Thu, 25 Apr 2013 13:48:44 +0200 (CEST) From: Pavel Raiskup Date: Thu, 25 Apr 2013 13:48:35 +0200 Message-Id: <1366890515-6388-2-git-send-email-praiskup@redhat.com> In-Reply-To: <1366890515-6388-1-git-send-email-praiskup@redhat.com> References: <5107F2FB.50103@lysator.liu.se> <1366890515-6388-1-git-send-email-praiskup@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) The execute mode was too slow when any parameter of executed command was a big binary file not having any newlines inside: $ libtool --mode=execute ls BIG_FILE_WITHOUT_NEWLINES This was because of the lalib detection among parameters. Every such file is pre-filtered by sed uitlity. That big slowdown is there because the sed utility tries to read and cache _unlimitedly_ the first four lines of these files. The new approach is pre-cutting relevant files by dd utility at 4kB size. * build-aux/ltmain.in (func_try_sizelim): New function. (func_lalib_p): Cut the input file at 4kB before it is passed to sed utility. * gl/build-aux/funclib.sh: New variable $DD. * m4/libtool.m4 (_LT_PROG_DD): New macro. (_LT_SETUP): Require _LT_PROG_DD for the dd detection. --- build-aux/ltmain.in | 14 +++++++++++++- gl/build-aux/funclib.sh | 1 + m4/libtool.m4 | 14 ++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in index 4c56b98..4a21b58 100644 --- a/build-aux/ltmain.in +++ b/build-aux/ltmain.in @@ -568,6 +568,18 @@ $1 _LTECHO_EOF' } +# func_try_sizelim file n +# try to write at most the first N bytes from FILE to the standard output when +# possible, otherwise put whole file +func_try_sizelim () +{ + if [ -n "$DD" ]; then + $DD if="$1" bs=$2 count=1 2>/dev/null + else + cat "$1" + fi +} + # func_lalib_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function is only a basic sanity check; it will hardly flush out @@ -575,7 +587,7 @@ _LTECHO_EOF' func_lalib_p () { test -f "$1" && - $SED -e 4q "$1" 2>/dev/null \ + func_try_sizelim "$1" 4096 | $SED -e 4q 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } diff --git a/gl/build-aux/funclib.sh b/gl/build-aux/funclib.sh index 8a212d1..ff9680d 100644 --- a/gl/build-aux/funclib.sh +++ b/gl/build-aux/funclib.sh @@ -135,6 +135,7 @@ fi # in the command search PATH. : ${CP="cp -f"} +: ${DD="$LTDD"} : ${ECHO="$bs_echo"} : ${EGREP="grep -E"} : ${FGREP="grep -F"} diff --git a/m4/libtool.m4 b/m4/libtool.m4 index 3f50b0c..7fa3d9b 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -175,6 +175,7 @@ m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl +m4_require([_LT_PROG_DD])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our @@ -898,6 +899,19 @@ dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) +# _LT_PROG_DD +# ----------- +# Try to find dd program and set the $LTDD variable to point to it, otherwise +# set the $LTDD variable to be empty. +m4_defun([_LT_PROG_DD],[ +m4_require([_LT_DECL_DLLTOOL]) +LTDD=dd +$LTDD if=/dev/zero of=/dev/null bs=1 count=16K >/dev/null 2>/dev/null +test $? -ne 0 && LTDD= +_LT_DECL([], [LTDD], [1], [The dd program])dnl +]) # _LT_PROG_DD + + # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], -- 1.8.1.4 From unknown Mon Jun 23 18:33:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13472: [PATCH] libtool: speed up by pre-cutting sed's input by dd Resent-From: Pavel Raiskup Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-libtool@gnu.org Resent-Date: Mon, 29 Apr 2013 06:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13472 X-GNU-PR-Package: libtool X-GNU-PR-Keywords: To: 13472@debbugs.gnu.org Cc: peda@lysator.liu.se X-Debbugs-Original-To: bug-libtool@gnu.org X-Debbugs-Original-Cc: peda@lysator.liu.se, 13472@debbugs.gnu.org Received: via spool by 13472-submit@debbugs.gnu.org id=B13472.136721750328953 (code B ref 13472); Mon, 29 Apr 2013 06:39:02 +0000 Received: (at 13472) by debbugs.gnu.org; 29 Apr 2013 06:38:23 +0000 Received: from localhost ([127.0.0.1]:49388 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UWhjB-0007Wu-Ib for submit@debbugs.gnu.org; Mon, 29 Apr 2013 02:38:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46463) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UWhiy-0007WA-Ok for 13472@debbugs.gnu.org; Mon, 29 Apr 2013 02:38:16 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3T6bp5F013561 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 29 Apr 2013 02:37:51 -0400 Received: from unused-4-121.brq.redhat.com (unused-4-121.brq.redhat.com [10.34.4.121]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r3T6bncD026675; Mon, 29 Apr 2013 02:37:50 -0400 From: Pavel Raiskup Date: Mon, 29 Apr 2013 08:37:49 +0200 Message-ID: <683610949.2m6zIZog4y@unused-4-121.brq.redhat.com> User-Agent: KMail/4.10.2 (Linux/3.8.8-202.fc18.x86_64; KDE/4.10.2; x86_64; ; ) In-Reply-To: <1366890515-6388-2-git-send-email-praiskup@redhat.com> References: <5107F2FB.50103@lysator.liu.se> <1366890515-6388-1-git-send-email-praiskup@redhat.com> <1366890515-6388-2-git-send-email-praiskup@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Spam-Score: -9.3 (---------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -9.3 (---------) Ping & update :), Pavel > +# func_try_sizelim file n > +# try to write at most the first N bytes from FILE to the standard output when > +# possible, otherwise put whole file > +func_try_sizelim () > +{ > + if [ -n "$DD" ]; then Here should be 'test' rather than '['. > + $DD if="$1" bs=$2 count=1 2>/dev/null > + else > + cat "$1" If the file is not readable (and possibly other?) ~> 2>/dev/null > + fi > +} I found that the first indentation is 4 spaces.. > # func_lalib_p file > # True iff FILE is a libtool '.la' library or '.lo' object file. > # This function is only a basic sanity check; it will hardly flush out > @@ -575,7 +587,7 @@ _LTECHO_EOF' > func_lalib_p () > { > test -f "$1" && > - $SED -e 4q "$1" 2>/dev/null \ > + func_try_sizelim "$1" 4096 | $SED -e 4q 2>/dev/null \ Fixed indent. > | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 > } ------------------------------------------------------------------------------ >From 38d952a1378e58655fba7cdb1e7f8edcd052e3ec Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Thu, 25 Apr 2013 10:24:33 +0200 Subject: [PATCH] libtool: speed up by pre-cutting sed's input by dd The execute mode was too slow when any parameter of executed command was a big binary file not having any newlines inside: $ libtool --mode=execute ls BIG_FILE_WITHOUT_NEWLINES This was because of the lalib detection among parameters. Every such file is pre-filtered by sed uitlity. That big slowdown is there because the sed utility tries to read and cache _unlimitedly_ the first four lines of these files. The new approach is pre-cutting relevant files by dd utility at 4kB size. * build-aux/ltmain.in (func_try_sizelim): New function. (func_lalib_p): Cut the input file at 4kB before it is passed to sed utility. * gl/build-aux/funclib.sh: New variable $DD. * m4/libtool.m4 (_LT_PROG_DD): New macro. (_LT_SETUP): Require _LT_PROG_DD for the dd detection. --- build-aux/ltmain.in | 14 +++++++++++++- gl/build-aux/funclib.sh | 1 + m4/libtool.m4 | 14 ++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in index 4c56b98..60d7192 100644 --- a/build-aux/ltmain.in +++ b/build-aux/ltmain.in @@ -568,6 +568,18 @@ $1 _LTECHO_EOF' } +# func_try_sizelim file n +# try to write at most the first N bytes from FILE to the standard output when +# possible, otherwise put whole file +func_try_sizelim () +{ + if test -n "$DD"; then + $DD if="$1" bs=$2 count=1 2>/dev/null + else + cat "$1" 2>/dev/null + fi +} + # func_lalib_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function is only a basic sanity check; it will hardly flush out @@ -575,7 +587,7 @@ _LTECHO_EOF' func_lalib_p () { test -f "$1" && - $SED -e 4q "$1" 2>/dev/null \ + func_try_sizelim "$1" 4096 | $SED -e 4q 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } diff --git a/gl/build-aux/funclib.sh b/gl/build-aux/funclib.sh index 8a212d1..ff9680d 100644 --- a/gl/build-aux/funclib.sh +++ b/gl/build-aux/funclib.sh @@ -135,6 +135,7 @@ fi # in the command search PATH. : ${CP="cp -f"} +: ${DD="$LTDD"} : ${ECHO="$bs_echo"} : ${EGREP="grep -E"} : ${FGREP="grep -F"} diff --git a/m4/libtool.m4 b/m4/libtool.m4 index 3f50b0c..7fa3d9b 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -175,6 +175,7 @@ m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl +m4_require([_LT_PROG_DD])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our @@ -898,6 +899,19 @@ dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) +# _LT_PROG_DD +# ----------- +# Try to find dd program and set the $LTDD variable to point to it, otherwise +# set the $LTDD variable to be empty. +m4_defun([_LT_PROG_DD],[ +m4_require([_LT_DECL_DLLTOOL]) +LTDD=dd +$LTDD if=/dev/zero of=/dev/null bs=1 count=16K >/dev/null 2>/dev/null +test $? -ne 0 && LTDD= +_LT_DECL([], [LTDD], [1], [The dd program])dnl +]) # _LT_PROG_DD + + # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], -- 1.8.1.4 From unknown Mon Jun 23 18:33:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13472: [PATCH] libtool: speed up by pre-cutting sed's input by dd Resent-From: Pavel Raiskup Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-libtool@gnu.org Resent-Date: Mon, 13 May 2013 12:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13472 X-GNU-PR-Package: libtool X-GNU-PR-Keywords: To: 13472@debbugs.gnu.org Cc: peda@lysator.liu.se X-Debbugs-Original-To: bug-libtool@gnu.org X-Debbugs-Original-Cc: peda@lysator.liu.se, 13472@debbugs.gnu.org Received: via spool by submit@debbugs.gnu.org id=B.136844667922641 (code B ref -1); Mon, 13 May 2013 12:05:01 +0000 Received: (at submit) by debbugs.gnu.org; 13 May 2013 12:04:39 +0000 Received: from localhost ([127.0.0.1]:38289 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UbrUb-0005t2-He for submit@debbugs.gnu.org; Mon, 13 May 2013 08:04:37 -0400 Received: from eggs.gnu.org ([208.118.235.92]:59908) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UbrUX-0005sj-Fe for submit@debbugs.gnu.org; Mon, 13 May 2013 08:04:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UbrU2-0006bG-7z for submit@debbugs.gnu.org; Mon, 13 May 2013 08:04:06 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-107.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, USER_IN_WHITELIST autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:46769) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UbrU2-0006bC-5C for submit@debbugs.gnu.org; Mon, 13 May 2013 08:04:02 -0400 Received: from eggs.gnu.org ([208.118.235.92]:43020) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UbrU1-0003Dh-0N for bug-libtool@gnu.org; Mon, 13 May 2013 08:04:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UbrTz-0006ay-TH for bug-libtool@gnu.org; Mon, 13 May 2013 08:04:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:8669) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UbrTz-0006au-LT for bug-libtool@gnu.org; Mon, 13 May 2013 08:03:59 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r4DC3rwa013513 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 13 May 2013 08:03:54 -0400 Received: from unused-4-121.brq.redhat.com (unused-4-133.brq.redhat.com [10.34.4.133]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r4DC3qAl025168; Mon, 13 May 2013 08:03:52 -0400 From: Pavel Raiskup Date: Mon, 13 May 2013 14:03:51 +0200 Message-ID: <2406035.DfkmgaF2Wx@unused-4-121.brq.redhat.com> User-Agent: KMail/4.10.2 (Linux/3.8.11-200.fc18.x86_64; KDE/4.10.2; x86_64; ; ) In-Reply-To: <683610949.2m6zIZog4y@unused-4-121.brq.redhat.com> References: <5107F2FB.50103@lysator.liu.se> <1366890515-6388-2-git-send-email-praiskup@redhat.com> <683610949.2m6zIZog4y@unused-4-121.brq.redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -6.9 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) On Monday, April 29, 2013 08:37:49 Pavel Raiskup wrote: > Ping & update :), Another ping. Is there some obvious problem with the patch? Should I fix something? The 'dd' utility is checked during './configure' phase, and if not found - whole file is read as it is now. Can this somehow broke the cross compilation? If yes, could you give me an example (somehow reproducible). Honestly, I don't see much into cross compilation use-cases. Thanks, Pavel From unknown Mon Jun 23 18:33:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13472: [PATCH] libtool: speed up by pre-cutting sed's input by dd Resent-From: Pavel Raiskup Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-libtool@gnu.org Resent-Date: Wed, 05 Jun 2013 15:00:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13472 X-GNU-PR-Package: libtool X-GNU-PR-Keywords: To: 13472@debbugs.gnu.org Cc: peda@lysator.liu.se X-Debbugs-Original-To: bug-libtool@gnu.org X-Debbugs-Original-Cc: peda@lysator.liu.se, 13472@debbugs.gnu.org Received: via spool by submit@debbugs.gnu.org id=B.13704443852016 (code B ref -1); Wed, 05 Jun 2013 15:00:03 +0000 Received: (at submit) by debbugs.gnu.org; 5 Jun 2013 14:59:45 +0000 Received: from localhost ([127.0.0.1]:52683 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UkFBg-0000WO-R6 for submit@debbugs.gnu.org; Wed, 05 Jun 2013 10:59:45 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48086) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Uk8zK-0000u4-Bk for submit@debbugs.gnu.org; Wed, 05 Jun 2013 04:22:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uk8xE-0005OX-KZ for submit@debbugs.gnu.org; Wed, 05 Jun 2013 04:20:26 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-101.9 required=5.0 tests=BAYES_00, USER_IN_WHITELIST autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:33719) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uk8xE-0005OM-I3 for submit@debbugs.gnu.org; Wed, 05 Jun 2013 04:20:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49784) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uk8xD-0002v3-As for bug-libtool@gnu.org; Wed, 05 Jun 2013 04:20:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uk8xC-0005O0-27 for bug-libtool@gnu.org; Wed, 05 Jun 2013 04:20:23 -0400 Received: from mail-ea0-x22a.google.com ([2a00:1450:4013:c01::22a]:35173) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uk8xB-0005NZ-ST for bug-libtool@gnu.org; Wed, 05 Jun 2013 04:20:21 -0400 Received: by mail-ea0-f170.google.com with SMTP id h10so883361eaj.29 for ; Wed, 05 Jun 2013 01:20:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-transfer-encoding:content-type :x-gm-message-state; bh=KfHO23wHHCfL4xOo1v6/UhNlMoh8cRMjOtLxWxUqXUk=; b=b0sdrJFR0MvbhQkkplv0OtsW9u3LWGyzbjWnmtg+4u0CZmBQXNCk3GicLvS4wyUQ7q wLfj1EJjJV3bv+GgSuUI6SZxAL5MJcIanK1wRLyuSc1YUHbfuwPdrRsw/YMBnVapboMU 8O+aS/rrlFsKLms4khycRG/8B3rvPr7Mp/Hymzt4Pnq2n25npjWTYqrkQi/qozmCIZJM MND41mNwzT00dM078G0fjWVZitd7mwfMyoNP25AAdrV9nRmsJORodruAIMPnJ/mq66Rm MIGid5MlAhvXtiUKOgl/xGyF+19/0DO9gufk7uEtniJY3eC0F3friYCyTlOXRMY1xka8 p5Dw== X-Received: by 10.14.39.71 with SMTP id c47mr880587eeb.141.1370420420237; Wed, 05 Jun 2013 01:20:20 -0700 (PDT) Received: from praiskup.usersys.redhat.com (nat-pool-brq-t.redhat.com. [209.132.186.34]) by mx.google.com with ESMTPSA id f45sm17108848eeo.14.2013.06.05.01.20.18 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 05 Jun 2013 01:20:19 -0700 (PDT) From: Pavel Raiskup Date: Wed, 05 Jun 2013 10:20:16 +0200 Message-ID: <1706515.fgxXn01m9q@praiskup.usersys.redhat.com> User-Agent: KMail/4.10.3 (Linux/3.9.4-300.fc19.x86_64; KDE/4.10.3; x86_64; ; ) In-Reply-To: <2406035.DfkmgaF2Wx@unused-4-121.brq.redhat.com> References: <5107F2FB.50103@lysator.liu.se> <683610949.2m6zIZog4y@unused-4-121.brq.redhat.com> <2406035.DfkmgaF2Wx@unused-4-121.brq.redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Gm-Message-State: ALoCoQn77wKwCcja7FwKTh5D+v6FRCgAIjGFbuFNj6XwyyDggeAzZ3GT4FwIP1ogK1JwhgzK3dz3 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -6.9 (------) X-Mailman-Approved-At: Wed, 05 Jun 2013 10:59:40 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) On Monday, May 13, 2013 02:03:51 PM Pavel Raiskup wrote: > On Monday, April 29, 2013 08:37:49 Pavel Raiskup wrote: > > Ping & update :), > > Another ping. ... and another, should I let it be? Thanks, Pavel Context catcher: http://lists.gnu.org/archive/html/bug-libtool/2013-04/msg00009.html From unknown Mon Jun 23 18:33:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13472: Execution mode can hang pc when parameter refers to big file In-Reply-To: <1358420984.3016.2.camel@dhcp-25-209.brq.redhat.com> Resent-From: Pavel Raiskup Original-Sender: "Debbugs-submit" Resent-CC: bug-libtool@gnu.org Resent-Date: Tue, 14 Jan 2014 13:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13472 X-GNU-PR-Package: libtool X-GNU-PR-Keywords: To: 13472@debbugs.gnu.org Cc: peda@lysator.liu.se, bfriesen@simple.dallas.tx.us X-Debbugs-Original-To: bug-libtool@gnu.org X-Debbugs-Original-Cc: Peter Rosin , 13472@debbugs.gnu.org, Bob Friesenhahn Received: via spool by submit@debbugs.gnu.org id=B.138970574822773 (code B ref -1); Tue, 14 Jan 2014 13:23:01 +0000 Received: (at submit) by debbugs.gnu.org; 14 Jan 2014 13:22:28 +0000 Received: from localhost ([127.0.0.1]:49820 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W33wp-0005vD-KE for submit@debbugs.gnu.org; Tue, 14 Jan 2014 08:22:28 -0500 Received: from eggs.gnu.org ([208.118.235.92]:48394) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W33wm-0005v1-AQ for submit@debbugs.gnu.org; Tue, 14 Jan 2014 08:22:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W33wg-0007AS-9j for submit@debbugs.gnu.org; Tue, 14 Jan 2014 08:22:24 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:53762) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W33wg-0007AO-74 for submit@debbugs.gnu.org; Tue, 14 Jan 2014 08:22:18 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50092) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W33wb-0006Ls-7d for bug-libtool@gnu.org; Tue, 14 Jan 2014 08:22:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W33wW-00078c-7e for bug-libtool@gnu.org; Tue, 14 Jan 2014 08:22:13 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45254) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W33wV-00078Y-WA for bug-libtool@gnu.org; Tue, 14 Jan 2014 08:22:08 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s0EDM3vY018195 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 14 Jan 2014 08:22:03 -0500 Received: from nb.usersys.redhat.com (unused-4-200.brq.redhat.com [10.34.4.200]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s0EDM1Jr025252; Tue, 14 Jan 2014 08:22:02 -0500 From: Pavel Raiskup Date: Tue, 14 Jan 2014 14:22:01 +0100 Message-ID: <1673124.R7pAHGrlGN@nb.usersys.redhat.com> Organization: Red Hat User-Agent: KMail/4.11.5 (Linux/3.12.6-300.fc20.x86_64; KDE/4.11.5; x86_64; ; ) References: <1358420984.3016.2.camel@dhcp-25-209.brq.redhat.com> <5107DFFA.4070706@lysator.liu.se> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) As the 'dd' [1] solution does not seem to be very popular, I would like to discuss the 'native' compiler solution. For getting a context of this thread [2]. > Autoconf/libtool in general does not seem to support the notion of > supporting both a cross-compiler for the target and a native compiler > for producing programs supporting the build, or remote/emulated > testing of the "target". If this hurdle was solved in a clean way, > then many implementation opportunities would appear. If I understand it, we need something like LT_NATIVE_CC? Is that correct? If I tried to look at this, would this topic be an interesting for libtool upstream (that means patch review/rejecting/discussing)? Pavel [1] http://article.gmane.org/gmane.comp.gnu.libtool.bugs/8161 [1] http://thread.gmane.org/gmane.comp.gnu.libtool.bugs/8113/focus=8130 From unknown Mon Jun 23 18:33:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13472: [PATCH] libtool: speed up by pre-cutting sed's input by dd Resent-From: Peter Rosin Original-Sender: "Debbugs-submit" Resent-CC: bug-libtool@gnu.org Resent-Date: Tue, 11 Feb 2014 17:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13472 X-GNU-PR-Package: libtool X-GNU-PR-Keywords: To: Pavel Raiskup , Nick Bowler , 13472@debbugs.gnu.org Received: via spool by 13472-submit@debbugs.gnu.org id=B13472.139214079910641 (code B ref 13472); Tue, 11 Feb 2014 17:47:02 +0000 Received: (at 13472) by debbugs.gnu.org; 11 Feb 2014 17:46:39 +0000 Received: from localhost ([127.0.0.1]:47749 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WDHPn-0002lS-Sn for submit@debbugs.gnu.org; Tue, 11 Feb 2014 12:46:39 -0500 Received: from mail.lysator.liu.se ([130.236.254.3]:34156) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WDHPh-0002lE-UA for 13472@debbugs.gnu.org; Tue, 11 Feb 2014 12:46:33 -0500 Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 5264040005; Tue, 11 Feb 2014 18:46:28 +0100 (CET) Received: from [192.168.0.68] (90-227-119-221-no95.business.telia.com [90.227.119.221]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id BAAB840002; Tue, 11 Feb 2014 18:46:27 +0100 (CET) Message-ID: <52FA61F2.9030009@lysator.liu.se> Date: Tue, 11 Feb 2014 18:46:26 +0100 From: Peter Rosin User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 References: <5107F2FB.50103@lysator.liu.se> <683610949.2m6zIZog4y@unused-4-121.brq.redhat.com> <2406035.DfkmgaF2Wx@unused-4-121.brq.redhat.com> <1706515.fgxXn01m9q@praiskup.usersys.redhat.com> In-Reply-To: <1706515.fgxXn01m9q@praiskup.usersys.redhat.com> Content-Type: multipart/mixed; boundary="------------010009050300060506010502" X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) This is a multi-part message in MIME format. --------------010009050300060506010502 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 2013-06-05 10:20, Pavel Raiskup wrote: > On Monday, May 13, 2013 02:03:51 PM Pavel Raiskup wrote: >> On Monday, April 29, 2013 08:37:49 Pavel Raiskup wrote: >>> Ping & update :), >> >> Another ping. > > ... and another, should I let it be? Thanks, Pavel > > Context catcher: > http://lists.gnu.org/archive/html/bug-libtool/2013-04/msg00009.html Ok Pavel, first of all, sorry for the "smallish" delay in handling your request, and Nick, are you able to test this patch? I didn't like some aspects of Pavels patch, it seemed convoluted and the dd check didn't actually check if dd behaved as expected. But, I rewrote the patch instead of describing in words exactly what I mean and I hope I'm not stepping on any toes by that action... Anyway, this has the dubious benefit that we do not have to wait for Pavel to assign copyrights (I couldn't find him in any list). Does my version work? The testsuite behaves OK for me, but other than that I haven't tested. Cheers, Peter --------------010009050300060506010502 Content-Type: text/x-patch; name="0001-libtool-speed-up-lalib-detection-in-execute-mode.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename*0="0001-libtool-speed-up-lalib-detection-in-execute-mode.patch" >From 718f64eeeda938634fbdf14f99b33409376b7960 Mon Sep 17 00:00:00 2001 From: Peter Rosin Date: Tue, 11 Feb 2014 18:39:39 +0100 Subject: [PATCH] libtool: speed up lalib detection in execute mode Execute mode is slow and might even DOS the computer in extreme cases when a parameter is a big binary file without newlines. Work around this by truncation if the dd utility is found and working. Fixes bug#13472 and bug#16662. Reported by Pavel Raiskup and Nick Bowler. * m4/libtool.m4 (_LT_CMD_TRUNCATE): New macro, for finding out how to truncate pipes to 4k (fallback to no truncation if that is not possible). (_LT_SETUP): Require _LT_CMD_TRUNCATE. * build_aux/ltmain.in (func_lalib_p): Truncate the pipe before passing it on to sed. * THANKS: Update. Signed-off-by: Peter Rosin --- THANKS | 2 ++ build-aux/ltmain.in | 2 +- m4/libtool.m4 | 22 ++++++++++++++++++++++ 3 files changed, 25 insertions(+), 1 deletions(-) diff --git a/THANKS b/THANKS index e895aee..85c5150 100644 --- a/THANKS +++ b/THANKS @@ -150,6 +150,7 @@ Mike Gorchak mike@malva.ua Mike Frysinger vapier@gentoo.org Mike Miller mtmiller@ieee.org + Nick Bowler nbowler@draconx.ca Nix nix@esperi.org.uk Olaf Lenz olenz@fias.uni-frankfurt.de Olly Betts olly@muscat.co.uk @@ -161,6 +162,7 @@ Paul Eggert eggert@twinsun.com Paul Laight plaight@quantxautomation.co.uk Paul Seidler sepek@lavabit.com + Pavel Raiskup praiskup@redhat.com Paweł Daniluk pawel@bioexploratorium.pl Peter Eisentraut peter_e@gmx.net Peter Fritzsche peter.fritzsche@gmx.de diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in index 3b4e6ec..bff642e 100644 --- a/build-aux/ltmain.in +++ b/build-aux/ltmain.in @@ -577,7 +577,7 @@ _LTECHO_EOF' func_lalib_p () { test -f "$1" && - $SED -e 4q "$1" 2>/dev/null \ + $lt_truncate_4k < "$1" 2>/dev/null | $SED -e 4q 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } diff --git a/m4/libtool.m4 b/m4/libtool.m4 index ce58f31..d5967d2 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -169,6 +169,7 @@ m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl +m4_require([_LT_CMD_TRUNCATE])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options that allow our @@ -3216,6 +3217,27 @@ _LT_TAGDECL([], [reload_cmds], [2])dnl ])# _LT_CMD_RELOAD +# _LT_CMD_TRUNCATE +# ---------------- +# find command to truncate a pipe to 4k +m4_defun([_LT_CMD_TRUNCATE], +[AC_PATH_PROG([DD], [dd]) +test -z "$DD" && DD=dd + +AC_CACHE_CHECK([how to truncate pipes to 4k], [lt_cv_truncate_4k], +[lt_cv_truncate_4k=cat +printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +if "$DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out && lt_cv_truncate_4k="$DD bs=4096 count=1" +fi +rm -f conftest.i conftest2.i conftest.out]) + +_LT_DECL([lt_truncate_4k], [lt_cv_truncate_4k], [1], + [Command to truncate a pipe to 4k]) +])# _LT_CMD_TRUNCATE + + # _LT_CHECK_MAGIC_METHOD # ---------------------- # how to check for library dependencies -- 1.7.9 --------------010009050300060506010502-- From unknown Mon Jun 23 18:33:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13472: [PATCH] libtool: speed up by pre-cutting sed's input by dd Resent-From: Nick Bowler Original-Sender: "Debbugs-submit" Resent-CC: bug-libtool@gnu.org Resent-Date: Tue, 11 Feb 2014 19:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13472 X-GNU-PR-Package: libtool X-GNU-PR-Keywords: To: Peter Rosin Cc: Pavel Raiskup , 13472@debbugs.gnu.org Received: via spool by 13472-submit@debbugs.gnu.org id=B13472.139214615024959 (code B ref 13472); Tue, 11 Feb 2014 19:16:01 +0000 Received: (at 13472) by debbugs.gnu.org; 11 Feb 2014 19:15:50 +0000 Received: from localhost ([127.0.0.1]:47847 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WDIo8-0006UU-Vd for submit@debbugs.gnu.org; Tue, 11 Feb 2014 14:15:49 -0500 Received: from mail-qc0-f174.google.com ([209.85.216.174]:42615) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WDIo3-0006UB-29 for 13472@debbugs.gnu.org; Tue, 11 Feb 2014 14:15:43 -0500 Received: by mail-qc0-f174.google.com with SMTP id x13so13773910qcv.33 for <13472@debbugs.gnu.org>; Tue, 11 Feb 2014 11:15:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=OK3A13JG+ud3hS652LeK4PjIe96vgCsbOJZfy0GUJgo=; b=fp8m2DBSI25mz5dPh5GJMZjfk6to/9dfp+fosFXp0Fee+mwc1DUk57XXay3agFD9oK hhRLpf1ZvWTQRedfnGc/0eJU8X1dtQAWc1hgjivszTKc5Jxmwe+cxXUkb2sAE+pNDyH4 /9r7C/tD4bc8tHMKo72IjFrR1QomDvE1+aXNgGGwG8ZSzdttMHil7dRuNHA7Yl383xuu rTspp8r6WMpyXNNeOGlDsu71qh2jzP7Grcec0kkXb8RLApVY3sL5PCOrh5E9l72W8xQA /q6/0JLNJh9qmhLW41afyLxGFYrve+fYf6WnMT+55BaNcMwFWn+ILZKxMqHqNRqJBPqz pvow== MIME-Version: 1.0 X-Received: by 10.229.172.4 with SMTP id j4mr17592655qcz.6.1392146137665; Tue, 11 Feb 2014 11:15:37 -0800 (PST) Received: by 10.96.170.35 with HTTP; Tue, 11 Feb 2014 11:15:37 -0800 (PST) In-Reply-To: <52FA61F2.9030009@lysator.liu.se> References: <5107F2FB.50103@lysator.liu.se> <683610949.2m6zIZog4y@unused-4-121.brq.redhat.com> <2406035.DfkmgaF2Wx@unused-4-121.brq.redhat.com> <1706515.fgxXn01m9q@praiskup.usersys.redhat.com> <52FA61F2.9030009@lysator.liu.se> Date: Tue, 11 Feb 2014 14:15:37 -0500 X-Google-Sender-Auth: KbCL_WxoSs0uGtqKei4lJwuPZU4 Message-ID: From: Nick Bowler Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2/11/14, Peter Rosin wrote: > On 2013-06-05 10:20, Pavel Raiskup wrote: >> On Monday, May 13, 2013 02:03:51 PM Pavel Raiskup wrote: >>> On Monday, April 29, 2013 08:37:49 Pavel Raiskup wrote: >>>> Ping & update :), >>> >>> Another ping. >> >> ... and another, should I let it be? Thanks, Pavel >> >> Context catcher: >> http://lists.gnu.org/archive/html/bug-libtool/2013-04/msg00009.html > > Ok Pavel, first of all, sorry for the "smallish" delay in handling > your request, and Nick, are you able to test this patch? > > I didn't like some aspects of Pavels patch, it seemed convoluted and > the dd check didn't actually check if dd behaved as expected. But, I > rewrote the patch instead of describing in words exactly what I mean > and I hope I'm not stepping on any toes by that action... Anyway, this > has the dubious benefit that we do not have to wait for Pavel to assign > copyrights (I couldn't find him in any list). > > Does my version work? The testsuite behaves OK for me, but other than > that I haven't tested. Thanks both of you for looking at this. I will test it tonight... I was also going to comment that I didn't really like the configure test in Pavel's version. Cheers, Nick From unknown Mon Jun 23 18:33:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13472: [PATCH] libtool: speed up by pre-cutting sed's input by dd In-Reply-To: <1358420984.3016.2.camel@dhcp-25-209.brq.redhat.com> Resent-From: Pavel Raiskup Original-Sender: "Debbugs-submit" Resent-CC: bug-libtool@gnu.org Resent-Date: Wed, 12 Feb 2014 12:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13472 X-GNU-PR-Package: libtool X-GNU-PR-Keywords: To: 13472@debbugs.gnu.org Cc: nbowler@draconx.ca, peda@lysator.liu.se X-Debbugs-Original-To: bug-libtool@gnu.org X-Debbugs-Original-Cc: Nick Bowler , Peter Rosin , 13472@debbugs.gnu.org Received: via spool by submit@debbugs.gnu.org id=B.139220667113813 (code B ref -1); Wed, 12 Feb 2014 12:05:02 +0000 Received: (at submit) by debbugs.gnu.org; 12 Feb 2014 12:04:31 +0000 Received: from localhost ([127.0.0.1]:48375 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WDYYJ-0003aj-9v for submit@debbugs.gnu.org; Wed, 12 Feb 2014 07:04:31 -0500 Received: from eggs.gnu.org ([208.118.235.92]:53379) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WDYYH-0003aT-5q for submit@debbugs.gnu.org; Wed, 12 Feb 2014 07:04:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WDYY6-0007P7-Hr for submit@debbugs.gnu.org; Wed, 12 Feb 2014 07:04:23 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:40678) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDYY6-0007P3-FX for submit@debbugs.gnu.org; Wed, 12 Feb 2014 07:04:18 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55066) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDYY1-0002ft-II for bug-libtool@gnu.org; Wed, 12 Feb 2014 07:04:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WDYXw-0007NS-Q8 for bug-libtool@gnu.org; Wed, 12 Feb 2014 07:04:13 -0500 Received: from mx1.redhat.com ([209.132.183.28]:64577) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDYXw-0007MC-I1 for bug-libtool@gnu.org; Wed, 12 Feb 2014 07:04:08 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s1CC41T0017950 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 12 Feb 2014 07:04:01 -0500 Received: from nb.usersys.redhat.com (unused-4-200.brq.redhat.com [10.34.4.200]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s1CC3xMU029216; Wed, 12 Feb 2014 07:04:00 -0500 From: Pavel Raiskup Date: Wed, 12 Feb 2014 13:03:59 +0100 Message-ID: <4408632.ZZ5Ndx5jAx@nb.usersys.redhat.com> User-Agent: KMail/4.11.5 (Linux/3.12.8-300.fc20.x86_64; KDE/4.11.5; x86_64; ; ) References: <5107F2FB.50103@lysator.liu.se> <1706515.fgxXn01m9q@praiskup.usersys.redhat.com> <52FA61F2.9030009@lysator.liu.se> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) On Tuesday, February 11, 2014 18:46:26 Peter Rosin wrote: > On 2013-06-05 10:20, Pavel Raiskup wrote: > > On Monday, May 13, 2013 02:03:51 PM Pavel Raiskup wrote: > >> On Monday, April 29, 2013 08:37:49 Pavel Raiskup wrote: > >>> Ping & update :), > >> > >> Another ping. > > > > ... and another, should I let it be? Thanks, Pavel > > > > Context catcher: > > http://lists.gnu.org/archive/html/bug-libtool/2013-04/msg00009.html > > Ok Pavel, first of all, sorry for the "smallish" delay in handling > your request, and Nick, are you able to test this patch? Peter, tested & it works for me, thanks a lot for looking at this! > .. I rewrote the patch instead of describing in words exactly what I > mean and I hope I'm not stepping on any toes by that action... Anyway, > this has the dubious benefit that we do not have to wait for Pavel to > assign copyrights (I couldn't find him in any list). I'm completely OK with your patch. Pavel From unknown Mon Jun 23 18:33:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13472: [PATCH] libtool: speed up by pre-cutting sed's input by dd Resent-From: Nick Bowler Original-Sender: "Debbugs-submit" Resent-CC: bug-libtool@gnu.org Resent-Date: Wed, 12 Feb 2014 15:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13472 X-GNU-PR-Package: libtool X-GNU-PR-Keywords: To: Peter Rosin Cc: Pavel Raiskup , 13472@debbugs.gnu.org Received: via spool by 13472-submit@debbugs.gnu.org id=B13472.13922185466863 (code B ref 13472); Wed, 12 Feb 2014 15:23:02 +0000 Received: (at 13472) by debbugs.gnu.org; 12 Feb 2014 15:22:26 +0000 Received: from localhost ([127.0.0.1]:49109 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WDbdq-0001md-8c for submit@debbugs.gnu.org; Wed, 12 Feb 2014 10:22:26 -0500 Received: from mail-qa0-f46.google.com ([209.85.216.46]:38411) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WDbdn-0001mN-JR for 13472@debbugs.gnu.org; Wed, 12 Feb 2014 10:22:24 -0500 Received: by mail-qa0-f46.google.com with SMTP id k15so747369qaq.5 for <13472@debbugs.gnu.org>; Wed, 12 Feb 2014 07:22:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=mZdj/0N/mBxxiXsb3Nsy6XJ82LAQyXbW8NeWro8LkvA=; b=x8Qosjy2uedKcQPugdTPeUYnCHTtuMmVhLfp2isTW/u9gF/AVnHvYz7GrNUdQ8dONi 8NxArzF43HwM80Vegyi5FPheGfapaSyH0R9UxD/ANaeWf6vuDwUNH92a7Q7uPnWBjXUZ 1bz5lYn7M1VuX/pqd9z/Xt/T0lkrFOS9AQWICEErh8NbAbO50LQf2+G8ftTwPcMbsl3M ui+WjDNZFmX8Gv5Qs8CvkgBIBWxZeln94Zxt+z9knxr44jUKYUqxgVZBWVWw+JBG5NXf zS0UuNG9ajPv93iNAYC7tGpY47Jz2P1A6jv7Winhlc91dSBhcBnUghUxvkgKLdoWlld3 CMlQ== MIME-Version: 1.0 X-Received: by 10.140.94.74 with SMTP id f68mr64699408qge.64.1392218537863; Wed, 12 Feb 2014 07:22:17 -0800 (PST) Received: by 10.96.170.35 with HTTP; Wed, 12 Feb 2014 07:22:17 -0800 (PST) In-Reply-To: <52FA61F2.9030009@lysator.liu.se> References: <5107F2FB.50103@lysator.liu.se> <683610949.2m6zIZog4y@unused-4-121.brq.redhat.com> <2406035.DfkmgaF2Wx@unused-4-121.brq.redhat.com> <1706515.fgxXn01m9q@praiskup.usersys.redhat.com> <52FA61F2.9030009@lysator.liu.se> Date: Wed, 12 Feb 2014 10:22:17 -0500 X-Google-Sender-Auth: _bkaAZfLNgxUoJ5Czj55a8COywM Message-ID: From: Nick Bowler Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2/11/14, Peter Rosin wrote: > Ok Pavel, first of all, sorry for the "smallish" delay in handling > your request, and Nick, are you able to test this patch? [...] > Does my version work? The testsuite behaves OK for me, but other than > that I haven't tested. Patch seems to work! Thanks, Nick From unknown Mon Jun 23 18:33:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13472: [PATCH] libtool: speed up by pre-cutting sed's input by dd Resent-From: Peter Rosin Original-Sender: "Debbugs-submit" Resent-CC: bug-libtool@gnu.org Resent-Date: Thu, 13 Feb 2014 17:58:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13472 X-GNU-PR-Package: libtool X-GNU-PR-Keywords: To: Nick Bowler Cc: Pavel Raiskup , 13472@debbugs.gnu.org Received: via spool by 13472-submit@debbugs.gnu.org id=B13472.139231424725569 (code B ref 13472); Thu, 13 Feb 2014 17:58:01 +0000 Received: (at 13472) by debbugs.gnu.org; 13 Feb 2014 17:57:27 +0000 Received: from localhost ([127.0.0.1]:51088 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WE0XP-0006eK-5u for submit@debbugs.gnu.org; Thu, 13 Feb 2014 12:57:27 -0500 Received: from mail.lysator.liu.se ([130.236.254.3]:46751) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WE0XM-0006e9-I7 for 13472@debbugs.gnu.org; Thu, 13 Feb 2014 12:57:25 -0500 Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id C3AC940035; Thu, 13 Feb 2014 18:57:22 +0100 (CET) Received: from [192.168.0.68] (90-227-119-221-no95.business.telia.com [90.227.119.221]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 16FAB40003; Thu, 13 Feb 2014 18:57:21 +0100 (CET) Message-ID: <52FD0781.7070006@lysator.liu.se> Date: Thu, 13 Feb 2014 18:57:21 +0100 From: Peter Rosin User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 References: <5107F2FB.50103@lysator.liu.se> <683610949.2m6zIZog4y@unused-4-121.brq.redhat.com> <2406035.DfkmgaF2Wx@unused-4-121.brq.redhat.com> <1706515.fgxXn01m9q@praiskup.usersys.redhat.com> <52FA61F2.9030009@lysator.liu.se> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2014-02-12 16:22, Nick Bowler wrote: > On 2/11/14, Peter Rosin wrote: >> Ok Pavel, first of all, sorry for the "smallish" delay in handling >> your request, and Nick, are you able to test this patch? > [...] >> Does my version work? The testsuite behaves OK for me, but other than >> that I haven't tested. > > Patch seems to work! Ok, everybody seems happy. But not me, not 100% anyway. This introduces an extra fork, and AFAICT, the "extra protection" is only needed when func_lalib_p is called from func_ltwrapper_script_p. Should we perhaps have a separate implementation in func_ltwrapper_script_p instead of simply calling func_lalib_p? Maybe we could also lose the "sed -e 4q" part when dd limits the size? I.e. keep func_lalib_p as before: func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } but change func_ltwrapper_script_p from: func_ltwrapper_script_p () { func_lalib_p "$1" } into: func_ltwrapper_script_p () { test -f "$1" && $lt_truncate_bin < "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } where lt_truncate_bin is either "/usr/bin/dd bs=4096 count=1" or "$SED -e 4q" depending on the presence of a suitable dd. That way we shave off a fork, which can't be bad... Thoughts? Or should I just push out the prior patch? Cheers, Peter From unknown Mon Jun 23 18:33:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13472: [PATCH] libtool: speed up by pre-cutting sed's input by dd Resent-From: Peter Rosin Original-Sender: "Debbugs-submit" Resent-CC: bug-libtool@gnu.org Resent-Date: Thu, 13 Feb 2014 19:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13472 X-GNU-PR-Package: libtool X-GNU-PR-Keywords: To: Nick Bowler Cc: Pavel Raiskup , 13472@debbugs.gnu.org Received: via spool by 13472-submit@debbugs.gnu.org id=B13472.13923211976216 (code B ref 13472); Thu, 13 Feb 2014 19:54:02 +0000 Received: (at 13472) by debbugs.gnu.org; 13 Feb 2014 19:53:17 +0000 Received: from localhost ([127.0.0.1]:51200 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WE2LN-0001c2-Te for submit@debbugs.gnu.org; Thu, 13 Feb 2014 14:53:17 -0500 Received: from mail.lysator.liu.se ([130.236.254.3]:41779) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WE2LH-0001bd-I3 for 13472@debbugs.gnu.org; Thu, 13 Feb 2014 14:53:07 -0500 Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id B218A4003D; Thu, 13 Feb 2014 20:53:01 +0100 (CET) Received: from [192.168.0.68] (90-227-119-221-no95.business.telia.com [90.227.119.221]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 4EC0C40003; Thu, 13 Feb 2014 20:53:00 +0100 (CET) Message-ID: <52FD229B.5020300@lysator.liu.se> Date: Thu, 13 Feb 2014 20:52:59 +0100 From: Peter Rosin User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 References: <5107F2FB.50103@lysator.liu.se> <683610949.2m6zIZog4y@unused-4-121.brq.redhat.com> <2406035.DfkmgaF2Wx@unused-4-121.brq.redhat.com> <1706515.fgxXn01m9q@praiskup.usersys.redhat.com> <52FA61F2.9030009@lysator.liu.se> <52FD0781.7070006@lysator.liu.se> In-Reply-To: <52FD0781.7070006@lysator.liu.se> Content-Type: multipart/mixed; boundary="------------090901030405000306080103" X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) This is a multi-part message in MIME format. --------------090901030405000306080103 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 2014-02-13 18:57, Peter Rosin wrote: > On 2014-02-12 16:22, Nick Bowler wrote: >> On 2/11/14, Peter Rosin wrote: >>> Ok Pavel, first of all, sorry for the "smallish" delay in handling >>> your request, and Nick, are you able to test this patch? >> [...] >>> Does my version work? The testsuite behaves OK for me, but other than >>> that I haven't tested. >> >> Patch seems to work! > > Ok, everybody seems happy. But not me, not 100% anyway. This introduces > an extra fork, and AFAICT, the "extra protection" is only needed when > func_lalib_p is called from func_ltwrapper_script_p. Should we perhaps > have a separate implementation in func_ltwrapper_script_p instead of > simply calling func_lalib_p? > > Maybe we could also lose the "sed -e 4q" part when dd limits the size? *snip* outline, real patch attached instead... Now, which patch should I push? The old [1]: libtool: speed up lalib detection in execute mode or the new? libtool: speed up ltwrapper_script detection in execute mode I like the latter better and will push that soonish. Unless... Cheers, Peter [1] http://lists.gnu.org/archive/html/bug-libtool/2014-02/msg00005.html --------------090901030405000306080103 Content-Type: text/x-patch; name="0001-libtool-speed-up-ltwrapper_script-detection-in-execu.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename*0="0001-libtool-speed-up-ltwrapper_script-detection-in-execu.pa"; filename*1="tch" >From d93a003e6189c0c8f9f91ef6e48b3a65063979da Mon Sep 17 00:00:00 2001 From: Peter Rosin Date: Thu, 13 Feb 2014 20:22:42 +0100 Subject: [PATCH] libtool: speed up ltwrapper_script detection in execute mode Execute mode is slow and might even DOS the computer in extreme cases when a parameter is a big binary file without newlines. Work around this with different truncation if a suitable dd utility is found. Fixes bug#13472 and bug#16662. Reported by Pavel Raiskup and Nick Bowler. * m4/libtool.m4 (_LT_CMD_TRUNCATE): New macro, for finding out how to truncate binary pipes (fallback to the old sed truncation if no suitable dd is found). (_LT_SETUP): Require _LT_CMD_TRUNCATE. * build_aux/ltmain.in (func_ltwrapper_script_p): Truncate the pipe according to _LT_CMD_TRUNCATE. * THANKS: Update. Signed-off-by: Peter Rosin --- THANKS | 2 ++ build-aux/ltmain.in | 4 +++- m4/libtool.m4 | 22 ++++++++++++++++++++++ 3 files changed, 27 insertions(+), 1 deletions(-) diff --git a/THANKS b/THANKS index e895aee..85c5150 100644 --- a/THANKS +++ b/THANKS @@ -150,6 +150,7 @@ Mike Gorchak mike@malva.ua Mike Frysinger vapier@gentoo.org Mike Miller mtmiller@ieee.org + Nick Bowler nbowler@draconx.ca Nix nix@esperi.org.uk Olaf Lenz olenz@fias.uni-frankfurt.de Olly Betts olly@muscat.co.uk @@ -161,6 +162,7 @@ Paul Eggert eggert@twinsun.com Paul Laight plaight@quantxautomation.co.uk Paul Seidler sepek@lavabit.com + Pavel Raiskup praiskup@redhat.com Paweł Daniluk pawel@bioexploratorium.pl Peter Eisentraut peter_e@gmx.net Peter Fritzsche peter.fritzsche@gmx.de diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in index f8e0f5f..b013688 100644 --- a/build-aux/ltmain.in +++ b/build-aux/ltmain.in @@ -610,7 +610,9 @@ func_lalib_unsafe_p () # determined imposters. func_ltwrapper_script_p () { - func_lalib_p "$1" + test -f "$1" && + $lt_truncate_bin < "$1" 2>/dev/null \ + | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_ltwrapper_executable_p file diff --git a/m4/libtool.m4 b/m4/libtool.m4 index ce58f31..b9ac7f8 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -169,6 +169,7 @@ m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl +m4_require([_LT_CMD_TRUNCATE])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options that allow our @@ -3216,6 +3217,27 @@ _LT_TAGDECL([], [reload_cmds], [2])dnl ])# _LT_CMD_RELOAD +# _LT_CMD_TRUNCATE +# ---------------- +# find command to truncate a binary pipe +m4_defun([_LT_CMD_TRUNCATE], +[AC_PATH_PROG([DD], [dd]) +test -z "$DD" && DD=dd + +AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], +[lt_cv_truncate_bin="$SED -e 4q" +printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +if "$DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out && lt_cv_truncate_bin="$DD bs=4096 count=1" +fi +rm -f conftest.i conftest2.i conftest.out]) + +_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], + [Command to truncate a binary pipe]) +])# _LT_CMD_TRUNCATE + + # _LT_CHECK_MAGIC_METHOD # ---------------------- # how to check for library dependencies -- 1.7.9 --------------090901030405000306080103-- From unknown Mon Jun 23 18:33:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13472: [PATCH] libtool: speed up by pre-cutting sed's input by dd Resent-From: Nick Bowler Original-Sender: "Debbugs-submit" Resent-CC: bug-libtool@gnu.org Resent-Date: Fri, 14 Feb 2014 16:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13472 X-GNU-PR-Package: libtool X-GNU-PR-Keywords: To: Peter Rosin Cc: Pavel Raiskup , 13472@debbugs.gnu.org Received: via spool by 13472-submit@debbugs.gnu.org id=B13472.13923962201783 (code B ref 13472); Fri, 14 Feb 2014 16:44:02 +0000 Received: (at 13472) by debbugs.gnu.org; 14 Feb 2014 16:43:40 +0000 Received: from localhost ([127.0.0.1]:52554 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WELrY-0000Sg-EU for submit@debbugs.gnu.org; Fri, 14 Feb 2014 11:43:40 -0500 Received: from mail-qc0-f180.google.com ([209.85.216.180]:34789) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WELrV-0000ST-HB for 13472@debbugs.gnu.org; Fri, 14 Feb 2014 11:43:38 -0500 Received: by mail-qc0-f180.google.com with SMTP id i17so20759744qcy.11 for <13472@debbugs.gnu.org>; Fri, 14 Feb 2014 08:43:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=AmkGYwwf4Mh8oIYZSwFgzmY4e8iXdOB/9qP13eDyNK4=; b=zexIvC+fzvZFifA9CN5R/VOjb01ok9exI1DXpPNnYmFGA81P0jhSEezXk74b4vvRtS 1AWmmSxNSgDm39098FH9QKr9gj/7mhh839tfqpAwkoxRt89//uL94TJZ0AoJAnM2bX/r E0V5FIm3J76pAR2XiKypM7T8RNazEvt41Mz5EBjRirjqVxTAAisKCoovOKspT+GxPQ93 H4t0soILty6RuLaacG81fBtiguO2MYSngmW1Nxn8AgwU6Nl2wB1R4b2KBtAAJFVuz/v3 7PxIQJlR7RDmZ4H8rntIY8uv2O1W6yIBab1fkFcqnpnE9ZDdbF6/NyFdDVEu/7TVsEA0 t1Yg== MIME-Version: 1.0 X-Received: by 10.140.36.107 with SMTP id o98mr13905437qgo.25.1392396211603; Fri, 14 Feb 2014 08:43:31 -0800 (PST) Received: by 10.96.129.135 with HTTP; Fri, 14 Feb 2014 08:43:31 -0800 (PST) In-Reply-To: <52FD229B.5020300@lysator.liu.se> References: <5107F2FB.50103@lysator.liu.se> <683610949.2m6zIZog4y@unused-4-121.brq.redhat.com> <2406035.DfkmgaF2Wx@unused-4-121.brq.redhat.com> <1706515.fgxXn01m9q@praiskup.usersys.redhat.com> <52FA61F2.9030009@lysator.liu.se> <52FD0781.7070006@lysator.liu.se> <52FD229B.5020300@lysator.liu.se> Date: Fri, 14 Feb 2014 11:43:31 -0500 X-Google-Sender-Auth: dTYvZh6tKpBbarfajb-9kgm3aeY Message-ID: From: Nick Bowler Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2/13/14, Peter Rosin wrote: > On 2014-02-13 18:57, Peter Rosin wrote: >> Ok, everybody seems happy. But not me, not 100% anyway. This introduces >> an extra fork, and AFAICT, the "extra protection" is only needed when >> func_lalib_p is called from func_ltwrapper_script_p. Should we perhaps >> have a separate implementation in func_ltwrapper_script_p instead of >> simply calling func_lalib_p? >> >> Maybe we could also lose the "sed -e 4q" part when dd limits the size? > > *snip* outline, real patch attached instead... > > Now, which patch should I push? The new looks a bit nicer to me although I have not tested it. One comment I have that applies to both patches... you should probably be using AC_CHECK_PROGS instead of AC_PATH_PROG because the latter requires an absolute filename. Specifically, AC_PATH_PROG will ignore any user-set value for DD if it's not absolute. Cheers, Nick From unknown Mon Jun 23 18:33:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13472: [PATCH] libtool: speed up by pre-cutting sed's input by dd In-Reply-To: <1358420984.3016.2.camel@dhcp-25-209.brq.redhat.com> Resent-From: Pavel Raiskup Original-Sender: "Debbugs-submit" Resent-CC: bug-libtool@gnu.org Resent-Date: Fri, 21 Feb 2014 14:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13472 X-GNU-PR-Package: libtool X-GNU-PR-Keywords: To: 13472@debbugs.gnu.org Cc: nbowler@draconx.ca, peda@lysator.liu.se X-Debbugs-Original-To: bug-libtool@gnu.org X-Debbugs-Original-Cc: Nick Bowler , Peter Rosin , 13472@debbugs.gnu.org Received: via spool by submit@debbugs.gnu.org id=B.139299143617683 (code B ref -1); Fri, 21 Feb 2014 14:04:02 +0000 Received: (at submit) by debbugs.gnu.org; 21 Feb 2014 14:03:56 +0000 Received: from localhost ([127.0.0.1]:34423 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WGqhn-0004b8-GH for submit@debbugs.gnu.org; Fri, 21 Feb 2014 09:03:55 -0500 Received: from eggs.gnu.org ([208.118.235.92]:57901) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WGqhk-0004av-UG for submit@debbugs.gnu.org; Fri, 21 Feb 2014 09:03:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WGqhZ-0000w0-5k for submit@debbugs.gnu.org; Fri, 21 Feb 2014 09:03:47 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:47548) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGqhZ-0000vw-35 for submit@debbugs.gnu.org; Fri, 21 Feb 2014 09:03:41 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59593) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGqhT-0007mb-7B for bug-libtool@gnu.org; Fri, 21 Feb 2014 09:03:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WGqhN-0000tl-C7 for bug-libtool@gnu.org; Fri, 21 Feb 2014 09:03:35 -0500 Received: from mail-wg0-f54.google.com ([74.125.82.54]:54352) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGqhN-0000tc-68 for bug-libtool@gnu.org; Fri, 21 Feb 2014 09:03:29 -0500 Received: by mail-wg0-f54.google.com with SMTP id l18so2609435wgh.9 for ; Fri, 21 Feb 2014 06:03:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent :references:mime-version:content-transfer-encoding:content-type; bh=jdOQDR30zgmAgPxXw4RMKmi+TlLbMaGBfz29utGIcws=; b=ErXOo+trjz5Mtoup/i4+5jVmo9ZksAOk40SV1M1GgOyIcOK0WCsLWGeZGLM8XqweXB IiWkrmeR9Z9y1VXgzY3liXI/BSmdmb6OMyfE8k3CranYJrex31lh3y1r6dAhlESMEVWy 9huZ7/AABYQd8/ArpaJKLmJUPjPl6wWXQ+Qn8q9RElfl9zobNubWAa0s2MOAWCk0Lk2E YgM9cGA/vfLmOtsYv902Wpu5s26Zi1KOHZVkaUbl8hN7pfZUznVpOJ5Pg5nAcHpXu7xb PInPZomhI7eTtV2yts01U/JJ2x17FkMQs/wft7lHY2iS9/eWHkZUySfy/QcnVAkmIFuN /1MQ== X-Gm-Message-State: ALoCoQnB63XcxfEt/hXrVqoUXj7iZ/gutni2TW4Mwk8V9Q70+Dr/tsjxcNCOEz+mVvIqlBrsmkvU X-Received: by 10.180.99.39 with SMTP id en7mr3489200wib.10.1392991407605; Fri, 21 Feb 2014 06:03:27 -0800 (PST) Received: from nb.usersys.redhat.com (nat-pool-brq-t.redhat.com. [209.132.186.34]) by mx.google.com with ESMTPSA id ju6sm17312617wjc.1.2014.02.21.06.03.25 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Feb 2014 06:03:26 -0800 (PST) From: Pavel Raiskup Date: Fri, 21 Feb 2014 15:03:24 +0100 Message-ID: <5396758.yIHWu6EQek@nb.usersys.redhat.com> User-Agent: KMail/4.12.2 (Linux/3.13.3-201.fc20.x86_64; KDE/4.12.2; x86_64; ; ) References: <5107F2FB.50103@lysator.liu.se> <52FD0781.7070006@lysator.liu.se> <52FD229B.5020300@lysator.liu.se> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Peter, sorry for the delay, On Thursday, February 13, 2014 20:52:59 Peter Rosin wrote: > On 2014-02-13 18:57, Peter Rosin wrote: > > On 2014-02-12 16:22, Nick Bowler wrote: > >> On 2/11/14, Peter Rosin wrote: > >>> Ok Pavel, first of all, sorry for the "smallish" delay in handling > >>> your request, and Nick, are you able to test this patch? > >> [...] > >>> Does my version work? The testsuite behaves OK for me, but other than > >>> that I haven't tested. > >> > >> Patch seems to work! > > > > Ok, everybody seems happy. But not me, not 100% anyway. This introduces > > an extra fork, and AFAICT, the "extra protection" is only needed when > > func_lalib_p is called from func_ltwrapper_script_p. Should we perhaps > > have a separate implementation in func_ltwrapper_script_p instead of > > simply calling func_lalib_p? > > > > Maybe we could also lose the "sed -e 4q" part when dd limits the size? IMHO very good idea ^^^. Cutting some line in the middle should not be a problem after 4kB of characters, so why not. > *snip* outline, real patch attached instead... > > Now, which patch should I push? > > The old [1]: > libtool: speed up lalib detection in execute mode > > or the new? > libtool: speed up ltwrapper_script detection in execute mode > > I like the latter better and will push that soonish. Unless... I would use something in the middle. I really don't like code duplication and looking at the two functions, the grep work is clearly duplicated in [v2]. So as you proposed, use either 'dd' or 'sed'. But basically, I would take any of the two patches (as they work) rather than make you to work on this too much - so I am OK if you choose what you like better. Thanks for your work, Pavel From unknown Mon Jun 23 18:33:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13472: [PATCH] libtool: speed up by pre-cutting sed's input by dd Resent-From: Peter Rosin Original-Sender: "Debbugs-submit" Resent-CC: bug-libtool@gnu.org Resent-Date: Tue, 06 May 2014 07:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13472 X-GNU-PR-Package: libtool X-GNU-PR-Keywords: To: Nick Bowler Cc: Pavel Raiskup , control@debbugs.gnu.org, 13472@debbugs.gnu.org, 16662@debbugs.gnu.org Received: via spool by 13472-submit@debbugs.gnu.org id=B13472.139936229012536 (code B ref 13472); Tue, 06 May 2014 07:45:01 +0000 Received: (at 13472) by debbugs.gnu.org; 6 May 2014 07:44:50 +0000 Received: from localhost ([127.0.0.1]:52311 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wha3S-0003G2-7p for submit@debbugs.gnu.org; Tue, 06 May 2014 03:44:49 -0400 Received: from mail.lysator.liu.se ([130.236.254.3]:50871) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wha3M-0003Ff-7l; Tue, 06 May 2014 03:44:44 -0400 Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id B4AC940042; Tue, 6 May 2014 09:44:38 +0200 (CEST) Received: from [192.168.0.68] (90-227-119-221-no95.business.telia.com [90.227.119.221]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 7A52940040; Tue, 6 May 2014 09:44:36 +0200 (CEST) Message-ID: <536892E2.5040604@lysator.liu.se> Date: Tue, 06 May 2014 09:44:34 +0200 From: Peter Rosin User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 References: <5107F2FB.50103@lysator.liu.se> <683610949.2m6zIZog4y@unused-4-121.brq.redhat.com> <2406035.DfkmgaF2Wx@unused-4-121.brq.redhat.com> <1706515.fgxXn01m9q@praiskup.usersys.redhat.com> <52FA61F2.9030009@lysator.liu.se> <52FD0781.7070006@lysator.liu.se> <52FD229B.5020300@lysator.liu.se> In-Reply-To: Content-Type: multipart/mixed; boundary="------------030401060304080109010303" X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) This is a multi-part message in MIME format. --------------030401060304080109010303 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit close 13472 close 16662 stop On 2014-02-14 17:43, Nick Bowler wrote: > On 2/13/14, Peter Rosin wrote: >> On 2014-02-13 18:57, Peter Rosin wrote: >>> Ok, everybody seems happy. But not me, not 100% anyway. This introduces >>> an extra fork, and AFAICT, the "extra protection" is only needed when >>> func_lalib_p is called from func_ltwrapper_script_p. Should we perhaps >>> have a separate implementation in func_ltwrapper_script_p instead of >>> simply calling func_lalib_p? >>> >>> Maybe we could also lose the "sed -e 4q" part when dd limits the size? >> >> *snip* outline, real patch attached instead... >> >> Now, which patch should I push? > > The new looks a bit nicer to me although I have not tested it. > > One comment I have that applies to both patches... you should probably > be using AC_CHECK_PROGS instead of AC_PATH_PROG because the latter > requires an absolute filename. > > Specifically, AC_PATH_PROG will ignore any user-set value for DD if > it's not absolute. Ok, I'm reviving this old thing once again. There were two minor complaints with the last patch, this patch addresses both. I.e. 1. DD=dd now works to override the dd check, you don't need to specify a full path. 2. The code duplication between func_lalib_p and func_ltwrapper_script_p has been factored out. However, to address the first point, I made use of the AC_PATH_PROGS_FEATURE_CHECK macro, which was added in Autoconf 2.62, which Libtool didn't require before. But 2.62 is 6 years old by now. If anyone has problems with that, we will have to fix it later as I'm now pushing this thing. It's been brewing for far too long already... Final version attached. Cheers, Peter --------------030401060304080109010303 Content-Type: text/x-patch; name="0001-libtool-speed-up-ltwrapper_script-detection-in-execu.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename*0="0001-libtool-speed-up-ltwrapper_script-detection-in-execu.pa"; filename*1="tch" >From da30ce4dc9554c80f1931600af2b8bbab486476e Mon Sep 17 00:00:00 2001 From: Peter Rosin Date: Tue, 6 May 2014 00:03:19 +0200 Subject: [PATCH] libtool: speed up ltwrapper_script detection in execute mode Execute mode is slow and might even DOS the computer in extreme cases when a parameter is a big binary file without newlines. Work around this with different truncation if a suitable dd utility is found. Fixes bug#13472 and bug#16662. Reported by Pavel Raiskup and Nick Bowler. * m4/libtool.m4 (_LT_PATH_DD): New macro, for finding a dd utility that works for the below purpose. (_LT_CMD_TRUNCATE): New macro, for finding out how to truncate binary pipes (fallback to the old sed truncation if no suitable dd is found in _LT_PATH_DD). (_LT_SETUP): Require _LT_CMD_TRUNCATE. (LT_INIT): Require Autoconf 2.62, as needed by _LT_PATH_DD. * build_aux/ltmain.in (func_lalib_p): Factor out the actual "generated by libtool" test into... (func_generated_by_libtool_p): ...this new function... (func_ltwrapper_script_p): ...so that it can be reused here, when truncating the pipe according to _LT_CMD_TRUNCATE. * THANKS: Update. Signed-off-by: Peter Rosin --- THANKS | 2 ++ build-aux/ltmain.in | 14 +++++++++++--- m4/libtool.m4 | 40 +++++++++++++++++++++++++++++++++++++++- 3 files changed, 52 insertions(+), 4 deletions(-) diff --git a/THANKS b/THANKS index e895aee..85c5150 100644 --- a/THANKS +++ b/THANKS @@ -150,6 +150,7 @@ Mike Gorchak mike@malva.ua Mike Frysinger vapier@gentoo.org Mike Miller mtmiller@ieee.org + Nick Bowler nbowler@draconx.ca Nix nix@esperi.org.uk Olaf Lenz olenz@fias.uni-frankfurt.de Olly Betts olly@muscat.co.uk @@ -161,6 +162,7 @@ Paul Eggert eggert@twinsun.com Paul Laight plaight@quantxautomation.co.uk Paul Seidler sepek@lavabit.com + Pavel Raiskup praiskup@redhat.com Paweł Daniluk pawel@bioexploratorium.pl Peter Eisentraut peter_e@gmx.net Peter Fritzsche peter.fritzsche@gmx.de diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in index 3a0fb0c..6af4087 100644 --- a/build-aux/ltmain.in +++ b/build-aux/ltmain.in @@ -570,6 +570,14 @@ $1 _LTECHO_EOF' } +# func_generated_by_libtool +# True iff stdin has been generated by Libtool. This function is only +# a basic sanity check; it will hardly flush out determined imposters. +func_generated_by_libtool_p () +{ + $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 +} + # func_lalib_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function is only a basic sanity check; it will hardly flush out @@ -577,8 +585,7 @@ _LTECHO_EOF' func_lalib_p () { test -f "$1" && - $SED -e 4q "$1" 2>/dev/null \ - | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 + $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p } # func_lalib_unsafe_p file @@ -610,7 +617,8 @@ func_lalib_unsafe_p () # determined imposters. func_ltwrapper_script_p () { - func_lalib_p "$1" + test -f "$1" && + $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p } # func_ltwrapper_executable_p file diff --git a/m4/libtool.m4 b/m4/libtool.m4 index ce58f31..0454030 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -59,7 +59,7 @@ esac # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], -[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl @@ -169,6 +169,7 @@ m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl +m4_require([_LT_CMD_TRUNCATE])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options that allow our @@ -3216,6 +3217,43 @@ _LT_TAGDECL([], [reload_cmds], [2])dnl ])# _LT_CMD_RELOAD +# _LT_PATH_DD +# ----------- +# find a working dd +m4_defun([_LT_PATH_DD], +[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD], +[printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +: ${lt_DD:=$DD} +AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], +[if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: +fi]) +rm -f conftest.i conftest2.i conftest.out]) +])# _LT_PATH_DD + + +# _LT_CMD_TRUNCATE +# ---------------- +# find command to truncate a binary pipe +m4_defun([_LT_CMD_TRUNCATE], +[m4_require([_LT_PATH_DD]) +AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], +[printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +lt_cv_truncate_bin= +if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" +fi +rm -f conftest.i conftest2.i conftest.out +test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) +_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], + [Command to truncate a binary pipe]) +])# _LT_CMD_TRUNCATE + + # _LT_CHECK_MAGIC_METHOD # ---------------------- # how to check for library dependencies -- 1.7.9 --------------030401060304080109010303--