unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#25803: ./configure CFLAGS=-ggdb3 fails 'guile-snarf'
@ 2017-02-19 22:36 Sergei Trofimovich
  2017-02-19 22:58 ` bug#25803: [PATCH] guile-snarf: skip -g* arguments to avoid build failure Sergei Trofimovich
  2017-04-21 15:00 ` bug#25803: guile-snarf now fails when passed arguments contains whitespace Ludovic Courtès
  0 siblings, 2 replies; 4+ messages in thread
From: Sergei Trofimovich @ 2017-02-19 22:36 UTC (permalink / raw)
  To: 25803

[-- Attachment #1: Type: text/plain, Size: 1091 bytes --]

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

[-- Attachment #2: Цифровая подпись OpenPGP --]
[-- Type: application/pgp-signature, Size: 163 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#25803: [PATCH] guile-snarf: skip -g* arguments to avoid build failure
  2017-02-19 22:36 bug#25803: ./configure CFLAGS=-ggdb3 fails 'guile-snarf' Sergei Trofimovich
@ 2017-02-19 22:58 ` Sergei Trofimovich
  2017-04-19 15:20   ` Andy Wingo
  2017-04-21 15:00 ` bug#25803: guile-snarf now fails when passed arguments contains whitespace Ludovic Courtès
  1 sibling, 1 reply; 4+ messages in thread
From: Sergei Trofimovich @ 2017-02-19 22:58 UTC (permalink / raw)
  To: 25803; +Cc: Sergei Trofimovich

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@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






^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#25803: [PATCH] guile-snarf: skip -g* arguments to avoid build failure
  2017-02-19 22:58 ` bug#25803: [PATCH] guile-snarf: skip -g* arguments to avoid build failure Sergei Trofimovich
@ 2017-04-19 15:20   ` Andy Wingo
  0 siblings, 0 replies; 4+ messages in thread
From: Andy Wingo @ 2017-04-19 15:20 UTC (permalink / raw)
  To: Sergei Trofimovich; +Cc: 25803-done

On Sun 19 Feb 2017 23:58, Sergei Trofimovich <slyfox@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





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#25803: guile-snarf now fails when passed arguments contains whitespace
  2017-02-19 22:36 bug#25803: ./configure CFLAGS=-ggdb3 fails 'guile-snarf' Sergei Trofimovich
  2017-02-19 22:58 ` bug#25803: [PATCH] guile-snarf: skip -g* arguments to avoid build failure Sergei Trofimovich
@ 2017-04-21 15:00 ` Ludovic Courtès
  1 sibling, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2017-04-21 15:00 UTC (permalink / raw)
  To: 25803

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’.





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-04-21 15:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-19 22:36 bug#25803: ./configure CFLAGS=-ggdb3 fails 'guile-snarf' Sergei Trofimovich
2017-02-19 22:58 ` bug#25803: [PATCH] guile-snarf: skip -g* arguments to avoid build failure Sergei Trofimovich
2017-04-19 15:20   ` Andy Wingo
2017-04-21 15:00 ` bug#25803: guile-snarf now fails when passed arguments contains whitespace Ludovic Courtès

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).