From 71e0a1789c2fa17a84f1dc838ed6d544aa9635fb13a2a83388656a2fdbd84353 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Tue, 30 May 2017 05:54:16 +0000 Subject: [PATCH] Accepting request 499580 from home:Heinervdm:branches:electronics Add Patch to build with gperf >= 3.1 OBS-URL: https://build.opensuse.org/request/show/499580 OBS-URL: https://build.opensuse.org/package/show/electronics/crosstool-ng?expand=0&rev=12 --- crosstool-ng-gperf-fix.patch | 101 +++++++++++++++++++++++++++++++++++ crosstool-ng.changes | 8 +++ crosstool-ng.spec | 5 +- 3 files changed, 113 insertions(+), 1 deletion(-) create mode 100644 crosstool-ng-gperf-fix.patch diff --git a/crosstool-ng-gperf-fix.patch b/crosstool-ng-gperf-fix.patch new file mode 100644 index 0000000..27b629d --- /dev/null +++ b/crosstool-ng-gperf-fix.patch @@ -0,0 +1,101 @@ +diff -urd crosstool-ng.orig/configure crosstool-ng.new/configure +--- crosstool-ng.orig/configure 2015-11-20 14:03:36.000000000 +0100 ++++ crosstool-ng.new/configure 2017-05-27 10:12:40.383087059 +0200 +@@ -635,6 +635,7 @@ + lzma + xz + kconfig_options ++GPERF_LEN_TYPE + automake + LIBTOOLIZE + LIBTOOL +@@ -5331,6 +5332,27 @@ + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_automake" >&5 + $as_echo "$ac_cv_path_automake" >&6; } + automake=$ac_cv_path_automake ++ ++ ++#---------------------------------------- ++# Gperf 3.1 started generating functions with size_t rather than unsigned int ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the type used in gperf declarations" >&5 ++$as_echo_n "checking for the type used in gperf declarations... " >&6; } ++echo "#include " > conftest.gperf.c ++echo "const char * in_word_set(const char *, GPERF_LEN_TYPE);" >> conftest.gperf.c ++echo foo,bar | ${GPERF} -L ANSI-C >> conftest.gperf.c ++if ${CC} -c -o /dev/null conftest.gperf.c -DGPERF_LEN_TYPE='size_t' >/dev/null 2>&1; then : ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: size_t" >&5 ++$as_echo "size_t" >&6; } ++ GPERF_LEN_TYPE='size_t' ++elif ${CC} -c -o /dev/null conftest.gperf.c -DGPERF_LEN_TYPE='unsigned int' >/dev/null 2>&1; then : ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsigned int" >&5 ++$as_echo "unsigned int" >&6; } ++ GPERF_LEN_TYPE='unsigned int' ++else ++ as_fn_error $? "unable to determine gperf len type" "$LINENO" 5 ++fi ++rm -f conftest.gperf.c + + + #-------------------------------------------------------------------- +diff -urd crosstool-ng.orig/configure.ac crosstool-ng.new/configure.ac +--- crosstool-ng.orig/configure.ac 2015-11-18 06:29:15.000000000 +0100 ++++ crosstool-ng.new/configure.ac 2017-05-27 10:00:57.411342197 +0200 +@@ -290,6 +290,22 @@ + AC_MSG_ERROR([could not find GNU automake >= 1.10])])]) + AC_SUBST([automake], [$ac_cv_path_automake]) + ++#---------------------------------------- ++# Gperf 3.1 started generating functions with size_t rather than unsigned int ++AC_MSG_CHECKING([for the type used in gperf declarations]) ++echo "#include " > conftest.gperf.c ++echo "const char * in_word_set(const char *, GPERF_LEN_TYPE);" >> conftest.gperf.c ++echo foo,bar | ${GPERF} -L ANSI-C >> conftest.gperf.c ++AS_IF([${CC} -c -o /dev/null conftest.gperf.c -DGPERF_LEN_TYPE='size_t' >/dev/null 2>&1], ++ [AC_MSG_RESULT([size_t]) ++ GPERF_LEN_TYPE='size_t'], ++ [${CC} -c -o /dev/null conftest.gperf.c -DGPERF_LEN_TYPE='unsigned int' >/dev/null 2>&1], ++ [AC_MSG_RESULT([unsigned int]) ++ GPERF_LEN_TYPE='unsigned int'], ++ [AC_MSG_ERROR([unable to determine gperf len type])]) ++rm -f conftest.gperf.c ++AC_SUBST([GPERF_LEN_TYPE]) ++ + #-------------------------------------------------------------------- + # Boring again... But still a bit of work to do... + #-------------------------------------------------------------------- +diff -urd crosstool-ng.orig/kconfig/Makefile crosstool-ng.new/kconfig/Makefile +--- crosstool-ng.orig/kconfig/Makefile 2015-11-18 06:29:15.000000000 +0100 ++++ crosstool-ng.new/kconfig/Makefile 2017-05-27 10:00:57.411342197 +0200 +@@ -6,7 +6,8 @@ + @true # Just be silent, you fscking son of a fscking beach... + + # Build flags +-CFLAGS = -DCONFIG_=\"CT_\" -DPACKAGE="\"crosstool-NG $(VERSION)\"" ++CFLAGS = -DCONFIG_=\"CT_\" -DPACKAGE="\"crosstool-NG $(VERSION)\"" \ ++ -DGPERF_LEN_TYPE="$(gperf_len_type)" + LDFLAGS = $(INTL_LIBS) + + # Compiler flags to use gettext +diff -urd crosstool-ng.orig/kconfig/zconf.gperf crosstool-ng.new/kconfig/zconf.gperf +--- crosstool-ng.orig/kconfig/zconf.gperf 2015-11-18 06:29:15.000000000 +0100 ++++ crosstool-ng.new/kconfig/zconf.gperf 2017-05-27 10:00:57.411342197 +0200 +@@ -9,7 +9,7 @@ + + struct kconf_id; + +-static const struct kconf_id *kconf_id_lookup(register const char *str, register unsigned int len); ++static const struct kconf_id *kconf_id_lookup(register const char *str, register GPERF_LEN_TYPE len); + + %% + mainmenu, T_MAINMENU, TF_COMMAND +diff -urd crosstool-ng.orig/Makefile.in crosstool-ng.new/Makefile.in +--- crosstool-ng.orig/Makefile.in 2015-11-19 23:43:15.000000000 +0100 ++++ crosstool-ng.new/Makefile.in 2017-05-27 10:00:57.411342197 +0200 +@@ -69,6 +69,7 @@ + export readelf := @READELF@ + export patch := @PATCH@ + export gperf := @GPERF@ ++export gperf_len_type := @GPERF_LEN_TYPE@ + export CC := @CC@ + export CPP := @CPP@ + export CPPFLAGS := @CPPFLAGS@ diff --git a/crosstool-ng.changes b/crosstool-ng.changes index 2bb6afa..de66301 100644 --- a/crosstool-ng.changes +++ b/crosstool-ng.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Fri May 26 19:27:55 UTC 2017 - bugs@vdm-design.de + +- Add patch (crosstool-ng-gperf-fix.patch) to fix build + with gpref version >= 3.1, based on upstream commit + https://github.com/crosstool-ng/crosstool-ng/commit/3bb2bcd2a328fb56332398783e91899ce3bc3556 + + ------------------------------------------------------------------- Sun Jan 1 00:02:42 UTC 2017 - bwiedemann@suse.com diff --git a/crosstool-ng.spec b/crosstool-ng.spec index d65f978..b9eff94 100644 --- a/crosstool-ng.spec +++ b/crosstool-ng.spec @@ -1,7 +1,7 @@ # # spec file for package crosstool-ng # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -26,6 +26,8 @@ Url: http://crosstool-ng.org Source0: http://crosstool-ng.org/download/crosstool-ng/%{name}-%{version}.tar.bz2 # PATCH-FIX-TO-UPSTREAM -- bmwiedemann Patch0: reproducible.patch +# PATCH-FIX-UPSTREAM crosstool-ng-gperf-fix.patch bugs@vdm-design.de -- fixes build with gperf >= 3.1 +Patch1: crosstool-ng-gperf-fix.patch BuildRequires: bison BuildRequires: fdupes BuildRequires: flex @@ -54,6 +56,7 @@ in the resulting binary/ies: static libraries are but an example. %prep %setup -qn %{name} %patch0 -p1 +%patch1 -p1 # from legal team # "Distribution and use is free, also for commercial purposes" (no modification permission) find patches/ -name '*-new-valencian-locale.patch' -type f -delete -print