GNU bug report logs - #25803
./configure CFLAGS=-ggdb3 fails 'guile-snarf'

Previous Next

Package: guile;

Reported by: Sergei Trofimovich <slyfox <at> inbox.ru>

Date: Sun, 19 Feb 2017 22:38:01 UTC

Severity: normal

To reply to this bug, email your comments to 25803 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#25803; Package guile. (Sun, 19 Feb 2017 22:38:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Sergei Trofimovich <slyfox <at> inbox.ru>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Sun, 19 Feb 2017 22:38:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Sergei Trofimovich <slyfox <at> inbox.ru>
To: bug-guile <at> gnu.org
Subject: ./configure CFLAGS=-ggdb3 fails 'guile-snarf'
Date: Sun, 19 Feb 2017 22:36:39 +0000
[Message part 1 (text/plain, inline)]
It popped out as a
    https://bugs.gentoo.org/show_bug.cgi?id=608190
where one of packages failed to build with CFLAGS=-ggdb3 was guile-2.0.13

guile git master is also affected:

    $ ./configure CFLAGS=-ggdb3
    $ make
    make[1]: Entering directory '/home/slyfox/dev/git/guile/libguile'
      CC       libguile_2.2_la-alist.lo
    In file included from alist.c:398:0:
    ../libguile/alist.x: In function 'scm_init_alist':
    ../libguile/alist.x:2:2537: error: conflicting types for 'scm_i_foreign_call'

The problem here is in gcc -ggdb3 which leaves too much
of unrelated input. guile-snarf does not understand how to drop it:

guile/libguile $ guile-snarf alist.c -DHAVE_CONFIG_H -DBUILDING_LIBGUILE=1 -I.. -I.. -I../lib -I../lib -I/usr/lib64/libffi-3.2.1/include -I/home/slyfox/dev/git/guile -ggdb2 | wc -c
1389
guile/libguile $ guile-snarf alist.c -DHAVE_CONFIG_H -DBUILDING_LIBGUILE=1 -I.. -I.. -I../lib -I../lib -I/usr/lib64/libffi-3.2.1/include -I/home/slyfox/dev/git/guile -ggdb3 | wc -c
230085

Fails on both gcc-5.4.0 / gcc-6.3.0

-- 

  Sergei
[Message part 2 (application/pgp-signature, inline)]

Information forwarded to bug-guile <at> gnu.org:
bug#25803; Package guile. (Sun, 19 Feb 2017 22:59:01 GMT) Full text and rfc822 format available.

Message #8 received at 25803 <at> debbugs.gnu.org (full text, mbox):

From: Sergei Trofimovich <slyfox <at> gentoo.org>
To: 25803 <at> debbugs.gnu.org
Cc: Sergei Trofimovich <slyfox <at> gentoo.org>
Subject: [PATCH] guile-snarf: skip -g* arguments to avoid build failure
Date: Sun, 19 Feb 2017 22:58:40 +0000
Steps to reproduce:
    $ ./configure CFLAGS=-ggdb3
    $ make
    make[1]: Entering directory '/home/slyfox/dev/git/guile/libguile'
      CC       libguile_2.2_la-alist.lo
    In file included from alist.c:398:0:
    ../libguile/alist.x: In function 'scm_init_alist':
    ../libguile/alist.x:2:2537: error: conflicting types for 'scm_i_foreign_call'

The problem here is in gcc -ggdb3 which leaves too much
of unrelated input. guile-snarf does not understand how to drop it:

The fix is to ignore -g* flags. They should only affect debugging output.

* libguile/guile-snarf.in: skip -g* arguments to avoid build failure

Bug: https://bugs.gentoo.org/608190
Bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=25803
Signed-off-by: Sergei Trofimovich <slyfox <at> gentoo.org>
---
 libguile/guile-snarf.in | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/libguile/guile-snarf.in b/libguile/guile-snarf.in
index 47bbc0422..22dc1d389 100644
--- a/libguile/guile-snarf.in
+++ b/libguile/guile-snarf.in
@@ -95,10 +95,22 @@ if [ x"$CPP" = x ] ; then cpp="@CPP@" ; else cpp="$CPP" ; fi
 
 trap "rm -rf $tempdir" 0 1 2 15
 
+# filter out -g* flags from commandline
+# as some flags like -ggdb3 cause CPP
+
+cpp_args=""
+for arg in "$@"
+do
+    case "$arg" in
+        -g*) ;; # skip debug flag
+        *) cpp_args="$cpp_args $arg" ;;
+    esac
+done
+
 if [ ! "$outfile" = "-" ] ; then
-    modern_snarf "$@" > $outfile
+    modern_snarf $cpp_args > $outfile
 else
-    modern_snarf "$@"
+    modern_snarf $cpp_args
 fi
 
 # zonk outfile if errors occurred
-- 
2.11.1





Reply sent to Andy Wingo <wingo <at> igalia.com>:
You have taken responsibility. (Wed, 19 Apr 2017 15:21:02 GMT) Full text and rfc822 format available.

Notification sent to Sergei Trofimovich <slyfox <at> inbox.ru>:
bug acknowledged by developer. (Wed, 19 Apr 2017 15:21:02 GMT) Full text and rfc822 format available.

Message #13 received at 25803-done <at> debbugs.gnu.org (full text, mbox):

From: Andy Wingo <wingo <at> igalia.com>
To: Sergei Trofimovich <slyfox <at> gentoo.org>
Cc: 25803-done <at> debbugs.gnu.org
Subject: Re: bug#25803: [PATCH] guile-snarf: skip -g* arguments to avoid build
 failure
Date: Wed, 19 Apr 2017 17:20:27 +0200
On Sun 19 Feb 2017 23:58, Sergei Trofimovich <slyfox <at> gentoo.org> writes:

> The fix is to ignore -g* flags. They should only affect debugging output.
>
> * libguile/guile-snarf.in: skip -g* arguments to avoid build failure

Applied.  Thanks :)

Andy




Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 21 Apr 2017 14:58:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-guile <at> gnu.org:
bug#25803; Package guile. (Fri, 21 Apr 2017 15:02:01 GMT) Full text and rfc822 format available.

Message #18 received at 25803 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: 25803 <at> debbugs.gnu.org
Subject: guile-snarf now fails when passed arguments contains whitespace
Date: Fri, 21 Apr 2017 17:00:54 +0200
Hello,

Commit f775ab3654357fcaad294b95efb0b1c16de1eda8 (“guile-snarf: skip -g*
arguments to avoid build failure”) broke guile-snarf when passed
arguments with whitespace, as in:

  guile-snarf -o auth.x auth.c -DPACKAGE_STRING=\"Guile-SSH\ 0.10.2\" …

The breakage comes from the fact that arguments are accumulated in a
string, in the ‘cpp_args’ variable, so the shell loses information about
word separation.

Besides, filtering out ‘-g’ arguments seems dubious.

WDYT?

Ludo’.




This bug report was last modified 8 years and 54 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.