步骤是:
\ntar zxf glibc-2.28.tar.gz && cd glibc-2.28\nmkdir build && cd build\n\n../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin\n\nmake -j 8\n\nRun Code Online (Sandbox Code Playgroud)\n我得到如下:
\ninux-gnu/12.2.0/include-fixed -isystem /usr/include -D_LIBC_REENTRANT -include /root/source/glibc-2.28/build/libc-modules.h -DMODULE_NAME=libc -include ../include/libc-symbols.h -DTOP_NAMESPACE=glibc \\\n -DGEN_AS_CONST_HEADERS -x c - \\\n -MD -MP -MF /root/source/glibc-2.28/build/tcb-offsets.h.dT -MT '/root/source/glibc-2.28/build/tcb-offsets.h.d /root/source/glibc-2.28/build/tcb-offsets.h'\nIn file included from ../include/pthread.h:1,\n from ../nptl/../nptl_db/thread_db.h:25,\n from ../nptl/descr.h:32,\n from ../sysdeps/x86_64/nptl/tls.h:130,\n from ../sysdeps/unix/sysv/linux/x86_64/sysdep.h:24,\n from <stdin>:1:\n../sysdeps/nptl/pthread.h:744:47: error: argument 1 of type 'struct __jmp_buf_tag *' declared as a pointer [-Werror=array-parameter=]\n 744 | extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __THROWNL;\n | ~~~~~~~~~~~~~~~~~~~~~~^~~~~\nIn file included from ../include/setjmp.h:2,\n from ../nptl/descr.h:24:\n../setjmp/setjmp.h:54:46: note: previously declared as an array 'struct __jmp_buf_tag[1]'\n 54 | extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __THROWNL;\n | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~\ncc1: all warnings being treated as errors\nmake[2]: *** [../Makerules:287: /root/source/glibc-2.28/build/tcb-offsets.h] Error 1\nmake[2]: Leaving directory '/root/source/glibc-2.28/csu'\nmake[1]: *** [Makefile:258: csu/subdir_lib] Error 2\nmake[1]: Leaving directory '/root/source/glibc-2.28'\nmake: *** [Makefile:9: all] Error 2\nRun Code Online (Sandbox Code Playgroud)\n有人可以给我一些帮助或提示吗?欣赏
\n我尝试使用 make clean 命令重新编译,或者完全删除 glibc-2.28 文件夹以重试并避免在不使用 -j 8 参数的情况下进行多核编译,但问题仍然存在
\n小智 6
只需将其添加--disable-werror到您的configure设置中即可:
$ # if you are in glibc-build
$ ../glibc-version/configure --disable-werror ....other args ....
Run Code Online (Sandbox Code Playgroud)
来自GNU 手册:
默认情况下,GNU C 库是使用 -Werror 构建的。如果您希望在不使用此选项的情况下进行构建(例如,如果使用比测试此版本的 GNU C 库更新的 GCC 版本进行构建,因此新警告会导致使用 -Werror 进行构建失败),您可以使用 - -禁用错误。
| 归档时间: |
|
| 查看次数: |
2783 次 |
| 最近记录: |