From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8026 invoked by alias); 21 Feb 2011 18:45:01 -0000 Received: (qmail 7959 invoked by uid 22791); 21 Feb 2011 18:45:01 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 21 Feb 2011 18:44:57 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p1LIilF9011015 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 21 Feb 2011 13:44:47 -0500 Received: from host1.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p1LIijd5027083 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 21 Feb 2011 13:44:47 -0500 Received: from host1.dyn.jankratochvil.net (localhost [127.0.0.1]) by host1.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p1LIiiBc032289; Mon, 21 Feb 2011 19:44:45 +0100 Received: (from jkratoch@localhost) by host1.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id p1LIiiCH032288; Mon, 21 Feb 2011 19:44:44 +0100 Date: Mon, 21 Feb 2011 18:58:00 -0000 From: Jan Kratochvil To: Yao Qi Cc: Tom Tromey , gdb-patches@sourceware.org Subject: [patch] Regression on CFLAGS=-m32 build [Re: [rfa/rfc] Build libcommon.a for gdb and gdbserver] Message-ID: <20110221184444.GA4349@host1.dyn.jankratochvil.net> References: <4D30E23F.3080103@codesourcery.com> <4D34C9DE.3040603@codesourcery.com> <4D375F44.70504@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D375F44.70504@codesourcery.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes 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 X-SW-Source: 2011-02/txt/msg00557.txt.bz2 Hi Yao, wrt commit 8c5a634bffb212fadf96c090f12551160fffca3f 2011-02-11 Yao Qi * Makefile.in: Remove signals.o from COMMON_OBS. Link libcommon.a. * configure.ac: Add common to sub dir. * configure: Regenerate. common/ 2011-02-11 Yao Qi Build libcommon.a. * Makefile.in: New. * configure.ac: New. * aclocal.m4: New. * configure: Generate. gdbserver/ 2011-02-11 Yao Qi * configure.ac: Call AC_PROG_RANLIB. * Makefile.in: Remove signals.o from OBS. Link libcommon.a. * configure: Regenerate. there is a regression for common/ as it no longer uses @CFLAGS@ now. This will crash compilation on x86_64 box using: CFLAGS=-m32 ./configure i386-unknown-linux-gnu;make -> common/libcommon.a: could not read symbols: File in wrong format -> libcommon/signals.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped I put $(CFLAGS) to the end, so that a user can override other options. Currently in gdb/Makefile.in $(CFLAGS) is at the beginning of the line. It may all get obsoleted soon by Tom's automake. I will check it in today with no comments, it seems serious + safe to me. Thanks, Jan gdb/ 2011-02-21 Jan Kratochvil * common/Makefile.in (CFLAGS): New. (COMPILE): Add $(CFLAGS). --- a/gdb/common/Makefile.in +++ b/gdb/common/Makefile.in @@ -23,6 +23,10 @@ AUTOHEADER = @AUTOHEADER@ RANLIB = @RANLIB@ COMMON_CPU_OBJ = @COMMON_CPU_OBJ@ +# CFLAGS is specifically reserved for setting from the command line +# when running make. I.E. "make CFLAGS=-Wmissing-prototypes". +CFLAGS = @CFLAGS@ + BFD_DIR = ../../bfd BFD_SRC = $(srcdir)/$(BFD_DIR) BFD_CFLAGS = -I$(BFD_DIR) -I$(BFD_SRC) @@ -37,7 +41,8 @@ all: libcommon.a signals.o: $(srcdir)/signals.c $(COMPILE) $(srcdir)/signals.c -COMPILE = source='$<' object='$@' libtool=no $(CC) $(DEFS) $(INCLUDES) @GDB_FLAGS@ $(CPPFLAGS) $(ALL_CFLAGS) -c +COMPILE = source='$<' object='$@' libtool=no $(CC) $(DEFS) $(INCLUDES) \ + @GDB_FLAGS@ $(CPPFLAGS) $(ALL_CFLAGS) $(CFLAGS) -c # Implicit rules