From unknown Tue Jun 24 17:28:25 2025 X-Loop: help-debbugs@gnu.org Subject: bug#8473: depcomp bug with HP-UX cc and VPATH build Resent-From: Bruno Haible Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-automake@gnu.org Resent-Date: Mon, 11 Apr 2011 00:45:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 8473 X-GNU-PR-Package: automake X-GNU-PR-Keywords: To: 8473@debbugs.gnu.org X-Debbugs-Original-To: bug-automake@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.130248270425395 (code B ref -1); Mon, 11 Apr 2011 00:45:06 +0000 Received: (at submit) by debbugs.gnu.org; 11 Apr 2011 00:45:04 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q95FY-0006bX-4O for submit@debbugs.gnu.org; Sun, 10 Apr 2011 20:45:04 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q95FV-0006as-U9 for submit@debbugs.gnu.org; Sun, 10 Apr 2011 20:45:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q95FP-0006ZN-EZ for submit@debbugs.gnu.org; Sun, 10 Apr 2011 20:44:56 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:58410) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q95FP-0006ZJ-CZ for submit@debbugs.gnu.org; Sun, 10 Apr 2011 20:44:55 -0400 Received: from [140.186.70.92] (port=54791 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q95FO-0008CZ-2T for bug-automake@gnu.org; Sun, 10 Apr 2011 20:44:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q95FM-0006YN-S3 for bug-automake@gnu.org; Sun, 10 Apr 2011 20:44:53 -0400 Received: from mo-p00-ob.rzone.de ([81.169.146.160]:15616) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q95FM-0006WF-EF for bug-automake@gnu.org; Sun, 10 Apr 2011 20:44:52 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1302482690; l=1901; s=domk; d=haible.de; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Date:Subject:To: From:X-RZG-CLASS-ID:X-RZG-AUTH; bh=WHlHXfMbOkkBb9/iW9kwVLuq+Mw=; b=qB4wnHmNw7cBz+QwLnrkVXcGPcg8h01lNx8HtVkKzwGOgF3/n47M9yDU3FSR62m3cYU 9qDZIZwrQMg0S8/6Nyx8FVKNOgws/aO88jxntaxnUvpMTRGOWb2P8ws3Yx7LnbzSjAVzA 7aPmRxrA/HBHE2+QG/j/VKj44Ki1yeANM9g= X-RZG-AUTH: :Ln4Re0+Ic/6oZXR1YgKryK8brksyK8dozXDwHXjf9hj/zDJRaPAl/HgmxFw= X-RZG-CLASS-ID: mo00 Received: from linuix.haible.de (dslb-088-069-163-162.pools.arcor-ip.net [88.69.163.162]) by post.strato.de (klopstock mo22) (RZmta 25.10) with ESMTPA id R02264n3AKTves ; Mon, 11 Apr 2011 02:44:50 +0200 (MEST) From: Bruno Haible Date: Mon, 11 Apr 2011 02:44:48 +0200 User-Agent: KMail/1.9.9 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201104110244.49008.bruno@clisp.org> X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 199.232.76.165 X-Spam-Score: -5.8 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 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.8 (-----) Hi, The dependencies mechanism of Automake leads to a compilation failure when used in a VPATH build (with GNU make, of course) and HP-UX cc. The failure occurs during the third command of this command sequence: $ gmake $ gmake clean $ gmake ... gmake[4]: Entering directory `/tmp/testdir1/build-vpath/gllib' source='../../gllib/nonblocking.c' object='../../gllib/nonblocking.o' libtool=no \ DEPDIR=.deps depmode=hp /bin/sh ../../build-aux/depcomp \ cc -Ae -O -DHAVE_CONFIG_H -I. -I../../gllib -I.. -DGNULIB_STRICT_CHECKING=1 -g -c ../../gllib/nonblocking.c cpp: "", line 0: error 4066: Cannot create "../../gllib/.deps/nonblocking.TPo" file for "-M../../gllib/.deps/nonblocking.TPo" option. (No such file or directory[errno=2]) gmake[4]: *** [../../gllib/nonblocking.o] Error 1 Relevant software in use: $ automake --version automake (GNU automake) 1.11.1 $ autoconf --version autoconf (GNU Autoconf) 2.68 $ uname -sr HP-UX B.11.00 $ gmake --version GNU Make version 3.79.1, by Richard Stallman and Roland McGrath. Built for hppa1.1-hp-hpux11.00 $ what `which cc` /opt/ansic/bin/cc: $Revision: 92453-07 linker linker crt0.o B.11.47 051104 $ LINT B.11.X.35098-35101.GP CXREF B.11.X.35098-35101.GP HP92453-01 B.11.X.35098-35101.GP HP C Compiler $ PATCH/11.00:PHCO_27774 Oct 3 2002 09:45:59 $ How to reproduce: - Create a gnulib testdir for module 'nonblocking'. $ ./gnulib-tool --create-testdir --dir=/tmp/testdir nonblocking - Transport it to the HP-UX 11.00 machine. - On this machine, start 'bash', then $ export PATH=/opt/langtools/bin:$PATH $ export CC="cc -Ae -O" $ mkdir build-vpath $ cd build-vpath $ ../configure $ gmake $ gmake clean $ gmake In a build with $(builddir) = $(srcdir), there is no problem. Bruno -- In memoriam Hendrik Nicolaas Werkman From unknown Tue Jun 24 17:28:25 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Bruno Haible Subject: bug#8473: closed (Re: bug#8473: depcomp bug with HP-UX cc and VPATH build) Message-ID: References: <20110411051300.GA3087@gmx.de> <201104110244.49008.bruno@clisp.org> X-Gnu-PR-Message: they-closed 8473 X-Gnu-PR-Package: automake Reply-To: 8473@debbugs.gnu.org Date: Mon, 11 Apr 2011 05:14:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1302498842-15245-1" This is a multi-part message in MIME format... ------------=_1302498842-15245-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #8473: depcomp bug with HP-UX cc and VPATH build which was filed against the automake package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 8473@debbugs.gnu.org. --=20 8473: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D8473 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1302498842-15245-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 8473-done) by debbugs.gnu.org; 11 Apr 2011 05:13:14 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q99R4-0003wq-3I for submit@debbugs.gnu.org; Mon, 11 Apr 2011 01:13:14 -0400 Received: from mailout-de.gmx.net ([213.165.64.22]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1Q99R1-0003wd-6s for 8473-done@debbugs.gnu.org; Mon, 11 Apr 2011 01:13:12 -0400 Received: (qmail invoked by alias); 11 Apr 2011 05:13:05 -0000 Received: from xdsl-89-0-155-246.netcologne.de (EHLO localhost.localdomain) [89.0.155.246] by mail.gmx.net (mp016) with SMTP; 11 Apr 2011 07:13:05 +0200 X-Authenticated: #13673931 X-Provags-ID: V01U2FsdGVkX18ADn0n9LMAsqjB5hN0ooduD6TAWQMn2B/th+Hbpo h0QrIisbrHhlB7 Received: from ralf by localhost.localdomain with local (Exim 4.72) (envelope-from ) id 1Q99Qq-00012K-MV; Mon, 11 Apr 2011 07:13:00 +0200 Date: Mon, 11 Apr 2011 07:13:00 +0200 From: Ralf Wildenhues To: Bruno Haible , automake-patches@gnu.org Subject: Re: bug#8473: depcomp bug with HP-UX cc and VPATH build Message-ID: <20110411051300.GA3087@gmx.de> Mail-Followup-To: Bruno Haible , automake-patches@gnu.org, 8473-done@debbugs.gnu.org References: <201104110244.49008.bruno@clisp.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201104110244.49008.bruno@clisp.org> Organization: Institute for Numerical Simulation, University of Bonn User-Agent: Mutt/1.5.20 (2010-08-04) X-Y-GMX-Trusted: 0 X-Spam-Score: -2.9 (--) X-Debbugs-Envelope-To: 8473-done Cc: 8473-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 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.9 (--) Hi Bruno, * Bruno Haible wrote on Mon, Apr 11, 2011 at 02:44:48AM CEST: > The dependencies mechanism of Automake leads to a compilation failure when > used in a VPATH build (with GNU make, of course) Actually, in this case you could have avoided this particular bug by using HP make. :-p Automake still strives to be portable to non-GNU make, even if you have decided to (understandably) not worry about the numerous and hideous VPATH issues. > source='../../gllib/nonblocking.c' object='../../gllib/nonblocking.o' libtool=no \ > DEPDIR=.deps depmode=hp /bin/sh ../../build-aux/depcomp \ > cc -Ae -O -DHAVE_CONFIG_H -I. -I../../gllib -I.. -DGNULIB_STRICT_CHECKING=1 -g -c ../../gllib/nonblocking.c > cpp: "", line 0: error 4066: Cannot create "../../gllib/.deps/nonblocking.TPo" file for "-M../../gllib/.deps/nonblocking.TPo" option. (No such file or directory[errno=2]) > gmake[4]: *** [../../gllib/nonblocking.o] Error 1 How nice, I just fixed a similar bug in makedepend mode last week. I'm pushing this to maint (and merging to branch-1.11 and master) to fix the above. Thanks for the report, Ralf Fix hp depmode for VPATH builds with GNU make. * lib/depcomp: Be sure to remove VPATH-prefixed object from dependency output when creating stub rule. * tests/depcomp10.test: New test. * tests/Makefile.am (TESTS): Update. * NEWS: Update. Report by Bruno Haible. diff --git a/NEWS b/NEWS index 3cd5ab0..c8219bd 100644 --- a/NEWS +++ b/NEWS @@ -57,7 +57,7 @@ Bugs fixed in 1.11.0a: - The parallel-tests driver now does not produce erroneous results with Tru64/OSF 5.1 sh upon unreadable log files any more. - - The makedepend depmode now works better with VPATH builds. + - The makedepend and hp depmodes now works better with VPATH builds. - Java sources specified with check_JAVA are not compiled anymore upon "make all", but only upon "make check". diff --git a/lib/depcomp b/lib/depcomp index 8097c19..e996e5d 100755 --- a/lib/depcomp +++ b/lib/depcomp @@ -1,7 +1,7 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2011-04-09-11; # UTC +scriptversion=2011-04-11-05; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2011, # Free Software Foundation, Inc. @@ -158,10 +158,12 @@ gcc) ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as -## well. +## well. hp depmode also adds that space, but also prefixes the VPATH +## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + sed -e 's/^\\$//' -e '/^$/d' -e -e "s|.*$object$||" '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; diff --git a/tests/Makefile.am b/tests/Makefile.am index bf07f2b..4e87805 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -278,6 +278,7 @@ depcomp7.test \ depcomp8a.test \ depcomp8b.test \ depcomp9.test \ +depcomp10.test \ depdist.test \ depend.test \ depend2.test \ diff --git a/tests/depcomp10.test b/tests/depcomp10.test new file mode 100644 index 0000000..4fdee40 --- /dev/null +++ b/tests/depcomp10.test @@ -0,0 +1,81 @@ +#! /bin/sh +# Copyright (C) 2011 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# hp depmode should work with GNU make in VPATH mode (bug similar to +# depcomp9.test). + +# Here's the bug: hp depmode will prefix VPATH to the object file name, +# thus the second gmake will invoke depcomp with object='../../src/foo.o', +# causing errors such as: +# cpp: "", line 0: error 4066: Cannot create "../../gllib/.deps/nonblocking.TPo" file for "-M../../gllib/.deps/nonblocking.TPo" option. (No such file or dir ++ectory[errno=2]) + +required=GNUmake +. ./defs || Exit 1 + +mkdir src src/sub build + +cat >> configure.in << 'END' +AC_PROG_CC +AM_PROG_CC_C_O +AC_CONFIG_FILES([src/Makefile]) +AC_OUTPUT +END + +cat > Makefile.am << 'END' +SUBDIRS = src +END + +cat > src/Makefile.am << 'END' +AUTOMAKE_OPTIONS = subdir-objects +bin_PROGRAMS = foo +foo_SOURCES = foo.c foo.h sub/subfoo.c +END + +cat > src/foo.h <src/foo.c <src/sub/subfoo.c <out 2>&1 || { cat out; Exit 1; } +cat out +grep 'src/[._]deps' out && Exit 1 + +: ------------=_1302498842-15245-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 11 Apr 2011 00:45:04 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q95FY-0006bX-4O for submit@debbugs.gnu.org; Sun, 10 Apr 2011 20:45:04 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q95FV-0006as-U9 for submit@debbugs.gnu.org; Sun, 10 Apr 2011 20:45:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q95FP-0006ZN-EZ for submit@debbugs.gnu.org; Sun, 10 Apr 2011 20:44:56 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:58410) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q95FP-0006ZJ-CZ for submit@debbugs.gnu.org; Sun, 10 Apr 2011 20:44:55 -0400 Received: from [140.186.70.92] (port=54791 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q95FO-0008CZ-2T for bug-automake@gnu.org; Sun, 10 Apr 2011 20:44:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q95FM-0006YN-S3 for bug-automake@gnu.org; Sun, 10 Apr 2011 20:44:53 -0400 Received: from mo-p00-ob.rzone.de ([81.169.146.160]:15616) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q95FM-0006WF-EF for bug-automake@gnu.org; Sun, 10 Apr 2011 20:44:52 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1302482690; l=1901; s=domk; d=haible.de; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Date:Subject:To: From:X-RZG-CLASS-ID:X-RZG-AUTH; bh=WHlHXfMbOkkBb9/iW9kwVLuq+Mw=; b=qB4wnHmNw7cBz+QwLnrkVXcGPcg8h01lNx8HtVkKzwGOgF3/n47M9yDU3FSR62m3cYU 9qDZIZwrQMg0S8/6Nyx8FVKNOgws/aO88jxntaxnUvpMTRGOWb2P8ws3Yx7LnbzSjAVzA 7aPmRxrA/HBHE2+QG/j/VKj44Ki1yeANM9g= X-RZG-AUTH: :Ln4Re0+Ic/6oZXR1YgKryK8brksyK8dozXDwHXjf9hj/zDJRaPAl/HgmxFw= X-RZG-CLASS-ID: mo00 Received: from linuix.haible.de (dslb-088-069-163-162.pools.arcor-ip.net [88.69.163.162]) by post.strato.de (klopstock mo22) (RZmta 25.10) with ESMTPA id R02264n3AKTves ; Mon, 11 Apr 2011 02:44:50 +0200 (MEST) From: Bruno Haible To: bug-automake@gnu.org Subject: depcomp bug with HP-UX cc and VPATH build Date: Mon, 11 Apr 2011 02:44:48 +0200 User-Agent: KMail/1.9.9 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201104110244.49008.bruno@clisp.org> X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 199.232.76.165 X-Spam-Score: -5.8 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 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.8 (-----) Hi, The dependencies mechanism of Automake leads to a compilation failure when used in a VPATH build (with GNU make, of course) and HP-UX cc. The failure occurs during the third command of this command sequence: $ gmake $ gmake clean $ gmake ... gmake[4]: Entering directory `/tmp/testdir1/build-vpath/gllib' source='../../gllib/nonblocking.c' object='../../gllib/nonblocking.o' libtool=no \ DEPDIR=.deps depmode=hp /bin/sh ../../build-aux/depcomp \ cc -Ae -O -DHAVE_CONFIG_H -I. -I../../gllib -I.. -DGNULIB_STRICT_CHECKING=1 -g -c ../../gllib/nonblocking.c cpp: "", line 0: error 4066: Cannot create "../../gllib/.deps/nonblocking.TPo" file for "-M../../gllib/.deps/nonblocking.TPo" option. (No such file or directory[errno=2]) gmake[4]: *** [../../gllib/nonblocking.o] Error 1 Relevant software in use: $ automake --version automake (GNU automake) 1.11.1 $ autoconf --version autoconf (GNU Autoconf) 2.68 $ uname -sr HP-UX B.11.00 $ gmake --version GNU Make version 3.79.1, by Richard Stallman and Roland McGrath. Built for hppa1.1-hp-hpux11.00 $ what `which cc` /opt/ansic/bin/cc: $Revision: 92453-07 linker linker crt0.o B.11.47 051104 $ LINT B.11.X.35098-35101.GP CXREF B.11.X.35098-35101.GP HP92453-01 B.11.X.35098-35101.GP HP C Compiler $ PATCH/11.00:PHCO_27774 Oct 3 2002 09:45:59 $ How to reproduce: - Create a gnulib testdir for module 'nonblocking'. $ ./gnulib-tool --create-testdir --dir=/tmp/testdir nonblocking - Transport it to the HP-UX 11.00 machine. - On this machine, start 'bash', then $ export PATH=/opt/langtools/bin:$PATH $ export CC="cc -Ae -O" $ mkdir build-vpath $ cd build-vpath $ ../configure $ gmake $ gmake clean $ gmake In a build with $(builddir) = $(srcdir), there is no problem. Bruno -- In memoriam Hendrik Nicolaas Werkman ------------=_1302498842-15245-1--