fixes for building in long path (length = 410)
v2 cover fixes for building in long path (length = 410)
* V2:
Use '/usr/bin/env foo' rather than /usr/bin/foo or /bin/foo as shebang.
// Robert
The following changes since commit 901659a51cd53625a93f57a9c5865e90a07ec09d:
oeqa/runtime/utils/targetbuildproject: use parent classes defaults tmpdir (2017-04-06 10:13:34 +0100)
are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib rbt/long
http://cgit.openembedded.org/openembedded-core-contrib/log/?h=rbt/long
Robert Yang (7):
groff: replace "perl -w" with "use warnings"
mc: replace "perl -w" with "use warnings"
valgrind: set ac_cv_path_PERL to /usr/bin/env perl
m4: do_configure: fix "Argument list too long"
guile: do_configure: fix "Argument list too long"
autogen-native: fix POSIX_SHELL and perl
kmod: set ac_cv_path_DOLT_BASH to /usr/bin/env bash
.../autogen/autogen-native_5.18.12.bb | 3 + ...2-autoopts-mk-tpl-config.sh-fix-perl-path.patch | 32 +++++ meta/recipes-devtools/guile/guile_2.0.14.bb | 3 + meta/recipes-devtools/m4/m4-1.4.18.inc | 3 + meta/recipes-devtools/valgrind/valgrind_3.12.0.bb | 2 + .../0001-replace-perl-w-with-use-warnings.patch | 102 ++++++++++++++++ meta/recipes-extended/groff/groff_1.22.3.bb | 3 + .../0001-mc-replace-perl-w-with-use-warnings.patch | 129 +++++++++++++++++++++ meta/recipes-extended/mc/mc_4.8.18.bb | 3 + meta/recipes-kernel/kmod/kmod.inc | 2 + 10 files changed, 282 insertions(+) create mode 100644 meta/recipes-devtools/autogen/autogen/0002-autoopts-mk-tpl-config.sh-fix-perl-path.patch create mode 100644 meta/recipes-extended/groff/groff-1.22.3/0001-replace-perl-w-with-use-warnings.patch create mode 100644 meta/recipes-extended/mc/files/0001-mc-replace-perl-w-with-use-warnings.patch
Signature · 1 line
2.11.0.rc2.dirty
PATCH v2 1/7 groff: replace "perl -w" with "use warnings"
The shebang's max length is usually 128 as defined in /usr/include/linux/binfmts.h:
#define BINPRM_BUF_SIZE 128
There would be errors when @PERL@ (hostools/perl) is longer than 128, use '/usr/bin/env perl' can fix the problem, but '/usr/bin/env perl -w' doesn't work:
/usr/bin/env: perl -w: No such file or directory
So replace "perl -w" with "use warnings" to make it work.
--- .../0001-replace-perl-w-with-use-warnings.patch | 102 +++++++++++++++++++++ meta/recipes-extended/groff/groff_1.22.3.bb | 3 + 2 files changed, 105 insertions(+) create mode 100644 meta/recipes-extended/groff/groff-1.22.3/0001-replace-perl-w-with-use-warnings.patch
meta/recipes-extended/groff/groff-1.22.3/0001-replace-perl-w-with-use-warnings.patch new file +102 -0
@@ -0,0 +1,102 @@ +From 5b574542070db286c89b3827e8f15ed4b3b39034 Mon Sep 17 00:00:00 2001 +From: Robert Yang <[email protected]> +Date: Thu, 6 Apr 2017 01:46:00 -0700 +Subject: [PATCH] replace "perl -w" with "use warnings" + +The shebang's max length is usually 128 as defined in +/usr/include/linux/binfmts.h: + #define BINPRM_BUF_SIZE 128 + +There would be errors when @PERL@ is longer than 128, use +'/usr/bin/env perl' can fix the problem, but '/usr/bin/env perl -w' +doesn't work: + +/usr/bin/env: perl -w: No such file or directory + +So replace "perl -w" with "use warnings" to make it work. + +Upstream-Status: Pending + +Signed-off-by: Robert Yang <[email protected]> +--- + font/devpdf/util/BuildFoundries.pl | 3 ++- + src/devices/gropdf/gropdf.pl | 3 ++- + src/devices/gropdf/pdfmom.pl | 3 ++- + src/utils/afmtodit/afmtodit.pl | 3 ++- + 4 files changed, 8 insertions(+), 4 deletions(-) + +diff --git a/font/devpdf/util/BuildFoundries.pl b/font/devpdf/util/BuildFoundries.pl +index 39f2f0d..a2bfd8e 100644 +--- a/font/devpdf/util/BuildFoundries.pl ++++ b/font/devpdf/util/BuildFoundries.pl +@@ -1,4 +1,4 @@ +-#!/usr/bin/perl -w ++#!/usr/bin/perl + # + # BuildFoundries : Given a Foundry file generate groff and download files + # Deri James : Monday 07 Feb 2011 +@@ -22,6 +22,7 @@ + # along with this program. If not, see <http://www.gnu.org/licenses/>. + + use strict; ++use warnings; + + my $where=shift||''; + my $devps=shift||'../devps'; +diff --git a/src/devices/gropdf/gropdf.pl b/src/devices/gropdf/gropdf.pl +index 035d123..b933b32 100644 +--- a/src/devices/gropdf/gropdf.pl ++++ b/src/devices/gropdf/gropdf.pl +@@ -1,4 +1,4 @@ +-#!@PERL@ -w ++#!@PERL@ + # + # gropdf : PDF post processor for groff + # +@@ -21,6 +21,7 @@ + # along with this program. If not, see <http://www.gnu.org/licenses/>. + + use strict; ++use warnings; + use Getopt::Long qw(:config bundling); + use Compress::Zlib; + +diff --git a/src/devices/gropdf/pdfmom.pl b/src/devices/gropdf/pdfmom.pl +index beec820..4b46ea4 100644 +--- a/src/devices/gropdf/pdfmom.pl ++++ b/src/devices/gropdf/pdfmom.pl +@@ -1,4 +1,4 @@ +-#!@PERL@ -w ++#!@PERL@ + # + # pdfmom : Frontend to run groff -mom to produce PDFs + # Deri James : Friday 16 Mar 2012 +@@ -24,6 +24,7 @@ + # along with this program. If not, see <http://www.gnu.org/licenses/>. + + use strict; ++use warnings; + use File::Temp qw/tempfile/; + my @cmd; + my $dev='pdf'; +diff --git a/src/utils/afmtodit/afmtodit.pl b/src/utils/afmtodit/afmtodit.pl +index 4f2ce83..5c078ff 100644 +--- a/src/utils/afmtodit/afmtodit.pl ++++ b/src/utils/afmtodit/afmtodit.pl +@@ -1,4 +1,4 @@ +-#! /usr/bin/perl -w ++#! /usr/bin/perl + # -*- Perl -*- + # Copyright (C) 1989-2014 Free Software Foundation, Inc. + # Written by James Clark ([email protected]) +@@ -19,6 +19,7 @@ + # along with this program. If not, see <http://www.gnu.org/licenses/>. + + use strict; ++use warnings; + + @afmtodit.tables@ + +-- +2.10.2 +
meta/recipes-extended/groff/groff_1.22.3.bb +3 -0
@@ -10,6 +10,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" SRC_URI = "${GNU_MIRROR}/groff/groff-${PV}.tar.gz \ file://groff-1.22.2-correct-man.local-install-path.patch \ file://0001-Unset-need_charset_alias-when-building-for-musl.patch \ + file://0001-replace-perl-w-with-use-warnings.patch \ " SRC_URI[md5sum] = "cc825fa64bc7306a885f2fb2268d3ec5"
@@ -24,6 +25,8 @@ inherit autotools texinfo EXTRA_OECONF = "--without-x" PARALLEL_MAKE = "" +CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl'" + do_configure_prepend() { if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then sed -i \
Signature · 1 line
2.11.0.rc2.dirty
PATCH v2 2/7 mc: replace "perl -w" with "use warnings"
In reply to Robert YangThe shebang's max length is usually 128 as defined in /usr/include/linux/binfmts.h:
#define BINPRM_BUF_SIZE 128
There would be errors when @PERL@ (hostools/perl) is longer than 128, use '/usr/bin/env perl' can fix the problem, but '/usr/bin/env perl -w' doesn't work:
/usr/bin/env: perl -w: No such file or directory
So replace "perl -w" with "use warnings" to make it work.
--- .../0001-mc-replace-perl-w-with-use-warnings.patch | 129 +++++++++++++++++++++ meta/recipes-extended/mc/mc_4.8.18.bb | 3 + 2 files changed, 132 insertions(+) create mode 100644 meta/recipes-extended/mc/files/0001-mc-replace-perl-w-with-use-warnings.patch
meta/recipes-extended/mc/files/0001-mc-replace-perl-w-with-use-warnings.patch new file +129 -0
@@ -0,0 +1,129 @@ +From cdc7c278212ae836eecb4cc9d42c29443cc128a0 Mon Sep 17 00:00:00 2001 +From: Robert Yang <[email protected]> +Date: Thu, 6 Apr 2017 02:24:28 -0700 +Subject: [PATCH] mc: replace "perl -w" with "use warnings" + +The shebang's max length is usually 128 as defined in +/usr/include/linux/binfmts.h: + #define BINPRM_BUF_SIZE 128 + +There would be errors when @PERL@ is longer than 128, use +'/usr/bin/env perl' can fix the problem, but '/usr/bin/env perl -w' +doesn't work: + +/usr/bin/env: perl -w: No such file or directory + +So replace "perl -w" with "use warnings" to make it work. + +The man2hlp.in already has "use warnings;", so just remove '-w' is OK. + +Upstream-Status: Pending + +Signed-off-by: Robert Yang <[email protected]> +--- + src/man2hlp/man2hlp.in | 2 +- + src/vfs/extfs/helpers/a+.in | 4 +++- + src/vfs/extfs/helpers/mailfs.in | 3 ++- + src/vfs/extfs/helpers/patchfs.in | 3 ++- + src/vfs/extfs/helpers/ulib.in | 4 +++- + src/vfs/extfs/helpers/uzip.in | 3 ++- + 6 files changed, 13 insertions(+), 6 deletions(-) + +diff --git a/src/man2hlp/man2hlp.in b/src/man2hlp/man2hlp.in +index f095830..558a674 100644 +--- a/src/man2hlp/man2hlp.in ++++ b/src/man2hlp/man2hlp.in +@@ -1,4 +1,4 @@ +-#! @PERL@ -w ++#! @PERL@ + # + # Man page to help file converter + # Copyright (C) 1994, 1995, 1998, 2000, 2001, 2002, 2003, 2004, 2005, +diff --git a/src/vfs/extfs/helpers/a+.in b/src/vfs/extfs/helpers/a+.in +index 579441c..fe446f4 100644 +--- a/src/vfs/extfs/helpers/a+.in ++++ b/src/vfs/extfs/helpers/a+.in +@@ -1,4 +1,4 @@ +-#! @PERL@ -w ++#! @PERL@ + # + # External filesystem for mc, using mtools + # Written Ludek Brukner <[email protected]>, 1997 +@@ -9,6 +9,8 @@ + + # These mtools components must be in PATH for this to work + ++use warnings; ++ + sub quote { + $_ = shift(@_); + s/([^\w\/.+-])/\\$1/g; +diff --git a/src/vfs/extfs/helpers/mailfs.in b/src/vfs/extfs/helpers/mailfs.in +index e9455be..059f41f 100644 +--- a/src/vfs/extfs/helpers/mailfs.in ++++ b/src/vfs/extfs/helpers/mailfs.in +@@ -1,6 +1,7 @@ +-#! @PERL@ -w ++#! @PERL@ + + use bytes; ++use warnings; + + # MC extfs for (possibly compressed) Berkeley style mailbox files + # Peter Daum <[email protected]> (Jan 1998, mc-4.1.24) +diff --git a/src/vfs/extfs/helpers/patchfs.in b/src/vfs/extfs/helpers/patchfs.in +index ef407de..3ad4b53 100644 +--- a/src/vfs/extfs/helpers/patchfs.in ++++ b/src/vfs/extfs/helpers/patchfs.in +@@ -1,4 +1,4 @@ +-#! @PERL@ -w ++#! @PERL@ + # + # Written by Adam Byrtek <[email protected]>, 2002 + # Rewritten by David Sterba <[email protected]>, 2009 +@@ -9,6 +9,7 @@ + + use bytes; + use strict; ++use warnings; + use POSIX; + use File::Temp 'tempfile'; + +diff --git a/src/vfs/extfs/helpers/ulib.in b/src/vfs/extfs/helpers/ulib.in +index 418611f..82c7ccf 100644 +--- a/src/vfs/extfs/helpers/ulib.in ++++ b/src/vfs/extfs/helpers/ulib.in +@@ -1,9 +1,11 @@ +-#! @PERL@ -w ++#! @PERL@ + # + # VFS to manage the gputils archives. + # Written by Molnár Károly ([email protected]) 2012 + # + ++use warnings; ++ + my %month = ('jan' => '01', 'feb' => '02', 'mar' => '03', + 'apr' => '04', 'may' => '05', 'jun' => '06', + 'jul' => '07', 'aug' => '08', 'sep' => '09', +diff --git a/src/vfs/extfs/helpers/uzip.in b/src/vfs/extfs/helpers/uzip.in +index b1c4f90..c8eb335 100644 +--- a/src/vfs/extfs/helpers/uzip.in ++++ b/src/vfs/extfs/helpers/uzip.in +@@ -1,4 +1,4 @@ +-#! @PERL@ -w ++#! @PERL@ + # + # zip file archive Virtual File System for Midnight Commander + # Version 1.4.0 (2001-08-07). +@@ -9,6 +9,7 @@ + use POSIX; + use File::Basename; + use strict; ++use warnings; + + # + # Configuration options +-- +2.10.2 +
meta/recipes-extended/mc/mc_4.8.18.bb +3 -0
@@ -7,6 +7,7 @@ DEPENDS = "ncurses glib-2.0 util-linux" RDEPENDS_${PN} = "ncurses-terminfo" SRC_URI = "http://www.midnight-commander.org/downloads/${BPN}-${PV}.tar.bz2 \ + file://0001-mc-replace-perl-w-with-use-warnings.patch \ " SRC_URI[md5sum] = "cc56f0c9abd63c4caa3636bba3a08bfb" SRC_URI[sha256sum] = "5b591e10dcbea95233434da40cdad4663d360229adf89826576c319667c103cb"
@@ -22,6 +23,8 @@ PACKAGECONFIG[sftp] = "--enable-vfs-sftp,--disable-vfs-sftp,libssh2," EXTRA_OECONF = "--with-screen=ncurses --without-gpm-mouse --without-x" +CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl'" + do_install_append () { sed -i -e '1s,#!.*perl,#!${bindir}/env perl,' ${D}${libexecdir}/mc/extfs.d/* sed -i -e '1s,#!.*python,#!${bindir}/env python,' ${D}${libexecdir}/mc/extfs.d/*
Signature · 1 line
2.11.0.rc2.dirty
PATCH v2 3/7 valgrind: set ac_cv_path_PERL to /usr/bin/env perl
In reply to Robert YangThe shebang's max length is usually 128 as defined in /usr/include/linux/binfmts.h:
#define BINPRM_BUF_SIZE 128
So there would be errors when /path/to/hosttools/perl is longer than 128.
Set ac_cv_path_PERL to "/usr/bin/env perl" to fix the problem.
--- meta/recipes-devtools/valgrind/valgrind_3.12.0.bb | 2 ++ 1 file changed, 2 insertions(+)
meta/recipes-devtools/valgrind/valgrind_3.12.0.bb +2 -0
@@ -56,6 +56,8 @@ EXTRA_OECONF_append_arm = " --host=armv7${HOST_VENDOR}-${HOST_OS}" EXTRA_OEMAKE = "-w" +CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl'" + # valgrind likes to control its own optimisation flags. It generally defaults # to -O2 but uses -O0 for some specific test apps etc. Passing our own flags # (via CFLAGS) means we interfere with that. Only pass DEBUG_FLAGS to it
Signature · 1 line
2.11.0.rc2.dirty
PATCH v2 4/7 m4: do_configure: fix "Argument list too long"
In reply to Robert YangFixed when len(TMPDIR) = 410:
Can't exec "/bin/sh": Argument list too long at /usr/lib/perl/5.18/IO/File.pm line 65.
This is becuase it has a lot of m4 files, use relative path for them can fix the problem.
--- meta/recipes-devtools/m4/m4-1.4.18.inc | 3 +++ 1 file changed, 3 insertions(+)
meta/recipes-devtools/m4/m4-1.4.18.inc +3 -0
@@ -15,5 +15,8 @@ SRC_URI_append_class-target = "\ file://0001-Unset-need_charset_alias-when-building-for-musl.patch \ " +# Fix "Argument list too long" error when len(TMPDIR) = 410 +acpaths = "-I ./m4" + SRC_URI[md5sum] = "a077779db287adf4e12a035029002d28" SRC_URI[sha256sum] = "ab2633921a5cd38e48797bf5521ad259bdc4b979078034a3b790d7fec5493fab"
Signature · 1 line
2.11.0.rc2.dirty
PATCH v2 5/7 guile: do_configure: fix "Argument list too long"
In reply to Robert YangFixed when len(TMPDIR) = 410:
Can't exec "/bin/sh": Argument list too long at /usr/lib/perl/5.18/IO/File.pm line 65.
This is becuase it has a lot of m4 files, use relative path for them can fix the problem.
--- meta/recipes-devtools/guile/guile_2.0.14.bb | 3 +++ 1 file changed, 3 insertions(+)
meta/recipes-devtools/guile/guile_2.0.14.bb +3 -0
@@ -30,6 +30,9 @@ SRC_URI[sha256sum] = "e8442566256e1be14e51fc18839cd799b966bc5b16c6a1d7a7c35155a8 inherit autotools gettext pkgconfig texinfo BBCLASSEXTEND = "native" +# Fix "Argument list too long" error when len(TMPDIR) = 410 +acpaths = "-I ./m4" + DEPENDS = "libunistring bdwgc gmp libtool libffi ncurses readline" # add guile-native only to the target recipe's DEPENDS DEPENDS_append_class-target = " guile-native libatomic-ops"
Signature · 1 line
2.11.0.rc2.dirty
PATCH v2 6/7 autogen-native: fix POSIX_SHELL and perl
In reply to Robert YangThe shebang's length is usually 128 as defined in /usr/include/linux/binfmts.h:
#define BINPRM_BUF_SIZE 128
So there would be errors when /path/to/hosttools/perl is longer than 128.
This patch fixes the problem when POSIX_SHELL and perl are used as the interpreters.
--- .../autogen/autogen-native_5.18.12.bb | 3 ++ ...2-autoopts-mk-tpl-config.sh-fix-perl-path.patch | 32 ++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 meta/recipes-devtools/autogen/autogen/0002-autoopts-mk-tpl-config.sh-fix-perl-path.patch
meta/recipes-devtools/autogen/autogen-native_5.18.12.bb +3 -0
@@ -13,6 +13,7 @@ SRC_URI = "${GNU_MIRROR}/autogen/rel${PV}/autogen-${PV}.tar.gz \ file://mk-tpl-config.sh-force-exit-value-to-be-0-in-subproc.patch \ file://fix-script-err-when-processing-libguile.patch \ file://0001-config-libopts.m4-regenerate-it-from-config-libopts..patch \ + file://0002-autoopts-mk-tpl-config.sh-fix-perl-path.patch \ " SRC_URI[md5sum] = "551d15ccbf5b5fc5658da375d5003389"
@@ -30,6 +31,8 @@ inherit autotools texinfo native pkgconfig export GUILE_LOAD_PATH = "${STAGING_DATADIR_NATIVE}/guile/2.0" export GUILE_LOAD_COMPILED_PATH = "${STAGING_LIBDIR_NATIVE}/guile/2.0/ccache" +export POSIX_SHELL = "/usr/bin/env sh" + do_install_append () { create_wrapper ${D}/${bindir}/autogen \ GUILE_LOAD_PATH=${STAGING_DATADIR_NATIVE}/guile/2.0 \
meta/recipes-devtools/autogen/autogen/0002-autoopts-mk-tpl-config.sh-fix-perl-path.patch new file +32 -0
@@ -0,0 +1,32 @@ +From 9f69f3f5ef22bf1bcffb0e651efc260889cfaa46 Mon Sep 17 00:00:00 2001 +From: Robert Yang <[email protected]> +Date: Mon, 13 Mar 2017 20:33:30 -0700 +Subject: [PATCH] autoopts/mk-tpl-config.sh: fix perl path + +Use "which perl" as shebang doesn't work when it is longer than +BINPRM_BUF_SIZE which is 128 usually. So use "/usr/bin/env perl" to +instead of. + +Upstream-Status: Pending + +Signed-off-by: Robert Yang <[email protected]> +--- + autoopts/mk-tpl-config.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/autoopts/mk-tpl-config.sh b/autoopts/mk-tpl-config.sh +index 093e808..8dfc6dd 100755 +--- a/autoopts/mk-tpl-config.sh ++++ b/autoopts/mk-tpl-config.sh +@@ -98,7 +98,7 @@ fix_scripts() { + st=`sed 1q $f` + + case "$st" in +- *perl ) echo '#!' `which perl` ++ *perl ) echo '#!/usr/bin/env perl' + sed 1d $f + ;; + +-- +2.10.2 +
Signature · 1 line
2.11.0.rc2.dirty
PATCH v2 7/7 kmod: set ac_cv_path_DOLT_BASH to /usr/bin/env bash
In reply to Robert YangThe shebang's length is usually 128 as defined in /usr/include/linux/binfmts.h:
#define BINPRM_BUF_SIZE 128
So there would be errors when /path/to/hosttools/bash is longer than 128:
/bin/sh: ./doltcompile: [snip]: bad interpreter: No such file or directory
Set ac_cv_path_DOLT_BASH to "/usr/bin/env bash" to fix the problem.
--- meta/recipes-kernel/kmod/kmod.inc | 2 ++ 1 file changed, 2 insertions(+)
meta/recipes-kernel/kmod/kmod.inc +2 -0
@@ -30,6 +30,8 @@ S = "${WORKDIR}/git" EXTRA_AUTORECONF += "--install --symlink" EXTRA_OECONF +=" --enable-tools --with-zlib" +CACHED_CONFIGUREVARS += "ac_cv_path_DOLT_BASH='/usr/bin/env bash'" + PACKAGECONFIG[debug] = "--enable-debug,--disable-debug" PACKAGECONFIG[logging] = " --enable-logging,--disable-logging" PACKAGECONFIG[manpages] = "--enable-manpages, --disable-manpages, libxslt-native xmlto-native"
Signature · 1 line
2.11.0.rc2.dirty