On Wed, Sep 06, 2017 at 11:25:40AM +0000, Thorsten LIEPERT wrote:
> Signed-off-by: Thorsten Liepert <thorsten.liep...@diehl.com>
> ---
> .../0001-Fix-dl-cross-compiling-issue.patch        | 62 ++++++++++++++
> ...0002-Fix-strcasestr-cross-compiling-issue.patch | 96 ++++++++++++++++++++++
> patches/php-5.6.31/series                          |  4 +
> rules/php5.make                                    | 14 ++--
> 4 files changed, 170 insertions(+), 6 deletions(-)
> create mode 100644 patches/php-5.6.31/0001-Fix-dl-cross-compiling-issue.patch
> create mode 100644 
> patches/php-5.6.31/0002-Fix-strcasestr-cross-compiling-issue.patch
> create mode 100755 patches/php-5.6.31/series
> 
> diff --git a/patches/php-5.6.31/0001-Fix-dl-cross-compiling-issue.patch 
> b/patches/php-5.6.31/0001-Fix-dl-cross-compiling-issue.patch
> new file mode 100644
> index 000000000..ff1391f37
> --- /dev/null
> +++ b/patches/php-5.6.31/0001-Fix-dl-cross-compiling-issue.patch

Please create patches with proper patch headers and a patch descriptions
that explains why this is needed.

> @@ -0,0 +1,62 @@
> +diff -u --recursive php-5.6.27-vanilla/configure.in php-5.6.27/configure.in
> +--- php-5.6.27-vanilla/configure.in  2015-02-26 22:10:51.865487530 -0500
> ++++ php-5.6.27/configure.in  2015-02-26 22:29:59.043102135 -0500
> +@@ -453,7 +453,10 @@
> + PHP_CHECK_FUNC(gethostbyaddr, nsl)
> + PHP_CHECK_FUNC(yp_get_default_domain, nsl)
> +
> +-PHP_CHECK_FUNC(dlopen, dl)
> ++PHP_ADD_LIBRARY(dl)
> ++PHP_DEF_HAVE(dlopen)
> ++PHP_DEF_HAVE(libdl)
> ++ac_cv_func_dlopen=yes
> + if test "$ac_cv_func_dlopen" = "yes"; then
> +   AC_DEFINE(HAVE_LIBDL, 1, [ ])
> + fi
> +diff -u --recursive php-5.6.27-vanilla/ext/fileinfo/config.m4 
> php-5.6.27/ext/fileinfo/config.m4
> +--- php-5.6.27-vanilla/ext/fileinfo/config.m4        2015-02-26 
> 22:10:51.639487135 -0500
> ++++ php-5.6.27/ext/fileinfo/config.m4        2015-02-26 22:22:47.645609128 
> -0500
> +@@ -46,6 +46,10 @@
> +     AC_MSG_RESULT(no)
> +     AC_MSG_NOTICE(using libmagic strcasestr implementation)
> +     libmagic_sources="$libmagic_sources libmagic/strcasestr.c"
> ++  ],[
> ++    dnl cross-compiling; assume not present
> ++    AC_MSG_NOTICE(using libmagic strcasestr implementation)
> ++    libmagic_sources="$libmagic_sources libmagic/strcasestr.c"
> +   ])
> +
> +   PHP_NEW_EXTENSION(fileinfo, fileinfo.c $libmagic_sources, 
> $ext_shared,,-I@ext_srcdir@/libmagic)
> +diff -u --recursive php-5.6.27-vanilla/ext/opcache/config.m4 
> php-5.6.27/ext/opcache/config.m4
> +--- php-5.6.27-vanilla/ext/opcache/config.m4 2015-02-26 22:10:51.790487399 
> -0500
> ++++ php-5.6.27/ext/opcache/config.m4 2015-02-26 22:34:19.240414394 -0500
> +@@ -341,7 +341,14 @@
> +     flock_type=linux
> +     AC_DEFINE([HAVE_FLOCK_LINUX], [], [Struct flock is Linux-type])
> +     AC_MSG_RESULT("yes")
> +-], AC_MSG_RESULT("no") )
> ++], [
> ++    AC_MSG_RESULT("no")
> ++], [
> ++    dnl cross-compiling; assume Linux
> ++    flock_type=linux
> ++    AC_DEFINE([HAVE_FLOCK_LINUX], [], [Struct flock is Linux-type])
> ++    AC_MSG_RESULT("yes")
> ++])
> +
> + AC_MSG_CHECKING("whether flock struct is BSD ordered")
> + AC_TRY_RUN([
> +@@ -357,7 +364,12 @@
> +     flock_type=bsd
> +     AC_DEFINE([HAVE_FLOCK_BSD], [], [Struct flock is BSD-type])
> +     AC_MSG_RESULT("yes")
> +-], AC_MSG_RESULT("no") )
> ++], [
> ++    AC_MSG_RESULT("no")
> ++], [
> ++    dnl cross-compiling; assume Linux
> ++    AC_MSG_RESULT("no")
> ++])
> +
> + if test "$flock_type" = "unknown"; then
> +     AC_MSG_ERROR([Don't know how to define struct flock on this system[,] 
> set --enable-opcache=no])
> diff --git 
> a/patches/php-5.6.31/0002-Fix-strcasestr-cross-compiling-issue.patch 
> b/patches/php-5.6.31/0002-Fix-strcasestr-cross-compiling-issue.patch
> new file mode 100644
> index 000000000..4b6791c54
> --- /dev/null
> +++ b/patches/php-5.6.31/0002-Fix-strcasestr-cross-compiling-issue.patch
> @@ -0,0 +1,96 @@
> +Index: php-5.6.27/configure

Don't patch configure. It should be regenerated with a autogen.sh script.

> +===================================================================
> +--- php-5.6.27.orig/configure        2016-09-15 21:43:51.000000000 +0000
> ++++ php-5.6.27/configure     2016-09-22 11:46:15.811307808 +0000
> +@@ -36580,10 +36580,9 @@
> +   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strcasestr" >&5
> + $as_echo_n "checking for strcasestr... " >&6; }
> +   if test "$cross_compiling" = yes; then :
> +-  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
> +-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
> +-as_fn_error $? "cannot run test program while cross compiling
> +-See \`config.log' for more details" "$LINENO" 5 ; }
> ++  { $as_echo "$as_me:${as_lineno-$LINENO}: cannot run test program while 
> cross compiling, assume true" >&5
> ++$as_echo_n "cannot run test program while cross compiling, assume true" 
> >&6; }
> ++  PHP_FILEINFO_STRCASESTR_SUPPORT="yes"
> + else
> +   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> + /* end confdefs.h.  */
> +@@ -36615,7 +36614,10 @@
> +
> + _ACEOF
> + if ac_fn_c_try_run "$LINENO"; then :
> ++  PHP_FILEINFO_STRCASESTR_SUPPORT="yes"
> ++fi
> +
> ++if test "$PHP_FILEINFO_STRCASESTR_SUPPORT" != "no"; then
> +         { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
> + $as_echo "yes" >&6; }
> +
> +@@ -109867,7 +109869,7 @@
> +
> +     if test $supports_anon_versioning = yes; then
> +       archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
> +-  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> 
> $output_objdir/$libname.ver~
> ++  cat $export_symbols | sed -e "s/\(.*\)/'"$ac_symprfx"'\1;/" >> 
> $output_objdir/$libname.ver~
> +   $echo "local: *; };" >> $output_objdir/$libname.ver~
> +       $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs 
> $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script 
> ${wl}$output_objdir/$libname.ver -o $lib'
> +     fi
> +@@ -110721,7 +110723,7 @@
> +   sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
> + fi
> + need_lib_prefix=unknown
> +-hardcode_into_libs=no
> ++hardcode_into_libs="no"
> +
> + # when you set need_version to no, make sure it does not cause -set_version
> + # flags to be left without arguments
> +@@ -112259,16 +112261,16 @@
> + hardcode_action=$hardcode_action
> +
> + # Whether we should hardcode library paths into libraries.
> +-hardcode_into_libs=$hardcode_into_libs
> ++hardcode_into_libs="no"
> +
> + # Flag to hardcode \$libdir into a binary during linking.
> + # This must work even if \$libdir does not exist.
> +-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
> ++hardcode_libdir_flag_spec=""
> +
> + # If ld is used when linking, flag to hardcode \$libdir into
> + # a binary during linking. This must work even if \$libdir does
> + # not exist.
> +-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
> ++hardcode_libdir_flag_spec_ld=""
> +
> + # Whether we need a single -rpath flag with a separated argument.
> + hardcode_libdir_separator=$lt_hardcode_libdir_separator
> +@@ -114355,7 +114357,7 @@
> + sys_lib_dlsearch_path_spec="/lib /usr/lib"
> +
> + need_lib_prefix=unknown
> +-hardcode_into_libs=no
> ++hardcode_into_libs="no"
> +
> + # when you set need_version to no, make sure it does not cause -set_version
> + # flags to be left without arguments
> +@@ -115283,16 +115285,16 @@
> + hardcode_action=$hardcode_action_CXX
> +
> + # Whether we should hardcode library paths into libraries.
> +-hardcode_into_libs=$hardcode_into_libs
> ++hardcode_into_libs="no"
> +
> + # Flag to hardcode \$libdir into a binary during linking.
> + # This must work even if \$libdir does not exist.
> +-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
> ++hardcode_libdir_flag_spec=""
> +
> + # If ld is used when linking, flag to hardcode \$libdir into
> + # a binary during linking. This must work even if \$libdir does
> + # not exist.
> +-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
> ++hardcode_libdir_flag_spec_ld=""
> +
> + # Whether we need a single -rpath flag with a separated argument.
> + hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
> diff --git a/patches/php-5.6.31/series b/patches/php-5.6.31/series
> new file mode 100755
> index 000000000..6f3edba51
> --- /dev/null
> +++ b/patches/php-5.6.31/series
> @@ -0,0 +1,4 @@
> +#tag:base --start-number 1
> +#tag:debian --start-number 1
> +0001-Fix-dl-cross-compiling-issue.patch
> +0002-Fix-strcasestr-cross-compiling-issue.patch
> diff --git a/rules/php5.make b/rules/php5.make
> index cc9dc8e10..df4e92390 100644
> --- a/rules/php5.make
> +++ b/rules/php5.make
> @@ -18,12 +18,13 @@ PACKAGES-$(PTXCONF_PHP5) += php5
> #
> # Paths and names
> #
> -PHP5_VERSION := 5.5.30
> -PHP5_MD5     := ef6d848756ea9d19b7a7e1a9d824d7c1
> -PHP5         := php-$(PHP5_VERSION)
> -PHP5_SUFFIX  := tar.xz
> -PHP5_SOURCE  := $(SRCDIR)/$(PHP5).$(PHP5_SUFFIX)
> -PHP5_DIR     := $(BUILDDIR)/$(PHP5)
> +PHP5_VERSION         := 5.6.31
> +PHP5_MD5             := b3e6f548a7a47e9917279d50889b9a4a
> +PHP5                 := php-$(PHP5_VERSION)
> +PHP5_SUFFIX          := tar.xz
> +PHP5_SOURCE          := $(SRCDIR)/$(PHP5).$(PHP5_SUFFIX)
> +PHP5_DIR             := $(BUILDDIR)/$(PHP5)
> +PHP5_LICENSE         := PHP License
> 
> #
> # Note: older releases are moved to the 'museum', but the 'de.php.net'
> @@ -48,6 +49,7 @@ PHP5_CONF_ENV := \
> #
> PHP5_AUTOCONF := \
>       $(CROSS_AUTOCONF_USR) \
> +     --target= \

This seems strange, why is this needed?

Michael

>       --disable-phar \
>       --with-config-file-path=/etc/php5 \
>       --enable-opcache=no \
> --
> 2.13.0
> 
> Diehl AKO Stiftung & Co. KG, Pfannerstraße 75-83, 88239 Wangen im Allgäu
> Bereichsvorstand: Dipl.-Ing. Michael Siedentop (Sprecher), Josef Fellner 
> (Mitglied)
> Sitz der Gesellschaft: Wangen i.A. – Registergericht: Amtsgericht Ulm HRA 
> 620609 – Persönlich haftende Gesellschafterin: Diehl Verwaltungs-Stiftung – 
> Sitz: Nürnberg – Registergericht: Amtsgericht Nürnberg HRA 11756 –
> Vorstand: Dr.-Ing. E.h. Thomas Diehl (†) (Vorsitzender), Herr 
> Dipl.-Wirtsch.-Ing. Wolfgang Weggen (stellvertretender Vorsitzender), 
> Dipl.-Kfm. Claus Günther, Dipl.-Kfm. Frank Gutzeit, Dr.-Ing. Heinrich Schunk, 
> Dr.-Ing. Michael Siedentop , Dipl.-Kfm. Dr.-Ing. Martin Sommer, Dipl.-Ing. 
> (FH) Rainer von Borstel, Vorsitzender des Aufsichtsrates: Dr. Klaus Maier
> ___________________________________________________________________________________________________
> Der Inhalt der vorstehenden E-Mail ist nicht rechtlich bindend. Diese E-Mail 
> enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen.
> Informieren Sie uns bitte, wenn Sie diese E-Mail faelschlicherweise erhalten 
> haben. Bitte loeschen Sie in diesem Fall die Nachricht. Jede unerlaubte Form 
> der Reproduktion, Bekanntgabe, Aenderung, Verteilung und/oder Publikation 
> dieser E-Mail ist strengstens untersagt.
> The contents of the above mentioned e-mail is not legally binding. This 
> e-mail contains confidential and/or legally protected information. Please 
> inform us if you have received this e-mail by mistake and delete it in such a 
> case. Each unauthorized reproduction, disclosure, alteration, distribution 
> and/or publication of this e-mail is strictly prohibited.



> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

Reply via email to