在编译 make-3.82 的时候出现如下错误提示
glob/glob.c:xxx: undefined reference to `__alloca'`
修改 /glob/glob.c
// #if !defined __alloca && !defined __GNU_LIBRARY__
# ifdef __GNUC__
# undef alloca
# define alloca(n) __builtin_alloca (n)
# else /* Not GCC. */
# ifdef HAVE_ALLOCA_H
# include <alloca.h>
# else /* Not HAVE_ALLOCA_H. */
# ifndef _AIX
# ifdef WINDOWS32
# include <malloc.h>
# else
extern char *alloca ();
# endif /* WINDOWS32 */
# endif /* Not _AIX. */
# endif /* sparc or HAVE_ALLOCA_H. */
# endif /* GCC. */
# define __alloca alloca
// #endif
保存后编译通过
这个错误是glibc2.7引起的
本文讲述了在编译make-3.82过程中遇到的undefined reference to '__alloca'错误,原因在于glibc2.7。通过修改glob/glob.c文件并替换alloca宏定义,成功解决了这个问题并分享了修复步骤。
6523

被折叠的 条评论
为什么被折叠?



