From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20664 invoked by alias); 30 Jun 2014 20:29:07 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org Received: (qmail 20616 invoked by uid 48); 30 Jun 2014 20:29:06 -0000 From: "dilyan.palauzov at aegee dot org" To: gdb-prs@sourceware.org Subject: [Bug build/17104] New: CFLAGS="-Wall -Wextra" gdb/confgure --with-babeltrace fails Date: Mon, 30 Jun 2014 20:29:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: build X-Bugzilla-Version: 7.7 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dilyan.palauzov at aegee dot org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-q2/txt/msg00516.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=17104 Bug ID: 17104 Summary: CFLAGS="-Wall -Wextra" gdb/confgure --with-babeltrace fails Product: gdb Version: 7.7 Status: NEW Severity: normal Priority: P2 Component: build Assignee: unassigned at sourceware dot org Reporter: dilyan.palauzov at aegee dot org My config.site contains export CFLAGS='-pipe -O3 -flto -Wl,-S -Wl,--hash-style=gnu -Wl,-O1 -Wl,-z,relro -Wall -Wextra' so when I run gdb-7.7.1/configure the CFLAGS are filled accordingly. When I do gdb-7.7.1/gdb/configure --with-babeltrace, the effectively executed code from gdb/configure.ac is (as in gdb-7.7.1 and currently on master): 2401 if test "x$with_babeltrace" = "xno"; then 2402 AC_MSG_WARN([babletrace support disabled; GDB is unable to read CTF data.]) 2403 else 2404 # Append -Werror to CFLAGS so that configure can catch the warning 2405 # "assignment from incompatible pointer type", which is related to 2406 # the babeltrace change from 1.0.3 to 1.1.0. Babeltrace 1.1.0 works 2407 # in GDB, while babeltrace 1.0.3 is broken. 2408 # AC_LIB_HAVE_LINKFLAGS may modify CPPFLAGS in it, so it should be 2409 # safe to save and restore CFLAGS here. 2410 saved_CFLAGS=$CFLAGS 2411 CFLAGS="$CFLAGS -Werror" 2412 AC_LIB_HAVE_LINKFLAGS([babeltrace], [babeltrace-ctf], 2413 [#include 2414 #include 2415 #include ], 2416 [struct bt_iter_pos *pos = bt_iter_get_pos (bt_ctf_get_iter (NULL)); 2417 struct bt_ctf_event *event = NULL; 2418 const struct bt_definition *scope; 2419 2420 scope = bt_ctf_get_top_level_scope (event, 2421 BT_STREAM_EVENT_HEADER); 2422 bt_ctf_get_uint64 (bt_ctf_get_field (event, scope, "id")); 2423 ]) 2424 CFLAGS=$saved_CFLAGS and config.log contains accordingly: configure:14369: checking whether to use babeltrace configure:14371: result: yes configure:14796: checking for libbabeltrace configure:14824: gcc -o conftest -pipe -O3 -flto -Wl,-S -Wl,--hash-style=gnu -Wl,-O1 -Wl,-z,relro -Wall -Wextra -Werror -L/usr/lib64 -L/lib64 conftest.c -ldl -ldl -lncurses -lz -lm /usr/lib64/libbabeltrace.so /usr/lib64/libbabeltrace-ctf.so /usr/lib64/libpopt.so /usr/lib64/libgmodule-2.0.so /lib64/libdl.so /usr/lib64/libglib-2.0.so /usr/lib64/libiconv.so /usr/lib64/libpcre.so /lib64/libpthread.so /usr/lib64/libuuid.so -Wl,-rpath -Wl,/usr/lib64 -Wl,-rpath -Wl,/lib64 >&5 conftest.c: In function 'main': conftest.c:191:21: error: unused variable 'pos' [-Werror=unused-variable] struct bt_iter_pos *pos = bt_iter_get_pos (bt_ctf_get_iter (NULL)); ^ cc1: all warnings being treated as errors configure:14824: $? = 1 configure: failed program was: What I want to say is that CFLAGS at the end has -Wall -Wextra -Werror and check fails, because the pos variable is unused, which is normally a warning, but in this case also an error (-Werror). Please ensure that running ./configure with CFLAGS='-Wall -Wextra' and gcc483 does not cause "error: unused variable 'pos' ", so that babeltrace is detected correctly. -- You are receiving this mail because: You are on the CC list for the bug.