| Message ID | 1353058866-28499-1-git-send-email-thomas.petazzoni@free-electrons.com |
|---|---|
| State | Superseded |
| Headers | show |
diff --git a/util/Makefile.am b/util/Makefile.am index dedfa6b..cc6f3fc 100644 --- a/util/Makefile.am +++ b/util/Makefile.am @@ -10,7 +10,6 @@ EXTRA_DIST = \ StrDefs.ht \ string.list -AM_CFLAGS = $(XT_CFLAGS) makestrs_SOURCES = makestrs.c diff --git a/util/makestrs.c b/util/makestrs.c index a52866a..00c861f 100644 --- a/util/makestrs.c +++ b/util/makestrs.c @@ -27,7 +27,6 @@ in this Software without prior written authorization from The Open Group. /* Constructs string definitions */ #include <stdio.h> -#include <X11/Xos.h> #include <stdlib.h> #include <unistd.h>
Hello, Anyone for this basic libXt patch? Thanks, Thomas On Fri, 16 Nov 2012 10:41:06 +0100, Thomas Petazzoni wrote: > The line: > > AM_CFLAGS = $(XT_CFLAGS) > > in util/Makefile.am is wrong because it adds target cflags to the > compilation of makestrs, which is built for the build machine, which > leads to build failures when cross-compiling. > > We also remove the inclusion of <X11/Xos.h> from makestrs.c, because > it was the only non-standard header being included (and therefore > possibly requiring special cflags), but it was in reality not useful > at all to build makestrs.c. > > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> > --- > util/Makefile.am | 1 - > util/makestrs.c | 1 - > 2 files changed, 2 deletions(-) > > diff --git a/util/Makefile.am b/util/Makefile.am > index dedfa6b..cc6f3fc 100644 > --- a/util/Makefile.am > +++ b/util/Makefile.am > @@ -10,7 +10,6 @@ EXTRA_DIST = \ > StrDefs.ht \ > string.list > > -AM_CFLAGS = $(XT_CFLAGS) > makestrs_SOURCES = makestrs.c > > > diff --git a/util/makestrs.c b/util/makestrs.c > index a52866a..00c861f 100644 > --- a/util/makestrs.c > +++ b/util/makestrs.c > @@ -27,7 +27,6 @@ in this Software without prior written authorization from The Open Group. > /* Constructs string definitions */ > > #include <stdio.h> > -#include <X11/Xos.h> > #include <stdlib.h> > #include <unistd.h> >
On 19/11/2012 22:46, Thomas Petazzoni wrote: > Hello, > > Anyone for this basic libXt patch? > > Thanks, > > Thomas > > On Fri, 16 Nov 2012 10:41:06 +0100, Thomas Petazzoni wrote: >> The line: >> >> AM_CFLAGS = $(XT_CFLAGS) >> >> in util/Makefile.am is wrong because it adds target cflags to the >> compilation of makestrs, which is built for the build machine, which >> leads to build failures when cross-compiling. >> >> We also remove the inclusion of <X11/Xos.h> from makestrs.c, because >> it was the only non-standard header being included (and therefore >> possibly requiring special cflags), but it was in reality not useful >> at all to build makestrs.c. It was useful in including string.h, and hence preventing a load of warnings :-), so perhaps you could include that instead. I'm not sure I totally buy your reasoning, as X11/Xos.h might be doing something necessary on some obscure platform. Does makekeys in libX11 present similar problems?
Dear Jon TURNEY, On Wed, 21 Nov 2012 14:19:53 +0000, Jon TURNEY wrote: > It was useful in including string.h, and hence preventing a load of warnings > :-), so perhaps you could include that instead. > > I'm not sure I totally buy your reasoning, as X11/Xos.h might be doing > something necessary on some obscure platform. The reasoning is that XT_CFLAGS adds a -I path that points to the target headers, which creates build failures because makestrs is built for the build machine (and not the machine targeted by the cross compilation). See the end of http://autobuild.buildroot.org/results/2815885d589d75259508bcce4f272b8dddb3be77/build.log.bz2 for details. You see that we're building makestrs (for the build machine, with the native gcc), but it includes things from /home/test/test/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/include/stdio.h which is the sysroot of the cross-compilation toolchain. This is incorrect. If X11/Xos.h is really needed, then those XT_CFLAGS should be modified to point to the build machine headers. But since X11/Xos.h is really not needed to build makestrs, I'm not sure there's a point. Though, adding <string.h> would indeed be good, as you suggested. Best regards, Thomas
On Fri, Nov 16, 2012 at 10:41:06AM +0100, Thomas Petazzoni wrote: > The line: > > AM_CFLAGS = $(XT_CFLAGS) > > in util/Makefile.am is wrong because it adds target cflags to the > compilation of makestrs, which is built for the build machine, which > leads to build failures when cross-compiling. > > We also remove the inclusion of <X11/Xos.h> from makestrs.c, because > it was the only non-standard header being included (and therefore > possibly requiring special cflags), but it was in reality not useful > at all to build makestrs.c. > > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> With Jon's comment addressed, this patch is: Reviewed-by: Thierry Reding <thierry.reding@avionic-design.de> Tested-by: Thierry Reding <thierry.reding@avionic-design.de> I've tested for x86_64 -> x86 and for x86_64 -> ARM cross-builds. Thierry
The line: AM_CFLAGS = $(XT_CFLAGS) in util/Makefile.am is wrong because it adds target cflags to the compilation of makestrs, which is built for the build machine, which leads to build failures when cross-compiling. We also remove the inclusion of <X11/Xos.h> from makestrs.c, because it was the only non-standard header being included (and therefore possibly requiring special cflags), but it was in reality not useful at all to build makestrs.c. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> --- util/Makefile.am | 1 - util/makestrs.c | 1 - 2 files changed, 2 deletions(-)