[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
AC_FUNC_{M,RE}ALLOC are not cross-compiling aware
From: |
Kang-Che Sung |
Subject: |
AC_FUNC_{M,RE}ALLOC are not cross-compiling aware |
Date: |
Sat, 19 Nov 2016 08:27:16 +0800 |
Found this bug on Autoconf 2.69
The AC_FUNC_MALLOC and AC_FUNC_REALLOC macros check for runtime
behaviors of `malloc` and `realloc` respectively. However, both checks
silently evaluate to "no" when cross-compiling.
This is a bug, because:
1. They do not emit a warning on cross-compiling mode. Something like
"WARNING: result no guessed because of cross compilation"
2. They do not try to make a good guess (if possible) on whether the
"--host" machine is using glibc or not. For example this
StackOverflow question <http://stackoverflow.com/questions/9705660/>.
Trying to see the presence of gnu_get_libc_version() or just
grepping the string "GNU C Library" in host's libc.so is enough to
make a good guess.
3. The silent result as the macros currently behave is not documented
in manual. (If documented, then configure.ac writers will know this
behavior is expected and will workaround on cross-compiling on our
side.)