我的第一个SO问题!
我正在尝试在Ubuntu 18.04发行版上安装GNU Make 3.82。但是我遇到了一个问题。
作为旁注,我尝试过解决here所提到的问题(修改glob / glob.c的第55行),但无济于事。但是,下面的控制台输出不能反映此尝试。
这是用于下载和尝试安装已下载here的GNU Make 3.82的完整控制台输出:
sgowen@ubuntu:~$ cd make-3.82 \
> && ./configure \
> && make
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for ranlib... ranlib
checking how to run the C preprocessor... gcc -E
checking for ar... ar
checking for perl... perl
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for strerror in -lcposix... no
checking whether NLS is requested... yes
checking for msgfmt... /usr/bin/msgfmt
checking for gmsgfmt... /usr/bin/msgfmt
checking for xgettext... /usr/bin/xgettext
checking for msgmerge... /usr/bin/msgmerge
checking for ld used by GCC... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for shared library run path origin... done
checking whether NLS is requested... yes
checking for GNU gettext in libc... yes
checking whether to use NLS... yes
checking where the gettext function comes from... libc
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for library containing getpwnam... none required
checking for ANSI C header files... (cached) yes
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking whether stat file-mode macros are broken... no
checking whether time.h and sys/time.h may both be included... yes
checking for stdlib.h... (cached) yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking for unistd.h... (cached) yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking for string.h... (cached) yes
checking for memory.h... (cached) yes
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking sys/resource.h usability... yes
checking sys/resource.h presence... yes
checking for sys/resource.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/timeb.h usability... yes
checking sys/timeb.h presence... yes
checking for sys/timeb.h... yes
checking stdarg.h usability... yes
checking stdarg.h presence... yes
checking for stdarg.h... yes
checking whether gcc and cc understand -c and -o together... yes
checking for an ANSI C-conforming const... yes
checking return type of signal handlers... void
checking for uid_t in sys/types.h... yes
checking for pid_t... yes
checking for uintmax_t... yes
checking for nanoseconds field of struct stat.st_mtim... tv_nsec
checking whether to use high resolution file timestamps... yes
checking for library containing clock_gettime... none required
checking whether system uses MSDOS-style paths... no
checking for standard gettimeofday... yes
checking for strdup... yes
checking for strndup... yes
checking for mkstemp... yes
checking for mktemp... yes
checking for fdopen... yes
checking for fileno... yes
checking for dup2... yes
checking for getcwd... yes
checking for realpath... yes
checking for sigsetmask... yes
checking for sigaction... yes
checking for getgroups... yes
checking for seteuid... yes
checking for setegid... yes
checking for setlinebuf... yes
checking for setreuid... yes
checking for setregid... yes
checking for getrlimit... yes
checking for setrlimit... yes
checking for setvbuf... yes
checking for pipe... yes
checking for strerror... yes
checking for strsignal... yes
checking for lstat... yes
checking for readlink... yes
checking for atexit... yes
checking whether bsd_signal is declared... no
checking for strcasecmp... yes
checking for strncasecmp... yes
checking for strcmpi... no
checking for strncmpi... no
checking for stricmp... no
checking for strnicmp... no
checking for working strcoll... yes
checking for working alloca.h... yes
checking for alloca... yes
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking for vprintf... yes
checking for _doprnt... no
checking whether closedir returns void... no
checking for getloadavg... yes
checking for pstat_getdynamic... no
checking for kstat_open in -lkstat... no
checking for getloadavg... yes
checking whether getloadavg requires setgid... no
checking whether sys_siglist is declared... yes
checking whether _sys_siglist is declared... yes
checking whether __sys_siglist is declared... no
checking for sys/wait.h... yes
checking for waitpid... yes
checking for wait3... yes
checking for union wait... no
checking for SA_RESTART... yes
checking for location of SCCS get command... get
checking if system libc has GNU glob... no; using local copy
checking if malloc debugging is wanted... no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating glob/Makefile
config.status: creating po/Makefile.in
config.status: WARNING: 'po/Makefile.in.in' seems to ignore the --datarootdir setting
config.status: creating config/Makefile
config.status: creating doc/Makefile
config.status: creating w32/Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing default-1 commands
config.status: creating po/POTFILES
config.status: creating po/Makefile
config.status: creating build.sh
make all-recursive
make[1]: Entering directory '/home/sgowen/Downloads/make-3.82'
Making all in glob
make[2]: Entering directory '/home/sgowen/Downloads/make-3.82/glob'
gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT glob.o -MD -MP -MF .deps/glob.Tpo -c -o glob.o glob.c
glob.c: In function ‘glob’:
glob.c:576:23: warning: implicit declaration of function ‘__alloca’; did you mean ‘alloca’? [-Wimplicit-function-declaration]
newp = (char *) __alloca (dirlen + 1);
^~~~~~~~
alloca
glob.c:576:14: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
newp = (char *) __alloca (dirlen + 1);
^
glob.c:704:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
newp = (char *) __alloca (home_len + dirlen);
^
glob.c:727:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
newp = (char *) __alloca (end_name - dirname);
^
glob.c:778:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
newp = (char *) __alloca (home_len + rest_len + 1);
^
glob.c:809:11: warning: implicit declaration of function ‘__stat’; did you mean ‘__xstat’? [-Wimplicit-function-declaration]
: __stat (dirname, &st)) == 0
^~~~~~
__xstat
glob.c: In function ‘glob_in_dir’:
glob.c:1251:21: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
char *fullname = (char *) __alloca (dirlen + 1 + patlen + 1);
^
glob.c:1278:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
names = (struct globlink *) __alloca (sizeof (struct globlink));
^
glob.c:1336:32: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
struct globlink *new = (struct globlink *)
^
glob.c:1362:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
names = (struct globlink *) __alloca (sizeof (struct globlink));
^
mv -f .deps/glob.Tpo .deps/glob.Po
gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT fnmatch.o -MD -MP -MF .deps/fnmatch.Tpo -c -o fnmatch.o fnmatch.c
mv -f .deps/fnmatch.Tpo .deps/fnmatch.Po
rm -f libglob.a
ar cru libglob.a glob.o fnmatch.o
ar: `u' modifier ignored since `D' is the default (see `U')
ranlib libglob.a
make[2]: Leaving directory '/home/sgowen/Downloads/make-3.82/glob'
Making all in config
make[2]: Entering directory '/home/sgowen/Downloads/make-3.82/config'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/sgowen/Downloads/make-3.82/config'
Making all in po
make[2]: Entering directory '/home/sgowen/Downloads/make-3.82/po'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/sgowen/Downloads/make-3.82/po'
Making all in doc
make[2]: Entering directory '/home/sgowen/Downloads/make-3.82/doc'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/sgowen/Downloads/make-3.82/doc'
make[2]: Entering directory '/home/sgowen/Downloads/make-3.82'
gcc -DLOCALEDIR=\"/usr/local/share/locale\" -DLIBDIR=\"/usr/local/lib\" -DINCLUDEDIR=\"/usr/local/include\" -DHAVE_CONFIG_H -I. -I./glob -g -O2 -MT ar.o -MD -MP -MF .deps/ar.Tpo -c -o ar.o ar.c
mv -f .deps/ar.Tpo .deps/ar.Po
gcc -DLOCALEDIR=\"/usr/local/share/locale\" -DLIBDIR=\"/usr/local/lib\" -DINCLUDEDIR=\"/usr/local/include\" -DHAVE_CONFIG_H -I. -I./glob -g -O2 -MT arscan.o -MD -MP -MF .deps/arscan.Tpo -c -o arscan.o arscan.c
mv -f .deps/arscan.Tpo .deps/arscan.Po
gcc -DLOCALEDIR=\"/usr/local/share/locale\" -DLIBDIR=\"/usr/local/lib\" -DINCLUDEDIR=\"/usr/local/include\" -DHAVE_CONFIG_H -I. -I./glob -g -O2 -MT commands.o -MD -MP -MF .deps/commands.Tpo -c -o commands.o commands.c
mv -f .deps/commands.Tpo .deps/commands.Po
gcc -DLOCALEDIR=\"/usr/local/share/locale\" -DLIBDIR=\"/usr/local/lib\" -DINCLUDEDIR=\"/usr/local/include\" -DHAVE_CONFIG_H -I. -I./glob -g -O2 -MT default.o -MD -MP -MF .deps/default.Tpo -c -o default.o default.c
mv -f .deps/default.Tpo .deps/default.Po
gcc -DLOCALEDIR=\"/usr/local/share/locale\" -DLIBDIR=\"/usr/local/lib\" -DINCLUDEDIR=\"/usr/local/include\" -DHAVE_CONFIG_H -I. -I./glob -g -O2 -MT dir.o -MD -MP -MF .deps/dir.Tpo -c -o dir.o dir.c
mv -f .deps/dir.Tpo .deps/dir.Po
gcc -DLOCALEDIR=\"/usr/local/share/locale\" -DLIBDIR=\"/usr/local/lib\" -DINCLUDEDIR=\"/usr/local/include\" -DHAVE_CONFIG_H -I. -I./glob -g -O2 -MT expand.o -MD -MP -MF .deps/expand.Tpo -c -o expand.o expand.c
mv -f .deps/expand.Tpo .deps/expand.Po
gcc -DLOCALEDIR=\"/usr/local/share/locale\" -DLIBDIR=\"/usr/local/lib\" -DINCLUDEDIR=\"/usr/local/include\" -DHAVE_CONFIG_H -I. -I./glob -g -O2 -MT file.o -MD -MP -MF .deps/file.Tpo -c -o file.o file.c
mv -f .deps/file.Tpo .deps/file.Po
gcc -DLOCALEDIR=\"/usr/local/share/locale\" -DLIBDIR=\"/usr/local/lib\" -DINCLUDEDIR=\"/usr/local/include\" -DHAVE_CONFIG_H -I. -I./glob -g -O2 -MT function.o -MD -MP -MF .deps/function.Tpo -c -o function.o function.c
mv -f .deps/function.Tpo .deps/function.Po
gcc -DLOCALEDIR=\"/usr/local/share/locale\" -DLIBDIR=\"/usr/local/lib\" -DINCLUDEDIR=\"/usr/local/include\" -DHAVE_CONFIG_H -I. -I./glob -g -O2 -MT getopt.o -MD -MP -MF .deps/getopt.Tpo -c -o getopt.o getopt.c
mv -f .deps/getopt.Tpo .deps/getopt.Po
gcc -DLOCALEDIR=\"/usr/local/share/locale\" -DLIBDIR=\"/usr/local/lib\" -DINCLUDEDIR=\"/usr/local/include\" -DHAVE_CONFIG_H -I. -I./glob -g -O2 -MT getopt1.o -MD -MP -MF .deps/getopt1.Tpo -c -o getopt1.o getopt1.c
mv -f .deps/getopt1.Tpo .deps/getopt1.Po
gcc -DLOCALEDIR=\"/usr/local/share/locale\" -DLIBDIR=\"/usr/local/lib\" -DINCLUDEDIR=\"/usr/local/include\" -DHAVE_CONFIG_H -I. -I./glob -g -O2 -MT implicit.o -MD -MP -MF .deps/implicit.Tpo -c -o implicit.o implicit.c
mv -f .deps/implicit.Tpo .deps/implicit.Po
gcc -DLOCALEDIR=\"/usr/local/share/locale\" -DLIBDIR=\"/usr/local/lib\" -DINCLUDEDIR=\"/usr/local/include\" -DHAVE_CONFIG_H -I. -I./glob -g -O2 -MT job.o -MD -MP -MF .deps/job.Tpo -c -o job.o job.c
mv -f .deps/job.Tpo .deps/job.Po
gcc -DLOCALEDIR=\"/usr/local/share/locale\" -DLIBDIR=\"/usr/local/lib\" -DINCLUDEDIR=\"/usr/local/include\" -DHAVE_CONFIG_H -I. -I./glob -g -O2 -MT main.o -MD -MP -MF .deps/main.Tpo -c -o main.o main.c
mv -f .deps/main.Tpo .deps/main.Po
gcc -DLOCALEDIR=\"/usr/local/share/locale\" -DLIBDIR=\"/usr/local/lib\" -DINCLUDEDIR=\"/usr/local/include\" -DHAVE_CONFIG_H -I. -I./glob -g -O2 -MT misc.o -MD -MP -MF .deps/misc.Tpo -c -o misc.o misc.c
mv -f .deps/misc.Tpo .deps/misc.Po
gcc -DLOCALEDIR=\"/usr/local/share/locale\" -DLIBDIR=\"/usr/local/lib\" -DINCLUDEDIR=\"/usr/local/include\" -DHAVE_CONFIG_H -I. -I./glob -g -O2 -MT read.o -MD -MP -MF .deps/read.Tpo -c -o read.o read.c
mv -f .deps/read.Tpo .deps/read.Po
gcc -DLOCALEDIR=\"/usr/local/share/locale\" -DLIBDIR=\"/usr/local/lib\" -DINCLUDEDIR=\"/usr/local/include\" -DHAVE_CONFIG_H -I. -I./glob -g -O2 -MT remake.o -MD -MP -MF .deps/remake.Tpo -c -o remake.o remake.c
mv -f .deps/remake.Tpo .deps/remake.Po
gcc -DLOCALEDIR=\"/usr/local/share/locale\" -DLIBDIR=\"/usr/local/lib\" -DINCLUDEDIR=\"/usr/local/include\" -DHAVE_CONFIG_H -I. -I./glob -g -O2 -MT remote-stub.o -MD -MP -MF .deps/remote-stub.Tpo -c -o remote-stub.o remote-stub.c
mv -f .deps/remote-stub.Tpo .deps/remote-stub.Po
gcc -DLOCALEDIR=\"/usr/local/share/locale\" -DLIBDIR=\"/usr/local/lib\" -DINCLUDEDIR=\"/usr/local/include\" -DHAVE_CONFIG_H -I. -I./glob -g -O2 -MT rule.o -MD -MP -MF .deps/rule.Tpo -c -o rule.o rule.c
mv -f .deps/rule.Tpo .deps/rule.Po
gcc -DLOCALEDIR=\"/usr/local/share/locale\" -DLIBDIR=\"/usr/local/lib\" -DINCLUDEDIR=\"/usr/local/include\" -DHAVE_CONFIG_H -I. -I./glob -g -O2 -MT signame.o -MD -MP -MF .deps/signame.Tpo -c -o signame.o signame.c
mv -f .deps/signame.Tpo .deps/signame.Po
gcc -DLOCALEDIR=\"/usr/local/share/locale\" -DLIBDIR=\"/usr/local/lib\" -DINCLUDEDIR=\"/usr/local/include\" -DHAVE_CONFIG_H -I. -I./glob -g -O2 -MT strcache.o -MD -MP -MF .deps/strcache.Tpo -c -o strcache.o strcache.c
mv -f .deps/strcache.Tpo .deps/strcache.Po
gcc -DLOCALEDIR=\"/usr/local/share/locale\" -DLIBDIR=\"/usr/local/lib\" -DINCLUDEDIR=\"/usr/local/include\" -DHAVE_CONFIG_H -I. -I./glob -g -O2 -MT variable.o -MD -MP -MF .deps/variable.Tpo -c -o variable.o variable.c
mv -f .deps/variable.Tpo .deps/variable.Po
gcc -DLOCALEDIR=\"/usr/local/share/locale\" -DLIBDIR=\"/usr/local/lib\" -DINCLUDEDIR=\"/usr/local/include\" -DHAVE_CONFIG_H -I. -I./glob -g -O2 -MT version.o -MD -MP -MF .deps/version.Tpo -c -o version.o version.c
mv -f .deps/version.Tpo .deps/version.Po
gcc -DLOCALEDIR=\"/usr/local/share/locale\" -DLIBDIR=\"/usr/local/lib\" -DINCLUDEDIR=\"/usr/local/include\" -DHAVE_CONFIG_H -I. -I./glob -g -O2 -MT vpath.o -MD -MP -MF .deps/vpath.Tpo -c -o vpath.o vpath.c
mv -f .deps/vpath.Tpo .deps/vpath.Po
gcc -DLOCALEDIR=\"/usr/local/share/locale\" -DLIBDIR=\"/usr/local/lib\" -DINCLUDEDIR=\"/usr/local/include\" -DHAVE_CONFIG_H -I. -I./glob -g -O2 -MT hash.o -MD -MP -MF .deps/hash.Tpo -c -o hash.o hash.c
mv -f .deps/hash.Tpo .deps/hash.Po
gcc -g -O2 -o make ar.o arscan.o commands.o default.o dir.o expand.o file.o function.o getopt.o getopt1.o implicit.o job.o main.o misc.o read.o remake.o remote-stub.o rule.o signame.o strcache.o variable.o version.o vpath.o hash.o glob/libglob.a
glob/libglob.a(glob.o): In function `glob_in_dir':
/home/sgowen/Downloads/make-3.82/glob/glob.c:1362: undefined reference to `__alloca'
/home/sgowen/Downloads/make-3.82/glob/glob.c:1337: undefined reference to `__alloca'
/home/sgowen/Downloads/make-3.82/glob/glob.c:1278: undefined reference to `__alloca'
/home/sgowen/Downloads/make-3.82/glob/glob.c:1251: undefined reference to `__alloca'
glob/libglob.a(glob.o): In function `glob':
/home/sgowen/Downloads/make-3.82/glob/glob.c:576: undefined reference to `__alloca'
glob/libglob.a(glob.o):/home/sgowen/Downloads/make-3.82/glob/glob.c:727: more undefined references to `__alloca' follow
collect2: error: ld returned 1 exit status
Makefile:481: recipe for target 'make' failed
make[2]: *** [make] Error 1
make[2]: Leaving directory '/home/sgowen/Downloads/make-3.82'
Makefile:593: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/sgowen/Downloads/make-3.82'
Makefile:382: recipe for target 'all' failed
make: *** [all] Error 2
sgowen@ubuntu:~/Downloads/make-3.82$
有什么想法吗?
好的,当我尝试在Ubuntu 18.04环境中运行make时,会发生以下情况:
sgowen@stephen-Parallels-Ubuntu:~$ gdb make
GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from make...done.
(gdb) run
Starting program: /usr/local/bin/make
Program received signal SIGSEGV, Segmentation fault.
0x000055555579d381 in ?? ()
(gdb) bt
#0 0x000055555579d381 in ?? ()
#1 0x00007ffff7acba8b in glob_lstat (pglob=0x7fffffffc530,
fullname=0x7fffffffbc10 "./.out", flags=516) at ../posix/glob.c:204
#2 glob_in_dir (pattern=pattern@entry=0x55555579f580 ".out",
directory=directory@entry=0x7ffff7b997d8 <dot> ".", flags=flags@entry=516,
errfunc=errfunc@entry=0x0, pglob=pglob@entry=0x7fffffffc530,
alloca_used=<optimized out>, alloca_used@entry=0) at ../posix/glob.c:1299
#3 0x00007ffff7acc589 in __glob (pattern=pattern@entry=0x55555579f580 ".out",
flags=flags@entry=516, errfunc=errfunc@entry=0x0,
pglob=pglob@entry=0x7fffffffc530) at ../posix/glob.c:1096
#4 0x000055555556d246 in parse_file_seq (
stringp=stringp@entry=0x7fffffffc5c0, size=size@entry=40,
stopchar=stopchar@entry=0, prefix=prefix@entry=0x0, flags=flags@entry=0)
at read.c:3115
#5 0x000055555555ceda in set_default_suffixes () at default.c:545
#6 0x0000555555559eb2 in main (argc=<optimized out>, argv=<optimized out>,
envp=<optimized out>) at main.c:1600
(gdb)
答案 0 :(得分:0)
纯粹出于参考目的,当我自己遇到segfault问题时(尽管使用了Make 4.2.1),实际的问题是由于对glibc做出了假设,而对于新版本不再适用。
除了进行与alloca相关的更改外,您还需要引入上游提交哈希193f1e81edd6b1b56b0eb0ff8aa4b41c7b4257b4
更多详细信息: