From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46582) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4z9C-0003uQ-5S for qemu-devel@nongnu.org; Wed, 09 Jul 2014 17:11:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X4z96-0003WC-NJ for qemu-devel@nongnu.org; Wed, 09 Jul 2014 17:11:26 -0400 Received: from mail-vc0-x231.google.com ([2607:f8b0:400c:c03::231]:65033) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4z96-0003W5-GJ for qemu-devel@nongnu.org; Wed, 09 Jul 2014 17:11:20 -0400 Received: by mail-vc0-f177.google.com with SMTP id ij19so8404037vcb.36 for ; Wed, 09 Jul 2014 14:11:20 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <53BDAFF3.1080007@redhat.com> Date: Wed, 09 Jul 2014 23:11:15 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] pass $($*.o-cflags) first to gcc/g++ List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefano Stabellini , Peter Maydell Cc: xen-devel@lists.xensource.com, qemu-devel@nongnu.org Il 09/07/2014 22:34, Stefano Stabellini ha scritto: > rules.mak adds cflags specific to the target source file ($($@-cflags)) > for last on the compiler command line. > > As a consequence when compiling arm-a64.o, g++ might end up picking the > wrong utils.h header file, because it looks for utils.h on all the other > include paths first. > > Fix the issue by passing the source file specific cflags first. > Do it consisently for *.c, *.cc, etc. > > Signed-off-by: Stefano Stabellini You can just as well have a bug that requires you to put the option last (for example adding -Wno-something or -O0), which is why $($@-cflags)/$($*.o-cflags) comes last. What package is it that has the conflicting utils.h file? Any chance to get it fixed in your distro? Here I get: $ find /usr/include/ -name utils.h /usr/include/libnl3/netlink/utils.h /usr/include/libnl3/netlink/cli/utils.h /usr/include/id3/utils.h /usr/include/octave-3.6.4/octave/utils.h but none of them have the path in -I. Paolo