This hasn't worked for me yet, that I remember. Some of itt may be in some library I'm linking, but not sure what might be causing the problem.
In making bash with the 7 patches, I get various warnings and a coredump: . -I../../lib -fpic -march=native -pipe -flto -Wl,--no-as-needed -Og -g3 -ggdb -Wno-parentheses -Wno-format-security shell.c In file included from ../bashintl.h:30, from ./umask.def:57: ./umask.def: In function ‘umask_builtin’: ../include/gettext.h:46:26: warning: passing argument 2 of ‘sh_erange’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] # define gettext(Msgid) ((const char *) (Msgid)) ~^~~~~~~~~~~~~~~~~~~~~~~ ../bashintl.h:36:18: note: in expansion of macro ‘gettext’ #define _(msgid) gettext(msgid) ^~~~~~~ ./umask.def:115:37: note: in expansion of macro ‘_’ sh_erange (list->word->word, _("octal number")); ^ In file included from /usr/include/features.h:428, from /usr/include/bits/libc-header-start.h:33, from /usr/include/wchar.h:27, from ../config-bot.h:144, from ../config.h:1206, from ./umask.def:42: common.h:98:36: note: expected ‘char *’ but argument is of type ‘const char *’ extern void sh_erange __P((char *, char *)); ^~~~~~ Then later (final link) rm -f bash /usr/bin/gcc -L./builtins -L./lib/readline -L./lib/readline -L./lib/glob -L./lib/tilde -L./lib/malloc -L./lib/sh -fpic -march=native -pipe -flto -Wl,--no-as-needed -Og -g3 -ggdb -Wl,--default-imported-symver -Wl,--default-symver -Wl,--stats -rdynamic -fpic -march=native -pipe -flto -Wl,--no-as-needed -Og -g3 -ggdb -Wno-parentheses -Wno-format-security -o bash shell.o eval.o y.tab.o general.o make_cmd.o print_cmd.o dispose_cmd.o execute_cmd.o variables.o copy_cmd.o error.o expr.o flags.o jobs.o subst.o hashcmd.o hashlib.o mailcheck.o trap.o input.o unwind_prot.o pathexp.o sig.o test.o version.o alias.o array.o arrayfunc.o assoc.o braces.o bracecomp.o bashhist.o bashline.o list.o stringlib.o locale.o findcmd.o redir.o pcomplete.o pcomplib.o syntax.o xmalloc.o -lbuiltins -lglob -lsh -lreadline -lhistory -ltermcap -ltilde -lmalloc -ldl /usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld: /usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld: DWARF error: could not find abbrev number 88 /tmp/ccAfK8Jm.ltrans3.ltrans.o: in function `sh_mktmpname': <artificial>:(.text+0xb896): warning: the use of `mktemp' is dangerous, better use `mkstemp' or `mkdtemp' /usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld: total time in link: 0.258463 ls -l bash -rwxrwxr-x 1 law lawgroup 5686848 Jul 8 14:51 bash size bash text data bss dec hex filename 1062017 47272 40256 1149545 118a69 bash Ishtar:tools/bash/bash-5.0> ./bash malloc: subst.c:4701: assertion botched free: called with unallocated block argument Aborting...Aborted (core dumped) I get some type of Dwarf error, then it didn't like mktemp, and finally something in a local startup file causes a coredump Of note, disabling the the startup files: bash --norc --noprofile malloc: subst.c:4701: assertion botched free: called with unallocated block argument Aborting... malloc: subst.c:4701: assertion botched free: called with unallocated block argument Aborting...Ishtar:> # it starts the new shell, but pressing carriage return gives me: malloc: subst.c:4701: assertion botched free: called with unallocated block argument Aborting... malloc: subst.c:4701: assertion botched free: called with unallocated block argument Aborting...Ishtar:> # and back to the prompt again. Very odd. I tried the build both without saying anything about what malloc to use, then with used option --with-bash-malloc -- both seem to do the same thing. Config looks like: prefix=, eprefix=, lib=, libdir=. setting flags for link-time-optimize: add -flto -Wl,--no-as-needed setting flags for debug: add -Og -g3 -ggdb prefix=/, eprefix=/ libdir=/lib64 -fpic -march=native -pipe -flto -Wl,--no-as-needed -Og -g3 -ggdb -fpic -march=native -pipe -flto -Wl,--no-as-needed -Og -g3 -ggdb -Wl,--default-imported-symver -Wl,--default-symver -Wl,--stats CFLAGS="$CFLAGS" LD_FLAGS="$LDFLAGS" ./configure "--prefix=/ --bindir=/bin --sbindir=/sbin --datadir=/share --includedir=/include --oldincludedir=/usr/include --libdir=/lib64 --libexecdir=/lib64/bash --localstatedir=/var --sharedstatedir=/com --sysconfdir=/etc --enable-alias --enable-arith-for-command --enable-array-variables --enable-brace-expansion --enable-casemod-attributes --enable-casemod-expansions --enable-command-timing --enable-cond-command --enable-cond-regexp --enable-coprocesses --enable-debugger --enable-directory-stack --enable-disabled-builtins --enable-dparen-arithmetic --enable-extended-glob --enable-extended-glob-default --enable-function-import --enable-glob-asciiranges-default --enable-help-builtin --enable-history --enable-job-control --enable-multibyte --enable-net-redirections --enable-process-substitution --enable-progcomp --enable-prompt-string-decoding --enable-readline --enable-select --enable-single-help-strings --disable-nls --disable-rpath --with-bash-malloc --with-gnu-ld" checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu ...