构建glibc2.23时出错

时间:2016-07-17 15:54:01

标签: linux gnu-make gnu glibc

我试图在旧版本上构建glibc的最新版本(2.23) 的Linux。为此,我重新构建了gccbinutils的最新版本。

~/software/include >uname -a
Linux 2.6.32-573.3.1.el6.x86_64 #1 SMP Mon Aug 10 09:44:54 EDT 2015 x86_64
x86_64 x86_64 GNU/Linux

~/software/include >gcc --version
gcc (GCC) 5.3.0

~/software/include >make --version
GNU Make 3.81

~/software/include >ld --version
GNU ld (GNU Binutils) 2.26.20160125

然后我按如下方式配置了glibc:

~/software/tmp/glibc-build >../glibc-2.23/configure --prefix=$HOME/software --enable-add-ons=linuxthreads

但是,make会因以下(和更多)错误而失败。任何建议将不胜感激。

~/software/tmp/glibc-build >make

...
...

    ./../include/libc-symbols.h:24:21: note: in expansion of macro ‘IN_MODULE’
 #define IS_IN(lib) (IN_MODULE == MODULE_##lib)
                     ^
./../include/libc-symbols.h:651:5: note: in expansion of macro ‘IS_IN’
 #if IS_IN (libnss_nisplus)
     ^
/users/PAS0272/osu5388/software/tmp/glibc-build/libc-modules.h:15:16: error: token "." is not valid in preprocessor expressions
 #define MODULE_.*-.*-linux.* 19
                ^
./../include/libc-symbols.h:32:30: note: in definition of macro ‘PASTE_NAME1’
 #define PASTE_NAME1(a,b)     a##b
                              ^
./../include/libc-symbols.h:23:19: note: in expansion of macro ‘PASTE_NAME’
 #define IN_MODULE PASTE_NAME (MODULE_, MODULE_NAME)
                   ^
./../include/libc-symbols.h:23:31: note: in expansion of macro ‘MODULE_’
 #define IN_MODULE PASTE_NAME (MODULE_, MODULE_NAME)
                               ^
./../include/libc-symbols.h:24:21: note: in expansion of macro ‘IN_MODULE’
 #define IS_IN(lib) (IN_MODULE == MODULE_##lib)
                     ^
./../include/libc-symbols.h:680:5: note: in expansion of macro ‘IS_IN’
 #if IS_IN (libutil)
     ^
/users/PAS0272/osu5388/software/tmp/glibc-build/libc-modules.h:15:16: error: token "." is not valid in preprocessor expressions
 #define MODULE_.*-.*-linux.* 19
                ^
./../include/libc-symbols.h:32:30: note: in definition of macro ‘PASTE_NAME1’
 #define PASTE_NAME1(a,b)     a##b
                              ^
./../include/libc-symbols.h:23:19: note: in expansion of macro ‘PASTE_NAME’
 #define IN_MODULE PASTE_NAME (MODULE_, MODULE_NAME)
                   ^
./../include/libc-symbols.h:23:31: note: in expansion of macro ‘MODULE_’
 #define IN_MODULE PASTE_NAME (MODULE_, MODULE_NAME)
                               ^
./../include/libc-symbols.h:24:21: note: in expansion of macro ‘IN_MODULE’
 #define IS_IN(lib) (IN_MODULE == MODULE_##lib)
                     ^
../sysdeps/generic/symbol-hacks.h:3:31: note: in expansion of macro ‘IS_IN’
 #if !defined __ASSEMBLER__ && IS_IN (libc) && defined SHARED
                               ^
In file included from ../signal/signal.h:361:0,
                 from ../include/signal.h:5,
                 from <stdin>:2:
../linuxthreads/sysdeps/pthread/bits/pthreadtypes.h:52:3: error: conflicting types for ‘pthread_attr_t’
 } pthread_attr_t;
   ^
In file included from ../signal/signal.h:80:0,
                 from ../include/signal.h:5,
                 from <stdin>:2:
../sysdeps/unix/sysv/linux/x86/bits/siginfo.h:316:30: note: previous declaration of ‘pthread_attr_t’ was here
 typedef union pthread_attr_t pthread_attr_t;
                              ^
In file included from <command-line>:0:0:
/users/PAS0272/osu5388/software/tmp/glibc-build/libc-modules.h:15:16: error: token "." is not valid in preprocessor expressions
 #define MODULE_.*-.*-linux.* 19
                ^
./../include/libc-symbols.h:32:30: note: in definition of macro ‘PASTE_NAME1’
 #define PASTE_NAME1(a,b)     a##b
                              ^
./../include/libc-symbols.h:23:19: note: in expansion of macro ‘PASTE_NAME’
 #define IN_MODULE PASTE_NAME (MODULE_, MODULE_NAME)
                   ^
./../include/libc-symbols.h:23:31: note: in expansion of macro ‘MODULE_’
 #define IN_MODULE PASTE_NAME (MODULE_, MODULE_NAME)
                               ^
./../include/libc-symbols.h:24:21: note: in expansion of macro ‘IN_MODULE’
 #define IS_IN(lib) (IN_MODULE == MODULE_##lib)
                     ^
../include/signal.h:65:7: note: in expansion of macro ‘IS_IN’
 #  if IS_IN (rtld)
       ^
cc1: all warnings being treated as errors
make[2]: *** [/users/PAS0272/osu5388/software/tmp/glibc-build/ucontext_i.h] Error 1
make[2]: Leaving directory `/users/PAS0272/osu5388/software/tmp/glibc-2.23/csu'
make[1]: *** [csu/subdir_lib] Error 2
make[1]: Leaving directory `/users/PAS0272/osu5388/software/tmp/glibc-2.23'
make: *** [all] Error 2

1 个答案:

答案 0 :(得分:0)

我发现了一个解决方案。

之前我已将linuxthreads tarball从glibc download page提取到glibc-2.23/源目录,并尝试使用make运行--enable-add-ons=linuxthreads配置期间指定。

删除此步骤可让make glibc完成而不会出错。

但是,新问题是现在我应该如何使用glibc支持构建linuxthreads