[OE-core] [PATCH 2/2] libx11: fix nativesdk build on older distros

Saul Wold sgw at linux.intel.com
Mon Sep 24 21:52:47 UTC 2012


On 09/24/2012 12:55 PM, Matthew McClintock wrote:
> 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 at freescale.com>
> ---
>   .../xorg-lib/libx11/use_host_cc_for_utils.patch    |   12 ++++++++++++
>   meta/recipes-graphics/xorg-lib/libx11_1.5.0.bb     |    3 ++-
>   2 files changed, 14 insertions(+), 1 deletion(-)
>   create mode 100644 meta/recipes-graphics/xorg-lib/libx11/use_host_cc_for_utils.patch
>
> diff --git a/meta/recipes-graphics/xorg-lib/libx11/use_host_cc_for_utils.patch b/meta/recipes-graphics/xorg-lib/libx11/use_host_cc_for_utils.patch
> new file mode 100644
> index 0000000..08ba39a
> --- /dev/null
> +++ b/meta/recipes-graphics/xorg-lib/libx11/use_host_cc_for_utils.patch

This patch needs a header!


> @@ -0,0 +1,12 @@
> +Index: libX11-1.5.0/src/Makefile.am
> +===================================================================
> +--- libX11-1.5.0.orig/src/Makefile.am
> ++++ libX11-1.5.0/src/Makefile.am
> +@@ -420,6 +420,6 @@ ks_tables.h: $(KEYSYMDEFS) $(top_builddi
> + 	mv ks_tables_h $@
> +
> + $(top_builddir)/src/util/makekeys$(EXEEXT): force
> +-	cd util && $(MAKE)
> ++	cd util && $(MAKE) CC=gcc CCLD=gcc LDFLAGS= CFLAGS=-D_GNU_SOURCE

Is hardcoding 'gcc' here really the right thing to do?
> +
> + force:
> diff --git a/meta/recipes-graphics/xorg-lib/libx11_1.5.0.bb b/meta/recipes-graphics/xorg-lib/libx11_1.5.0.bb
> index 94e2051..3e00dd8 100644
> --- a/meta/recipes-graphics/xorg-lib/libx11_1.5.0.bb
> +++ b/meta/recipes-graphics/xorg-lib/libx11_1.5.0.bb
> @@ -1,11 +1,12 @@
>   require libx11.inc
>   inherit gettext
>
> -PR = "${INC_PR}.2"
> +PR = "${INC_PR}.3"
>
>   BBCLASSEXTEND = "native nativesdk"
>
>   SRC_URI += "file://keysymdef_include.patch"
> +SRC_URI_append_virtclass-nativesdk += "file://use_host_cc_for_utils.patch"
>
>   SRC_URI[md5sum] = "78b4b3bab4acbdf0abcfca30a8c70cc6"
>   SRC_URI[sha256sum] = "c382efd7e92bfc3cef39a4b7f1ecf2744ba4414a705e3bc1e697f75502bd4d86"
>




More information about the Openembedded-core mailing list