From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: stubdom/libxc-x86_64 compile error with valgrind installed Date: Mon, 21 Jul 2014 11:19:14 +0100 Message-ID: <53CCE922.9080109@citrix.com> References: <1216211935.20140721110014@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1216211935.20140721110014@gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Simon Martin , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 21/07/14 11:00, Simon Martin wrote: > Hello all, > > I am building on Debian Wheezy and I have valgrind installed. About a > month ago I started having compilation problems. I assume it must have > something to do with Andrew's valgrind patch of June 10th. > > The problem seems to lie in the fact that valgrind is in /usr/include, > however -nostdinc is specified on the compilation so we don't get it. > > I removed -nostdinc from stubdom/Makefile and it compiled correctly. > Reading the gcc documentation this *should* be safe, as it will only > search the default directories *after* the explicit include > directories. That being said, there is probably a better fix for this. > > Regards. > The problem is that stubdoms are blindly using the regular environment config.h without reconfiguring libxc for their reduced environment. As a result, config.h is correctly stating that memcheck.h exists in the regular environment, even when it is included into the reduced stubdom environment. While removing -nostdinc does fix your problem, it is not the correct fix. memcheck.h is safe to use in this instance, but most header files you find in /usr/include are not. I am not sure what is the correct solution here is. Introducing an explicit --{en,dis}able-valgrind to the main ./configure will still break for anyone who chooses to enable it. I suspect a fix involves someone draining the swamp which is the stubdom build system. ~Andrew