mirror of
https://git.yoctoproject.org/poky
synced 2026-02-20 08:29:42 +01:00
Bash is failing trying to allocate memory [1] using the custom memory allocator if we disable it the issue is fixed. The major distributions also disabled by default [2], so we don't have a good reason to use it. The underlying issue is due to bash’s malloc using brk() calls to allocate memory, which fail when address randomization is enabled in kernel. sbrk() based custom allocators are obsolete. There may be some performance impact of this however correctness is more important. [YOCTO #8452] [1] https://bugzilla.yoctoproject.org/show_bug.cgi?id=8452#c0 [2] https://bugzilla.yoctoproject.org/show_bug.cgi?id=8452#c5 (From OE-Core rev: e42d8eff9eed7d1454b4f331d96dcee6dea232df) Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
61 lines
1.7 KiB
PHP
61 lines
1.7 KiB
PHP
SUMMARY = "An sh-compatible command language interpreter"
|
|
HOMEPAGE = "http://tiswww.case.edu/php/chet/bash/bashtop.html"
|
|
SECTION = "base/shell"
|
|
|
|
DEPENDS = "ncurses bison-native"
|
|
|
|
inherit autotools gettext texinfo update-alternatives ptest
|
|
|
|
EXTRA_AUTORECONF += "--exclude=autoheader"
|
|
EXTRA_OECONF = "--enable-job-control --without-bash-malloc"
|
|
|
|
# If NON_INTERACTIVE_LOGIN_SHELLS is defined, all login shells read the
|
|
# startup files, even if they are not interactive.
|
|
# This is what other major distros do. And this is what we wanted. See bug#5359 and bug#7137.
|
|
CFLAGS += "-DNON_INTERACTIVE_LOGIN_SHELLS"
|
|
|
|
ALTERNATIVE_${PN} = "sh"
|
|
ALTERNATIVE_LINK_NAME[sh] = "${base_bindir}/sh"
|
|
ALTERNATIVE_TARGET[sh] = "${base_bindir}/bash"
|
|
ALTERNATIVE_PRIORITY = "100"
|
|
|
|
RDEPENDS_${PN} += "base-files"
|
|
RDEPENDS_${PN}_class-nativesdk = ""
|
|
RDEPENDS_${PN}-ptest += "make"
|
|
|
|
do_configure_prepend () {
|
|
if [ ! -e ${S}/acinclude.m4 ]; then
|
|
cat ${S}/aclocal.m4 > ${S}/acinclude.m4
|
|
fi
|
|
}
|
|
|
|
do_compile_ptest () {
|
|
oe_runmake buildtest
|
|
}
|
|
|
|
do_install_append () {
|
|
# Move /usr/bin/bash to /bin/bash, if need
|
|
if [ "${base_bindir}" != "${bindir}" ]; then
|
|
mkdir -p ${D}${base_bindir}
|
|
mv ${D}${bindir}/bash ${D}${base_bindir}
|
|
fi
|
|
}
|
|
do_install_append_class-target () {
|
|
# Clean host path in bashbug
|
|
sed -i -e "s,${STAGING_DIR_TARGET},,g" ${D}${bindir}/bashbug
|
|
}
|
|
|
|
do_install_ptest () {
|
|
make INSTALL_TEST_DIR=${D}${PTEST_PATH}/tests install-test
|
|
cp ${B}/Makefile ${D}${PTEST_PATH}
|
|
sed -i 's/^Makefile/_Makefile/' ${D}${PTEST_PATH}/Makefile
|
|
}
|
|
|
|
pkg_postinst_${PN} () {
|
|
grep -q "^${base_bindir}/bash$" $D${sysconfdir}/shells || echo ${base_bindir}/bash >> $D${sysconfdir}/shells
|
|
}
|
|
|
|
pkg_postrm_${PN} () {
|
|
printf "$(grep -v "^${base_bindir}/bash$" $D${sysconfdir}/shells)\n" > $D${sysconfdir}/shells
|
|
}
|