Fix rpl_malloc when cross compiling
authorFredrik Fornwall <fredrik@fornwall.net>
Sun, 15 Nov 2015 21:04:37 +0000 (16:04 -0500)
committerFredrik Fornwall <fredrik@fornwall.net>
Sun, 15 Nov 2015 21:04:37 +0000 (16:04 -0500)
commit150f95af271c7e32d66d94adbc7db6a8298d1693
tree93c9cf8c5ff70c668914857e1ae613eff224b030
parentfc28d8f4d1224ce6f7a77b183a54b94e6d3f907e
Fix rpl_malloc when cross compiling

Work around rpl_malloc being used, see
http://wiki.buici.com/xwiki/bin/view/Programing+C+and+C%2B%2B/Autoconf+and+RPL_MALLOC
for more information:

"The AC_FUNC_MALLOC macro makes sure that the malloc function when passed a zero
argument returns a valid memory block instead of a NULL pointer. This behaviour
conforms to the GNU C library.  Normally, this is a reasonable test that autoconf
makes at build-time. In the case of cross-compilation, however, autoconf cannot
execute a program to verify proper behavior.  It makes the conservative assumption
that the target library will produce non-conforming code.

Failure of this test causes autconf to replace malloc() calls with rpl_malloc()
calls. At link time, if there is no rpl_malloc() function, the linker will fail
with an error describing the missing symbol. The autoconf documentation recommends
adding this harmless code to the application to implement the function."

In Termux the rpl_malloc() usage is useless at best, and may also prevent building
some packages as well as giving runtime crashes for libgc-using packages or others
expecting to intercept malloc.

Previously some packages specified worked around this themselves, but the configure
arguments are now moved into build-package.sh.
15 files changed:
README.md
build-package.sh
packages/bison/build.sh
packages/cboard/build.sh
packages/flex/build.sh
packages/gnuchess/build.sh
packages/gnushogi/build.sh
packages/gtypist/build.sh
packages/pick/build.sh
packages/procps/build.sh
packages/psmisc/build.sh
packages/sshpass/build.sh
packages/teseq/build.sh
packages/wcalc/build.sh
packages/xmlstarlet/build.sh