2017-01-16 766 views
0

我被插入臨時系統(/ tools)中。在編譯glibc(LFS的步驟6.9)期間,我的電腦意外關閉。在啓動備份後,重新編譯構建目錄,運行configure並make,失敗。這裏是日誌:系統在glibc編譯期間崩潰,甚至在重建構建目錄後拒絕再次編譯

root:/sources/glibc-2.24/build# make 
make -r PARALLELMFLAGS="" -C .. objdir=`pwd` all 
make[1]: Entering directory '/sources/glibc-2.24' 
make subdir=csu -C csu ..=../ subdir_lib 
make[2]: Entering directory '/sources/glibc-2.24/csu' 
gawk -f ../scripts/gen-as-const.awk ../sysdeps/x86_64/nptl/tcb-offsets.sym \ 
| gcc -S -o /sources/glibc-2.24/build/tcb-offsets.hT3 -std=gnu11 -fgnu89-inline -O2 -Wall -Werror -Wundef -Wwrite-strings -fmerge-all-constants -frounding-math -g -Wstrict-prototypes -Wold-style-definition  -ftls-model=initial-exec  -I../include -I/sources/glibc-2.24/build/csu -I/sources/glibc-2.24/build -I../sysdeps/unix/sysv/linux/x86_64/64 -I../sysdeps/unix/sysv/linux/x86_64 -I../sysdeps/unix/sysv/linux/x86 -I../sysdeps/unix/sysv/linux/wordsize-64 -I../sysdeps/x86_64/nptl -I../sysdeps/unix/sysv/linux/include -I../sysdeps/unix/sysv/linux -I../sysdeps/nptl -I../sysdeps/pthread -I../sysdeps/gnu -I../sysdeps/unix/inet -I../sysdeps/unix/sysv -I../sysdeps/unix/x86_64 -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/x86_64/64 -I../sysdeps/x86_64/fpu/multiarch -I../sysdeps/x86_64/fpu -I../sysdeps/x86/fpu/include -I../sysdeps/x86/fpu -I../sysdeps/x86_64/multiarch -I../sysdeps/x86_64 -I../sysdeps/x86 -I../sysdeps/ieee754/ldbl-96 -I../sysdeps/ieee754/dbl-64/wordsize-64 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/wordsize-64 -I../sysdeps/ieee754 -I../sysdeps/generic -I.. -I../libio -I. -D_LIBC_REENTRANT -include /sources/glibc-2.24/build/libc-modules.h -DMODULE_NAME=libc -include ../include/libc-symbols.h  -x c - \ 
     -MD -MP -MF /sources/glibc-2.24/build/tcb-offsets.h.dT -MT '/sources/glibc-2.24/build/tcb-offsets.h.d /sources/glibc-2.24/build/tcb-offsets.h' 
In file included from ../sysdeps/generic/hp-timing-common.h:42:0, 
       from ../sysdeps/x86_64/hp-timing.h:38, 
       from ../include/libc-internal.h:7, 
       from ../sysdeps/x86_64/nptl/tls.h:29, 
       from ../sysdeps/unix/sysv/linux/x86_64/sysdep.h:24, 
       from <stdin>:1: 
../sysdeps/generic/_itoa.h:32:25: error: "LONG_MAX" is not defined [-Werror=undef] 
# define _ITOA_NEEDED (LONG_MAX != LLONG_MAX) 
         ^
../sysdeps/generic/_itoa.h:97:6: note: in expansion of macro '_ITOA_NEEDED' 
#if !_ITOA_NEEDED 
     ^~~~~~~~~~~~ 
cc1: all warnings being treated as errors 
make[2]: *** [../Makerules:224: /sources/glibc-2.24/build/tcb-offsets.h] Error 1 
make[2]: Leaving directory '/sources/glibc-2.24/csu' 
make[1]: *** [Makefile:214: csu/subdir_lib] Error 2 
make[1]: Leaving directory '/sources/glibc-2.24' 
make: *** [Makefile:9: all] Error 2 
root:/sources/glibc-2.24/build# 

看起來像limits.h不存在,但我檢查,它確實存在。

root:/usr/include/linux# ls | grep "limits.h" 
limits.h 

編輯:我收集limits.h,並注意到LONG_MAX確實沒有包含在文件中。下面是該文件:

#ifndef _LINUX_LIMITS_H 
#define _LINUX_LIMITS_H 

#define NR_OPEN   1024 

#define NGROUPS_MAX 65536 /* supplemental group IDs are available */ 
#define ARG_MAX  131072 /* # bytes of args + environ for exec() */ 
#define LINK_MAX   127 /* # links a file may have */ 
#define MAX_CANON  255 /* size of the canonical input queue */ 
#define MAX_INPUT  255 /* size of the type-ahead buffer */ 
#define NAME_MAX   255 /* # chars in a file name */ 
#define PATH_MAX  4096 /* # chars in a path name including nul */ 
#define PIPE_BUF  4096 /* # bytes in atomic write to a pipe */ 
#define XATTR_NAME_MAX 255 /* # chars in an extended attribute name */ 
#define XATTR_SIZE_MAX 65536 /* size of an extended attribute value (64k) */ 
#define XATTR_LIST_MAX 65536 /* size of extended attribute namelist (64k) */ 

#define RTSIG_MAX   32 

#endif 
root:/usr/include/linux# ls | grep "limits.h" 
limits.h 
root:/usr/include/linux# cat limits.h 
#ifndef _LINUX_LIMITS_H 
#define _LINUX_LIMITS_H 

#define NR_OPEN   1024 

#define NGROUPS_MAX 65536 /* supplemental group IDs are available */ 
#define ARG_MAX  131072 /* # bytes of args + environ for exec() */ 
#define LINK_MAX   127 /* # links a file may have */ 
#define MAX_CANON  255 /* size of the canonical input queue */ 
#define MAX_INPUT  255 /* size of the type-ahead buffer */ 
#define NAME_MAX   255 /* # chars in a file name */ 
#define PATH_MAX  4096 /* # chars in a path name including nul */ 
#define PIPE_BUF  4096 /* # bytes in atomic write to a pipe */ 
#define XATTR_NAME_MAX 255 /* # chars in an extended attribute name */ 
#define XATTR_SIZE_MAX 65536 /* size of an extended attribute value (64k) */ 
#define XATTR_LIST_MAX 65536 /* size of extended attribute namelist (64k) */ 

#define RTSIG_MAX   32 

#endif 

回答

1

#ifndef _LINUX_LIMITS_H

這是include/linux/limits.hLONG_MAX應該來自include/limits.h,這是不同的文件。

在不乾淨的關機後,您的來源可能會損壞。您應該從原始副本中恢復它們。