From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25921 invoked by alias); 4 Aug 2014 23:37:03 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 25906 invoked by uid 89); 4 Aug 2014 23:37:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS,URIBL_BLACK autolearn=no version=3.3.2 X-HELO: mail-vc0-f174.google.com Received: from mail-vc0-f174.google.com (HELO mail-vc0-f174.google.com) (209.85.220.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 04 Aug 2014 23:36:59 +0000 Received: by mail-vc0-f174.google.com with SMTP id la4so256749vcb.33 for ; Mon, 04 Aug 2014 16:36:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=e+fimFSshuN9ZY2B5ughN4VyZACBGJNLvHwFLdIXWuQ=; b=ULO3LqP2eIt8e0GZiPuHyzto9NZeulQvGlLQiM3u/9KFd57uaUh1wtGEj+IAJk2k5A kNQckEqTtbsdzGFfccN1My7/lFQPtuQY7b0bQHnlsDifGAKWZzg0Su5fcDF0EzbwFmSC /ZliBG/jlgFLaMztcmBEravlzhRuphWxGWLAccsCmzXr7XxWs0Iezev+4FygUULgKENi +yKhbwkHJbsa7DArO8nuO+N/dOUSi7kktPYx0Q0Wrmgwr3+BCUn8bQIU9EXyjD/h5Dta M65DNiDy8OZ5utpxBez8QXrF4HSoW42cRoQfPiTqiCCmbimi16CMSuJIkzBtGcMGb/Q/ cN7w== X-Gm-Message-State: ALoCoQn/CMSEnlht64zZ1GhdAjr54ihqFyoug73tGVt78TEY5sDfKUe1UPNKgJUGRD6J5dg5RfaJ MIME-Version: 1.0 X-Received: by 10.52.5.40 with SMTP id p8mr92791vdp.28.1407195417320; Mon, 04 Aug 2014 16:36:57 -0700 (PDT) Received: by 10.52.28.233 with HTTP; Mon, 4 Aug 2014 16:36:57 -0700 (PDT) In-Reply-To: <20140804202907.GA2608@host2.jankratochvil.net> References: <20140804202907.GA2608@host2.jankratochvil.net> Date: Mon, 04 Aug 2014 23:37:00 -0000 Message-ID: Subject: Re: [patch] Fix --with-babeltrace with gcc-4.9.1 From: Doug Evans To: Jan Kratochvil Cc: gdb-patches Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2014-08/txt/msg00046.txt.bz2 On Mon, Aug 4, 2014 at 1:29 PM, Jan Kratochvil wrote: > Hi, > > when I tried to use --with-babeltrace on Fedora Rawhide x86_64 > using gcc-4.9.1-3.fc22.x86_64 I got: > > checking for libbabeltrace... no > configure: error: babeltrace is missing or unusable > Makefile:7973: recipe for target 'configure-gdb' failed > > configure:15890: checking for libbabeltrace > configure:15918: gcc -o conftest -O2 -g -pipe -Wall -Werror=3Dformat-secu= rity -Wp,-D_FORTIFY_SOURCE=3D2 -fexceptions -fstack-protector-strong --para= m=3Dssp-buffer-size=3D4 -grecord-gcc-switches -m64 -mtune=3Dgeneric -Wer= ror -static-libstdc++ -static-libgcc -Wl,-z,relro conftest.c -lselinux= -lncurses -lz -lm -ldl /usr/lib64/libbabeltrace.so /usr/lib64/libbabelt= race-ctf.so >&5 > conftest.c: In function 'main': > conftest.c:198:21: error: unused variable 'pos' [-Werror=3Dunused-variabl= e] > struct bt_iter_pos *pos =3D bt_iter_get_pos (bt_ctf_get_iter (NULL)); > ^ > cc1: all warnings being treated as errors > configure:15918: $? =3D 1 > configure: failed program was: > > The patch below fixes it for me. > > In configure.ac there is above this check: > # Append -Werror to CFLAGS so that configure can catch the warning > # "assignment from incompatible pointer type", which is related to > # the babeltrace change from 1.0.3 to 1.1.0. Babeltrace 1.1.0 works > # in GDB, while babeltrace 1.0.3 is broken. > # AC_LIB_HAVE_LINKFLAGS may modify CPPFLAGS in it, so it should be > # safe to save and restore CFLAGS here. > saved_CFLAGS=3D$CFLAGS > CFLAGS=3D"$CFLAGS -Werror" > > Maybe it would be easier to use there: > CFLAGS=3D"$CFLAGS -Werror -Wno-unused-variable" > > But maybe -Werror is cross-compiler compatible while -Wno-unused-variable= is > not, I have no idea. > > > Jan > > gdb/ > 2014-08-04 Jan Kratochvil > > * configure.ac (--with-babeltrace): Use 'pos'. > * configure: Regenerate. > > diff --git a/gdb/configure.ac b/gdb/configure.ac > index 70d0964..07d2f00 100644 > --- a/gdb/configure.ac > +++ b/gdb/configure.ac > @@ -2437,6 +2437,7 @@ else > struct bt_ctf_event *event =3D NULL; > const struct bt_definition *scope; > > + (void) pos; /* Prevent -Werror=3Dunused-variable.= */ > scope =3D bt_ctf_get_top_level_scope (event, > BT_STREAM_EVEN= T_HEADER); > bt_ctf_get_uint64 (bt_ctf_get_field (event, scope= , "id")); > diff --git a/gdb/configure b/gdb/configure > index 809326a..b983d16 100755 > --- a/gdb/configure > +++ b/gdb/configure > @@ -15344,6 +15344,7 @@ struct bt_iter_pos *pos =3D bt_iter_get_pos (bt_c= tf_get_iter (NULL)); > struct bt_ctf_event *event =3D NULL; > const struct bt_definition *scope; > > + (void) pos; /* Prevent -Werror=3Dunused-variable.= */ > scope =3D bt_ctf_get_top_level_scope (event, > BT_STREAM_EVEN= T_HEADER); > bt_ctf_get_uint64 (bt_ctf_get_field (event, scope= , "id")); > I don't know enough about babeltrace to say whether we can just remove pos altogether. I'm happy with the patch as is though.