Re: [PATCH 22/30] perf tools: bfd.h/libbfd detection fails withrecent binutils

From: Markus Trippelsdorf
Date: Tue Sep 25 2012 - 02:47:23 EST


On 2012.09.24 at 19:58 -0400, Mike Frysinger wrote:
> On Monday 24 September 2012 11:59:36 Arnaldo Carvalho de Melo wrote:
> > --- a/tools/perf/Makefile
> > +++ b/tools/perf/Makefile
> >
> > - FLAGS_BFD=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) -lbfd
> > + FLAGS_BFD=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) -DPACKAGE='perf' -
>
> in this case, if you were to expand PACKAGE, you'd get back the symbol perf
> (which most likely will be an error, but maybe it won't). i think this should
> be instead:
> -DPACKAGE='"perf"'
>
> > --- a/tools/perf/util/symbol.h
> > +++ b/tools/perf/util/symbol.h
> >
> > +#define PACKAGE 'perf'
>
> this isn't valid C anywhere. pretty sure this should be:
> #define PACKAGE "perf"

The only thing that's really important is that PACKAGE isn't NULL,
because it's just a workaround for this brilliant gem from bfd.h:

35 /* PR 14072: Ensure that config.h is included first. */
36 #if !defined PACKAGE && !defined PACKAGE_VERSION
37 #error config.h must be included before this header
38 #endif

So if you feel strongly about it, feel free to post a patch that just
sets PACKAGE to 1. This would avoid all possible ambiguity.

--
Markus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/