Patchwork [v2,10/10] libx11.inc: fix build issues for older CentOS distros

login
register
mail settings
Submitter Matthew McClintock
Date Sept. 28, 2012, 1:33 a.m.
Message ID <1348795994-21695-10-git-send-email-msm@freescale.com>
Download mbox | patch
Permalink /patch/37401/
State Accepted
Commit 83c560ae282c1a28fd2c311c66debd02a69f1678
Headers show

Comments

Matthew McClintock - Sept. 28, 2012, 1:33 a.m.
Fixes these sorts of issues present on older gcc (CentOS 5.x in this case)

| cc1: error: unrecognized command line option "-Werror=implicit"
| cc1: error: unrecognized command line option "-Werror=nonnull"
| cc1: error: unrecognized command line option "-Werror=init-self"
| cc1: error: unrecognized command line option "-Werror=main"
| cc1: error: unrecognized command line option "-Werror=missing-braces"
| cc1: error: unrecognized command line option "-Werror=sequence-point"
| cc1: error: unrecognized command line option "-Werror=return-type"
| cc1: error: unrecognized command line option "-Werror=trigraphs"
| cc1: error: unrecognized command line option "-Werror=array-bounds"
| cc1: error: unrecognized command line option "-Werror=write-strings"
| cc1: error: unrecognized command line option "-Werror=address"
| cc1: error: unrecognized command line option "-Werror=int-to-pointer-cast"
| cc1: error: unrecognized command line option "-Werror=pointer-to-int-cast"

Also fixes:

makekeys-makekeys.o: In function `main':
makekeys.c:(.text+0x85): undefined reference to `__isoc99_sscanf'
makekeys.c:(.text+0xa7): undefined reference to `__isoc99_sscanf'
collect2: ld returned 1 exit status
make: *** [makekeys] Error 1

Older libc do not have this defined, we can use the -D_GNU_SOURCE
to the compiler to prevent generating calls to this function and
make linking work

Signed-off-by: Matthew McClintock <msm@freescale.com>
---
This replaces the previous patch series that fixes libx11 issues

 meta/recipes-graphics/xorg-lib/libx11.inc |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Ross Burton - Sept. 28, 2012, 2:52 p.m.
On 28 September 2012 02:33, Matthew McClintock <msm@freescale.com> wrote:
> Fixes these sorts of issues present on older gcc (CentOS 5.x in this case)
>
> | cc1: error: unrecognized command line option "-Werror=implicit"
> | cc1: error: unrecognized command line option "-Werror=nonnull"

Took me a minute to realise why this happens.  This happens when
cross-building because although configure is checking that the flags
it uses are supported by the compiler, it's only doing that for the
cross and not the host compiler.  Right?

(upstream bug alert)

Ross
Ross Burton - Sept. 28, 2012, 2:57 p.m.
FWIW, I've just filed #55423 and #55424 upstream for these issues.

Ross
McClintock Matthew-B29882 - Sept. 28, 2012, 3:03 p.m.
On Fri, Sep 28, 2012 at 9:52 AM, Burton, Ross <ross.burton@intel.com> wrote:
> On 28 September 2012 02:33, Matthew McClintock <msm@freescale.com> wrote:
>> Fixes these sorts of issues present on older gcc (CentOS 5.x in this case)
>>
>> | cc1: error: unrecognized command line option "-Werror=implicit"
>> | cc1: error: unrecognized command line option "-Werror=nonnull"
>
> Took me a minute to realise why this happens.  This happens when
> cross-building because although configure is checking that the flags
> it uses are supported by the compiler, it's only doing that for the
> cross and not the host compiler.  Right?
>
> (upstream bug alert)

Yea,  I suppose the the host compiler should be checked by autotools
if it supports these warning flags.

-M
McClintock Matthew-B29882 - Oct. 2, 2012, 3:50 p.m.
On Fri, Sep 28, 2012 at 10:03 AM, Matthew McClintock <msm@freescale.com> wrote:
> On Fri, Sep 28, 2012 at 9:52 AM, Burton, Ross <ross.burton@intel.com> wrote:
>> On 28 September 2012 02:33, Matthew McClintock <msm@freescale.com> wrote:
>>> Fixes these sorts of issues present on older gcc (CentOS 5.x in this case)
>>>
>>> | cc1: error: unrecognized command line option "-Werror=implicit"
>>> | cc1: error: unrecognized command line option "-Werror=nonnull"
>>
>> Took me a minute to realise why this happens.  This happens when
>> cross-building because although configure is checking that the flags
>> it uses are supported by the compiler, it's only doing that for the
>> cross and not the host compiler.  Right?
>>
>> (upstream bug alert)
>
> Yea,  I suppose the the host compiler should be checked by autotools
> if it supports these warning flags.

Should this block applying this patch to oe-core or will there be
upstream fixes before 1.3?

-M
Ross Burton - Oct. 2, 2012, 3:54 p.m.
On 2 October 2012 16:50, McClintock Matthew-B29882 <B29882@freescale.com> wrote:
>> Yea,  I suppose the the host compiler should be checked by autotools
>> if it supports these warning flags.
>
> Should this block applying this patch to oe-core or will there be
> upstream fixes before 1.3?

This is the right fix for the short term, fixing upstream is more
complicated because they have the pain of Solaris to deal with.

Ross

Patch

diff --git a/meta/recipes-graphics/xorg-lib/libx11.inc b/meta/recipes-graphics/xorg-lib/libx11.inc
index 3ecd9e5..97bd1c2 100644
--- a/meta/recipes-graphics/xorg-lib/libx11.inc
+++ b/meta/recipes-graphics/xorg-lib/libx11.inc
@@ -11,7 +11,7 @@  inherit siteinfo
 FILESPATH = "${FILE_DIRNAME}/libx11"
 
 PE = "1"
-INC_PR = "r8"
+INC_PR = "r9"
 
 PROVIDES = "virtual/libx11"
 
@@ -23,6 +23,7 @@  DEPENDS += "xproto xextproto xtrans libxcb kbproto inputproto"
 DEPENDS += "xproto-native"
 
 EXTRA_OECONF += "--with-keysymdefdir=${STAGING_INCDIR}/X11/"
+EXTRA_OEMAKE += 'CWARNFLAGS=""'
 
 # Let people with incredibly archaic requirements enable Xcms and BigFont, but
 # disable them by default.
@@ -33,7 +34,7 @@  PACKAGECONFIG[bigfont] = "--enable-xf86bigfont,--disable-xf86bigfont,xf86bigfont
 # src/util/makekeys needs to be compiled natively, so tell it what compiler to
 # use.
 export CC_FOR_BUILD = "${BUILD_CC}"
-export CFLAGS_FOR_BUILD = "${BUILD_CFLAGS}"
+export CFLAGS_FOR_BUILD = "${BUILD_CFLAGS} -D_GNU_SOURCE"
 export CPPFLAGS_FOR_BUILD = "${BUILD_CPPFLAGS}"
 export LDFLAGS_FOR_BUILD = "${BUILD_LDFLAGS}"