当前位置: 技术问答>linux和unix
glibc编译失败
来源: 互联网 发布时间:2015-05-19
本文导语: 先把gcc升级到3.3.2,成功。下载了glibc 2.3.2,准备折腾一把。 按照glibc说明把相关软件升级,实际上就是把binutils升级到了2.14,成功。 新建一个build目录,configure成功,但是编译的时候在sscanf.c文件的 sscanf函数处失败...
先把gcc升级到3.3.2,成功。下载了glibc 2.3.2,准备折腾一把。
按照glibc说明把相关软件升级,实际上就是把binutils升级到了2.14,成功。
新建一个build目录,configure成功,但是编译的时候在sscanf.c文件的
sscanf函数处失败,说与built-in的sscanf冲突。
xxx sscanf(s, fmt)
const char* s,
const char* fmt
{
va_list ???;
...
va_start(???, fmt);
...
}
libc_hidden_def(sscanf)
...
另外还有va_start使用的fix arg的错误。
我info gcc,的确说标准规定了有built-in的sscanf,我就把上面的函数包括hidden
部分全部注释掉了。编译通过!
但是在最后链接的时候又倒下了,这次说的是_GI_sscanf_的问题。
那位大侠对此有研究的,请援手啊!
按照glibc说明把相关软件升级,实际上就是把binutils升级到了2.14,成功。
新建一个build目录,configure成功,但是编译的时候在sscanf.c文件的
sscanf函数处失败,说与built-in的sscanf冲突。
xxx sscanf(s, fmt)
const char* s,
const char* fmt
{
va_list ???;
...
va_start(???, fmt);
...
}
libc_hidden_def(sscanf)
...
另外还有va_start使用的fix arg的错误。
我info gcc,的确说标准规定了有built-in的sscanf,我就把上面的函数包括hidden
部分全部注释掉了。编译通过!
但是在最后链接的时候又倒下了,这次说的是_GI_sscanf_的问题。
那位大侠对此有研究的,请援手啊!
|
Florian Fernandez wrote:
> Hi,
>
> I tried to compile glibc 2.3.2 with gcc 3.3 and I got this:
>
> ...
> sscanf.c:31: warning: conflicting types for built-in function `sscanf'
> sscanf.c: In function `sscanf':
> sscanf.c:37: error: `va_start' used in function with fixed args
> make[2]: *** [/root/glibc-build/stdio-common/sscanf.o] Error 1
> make[2]: Leaving directory `/root/glibc-2.3.2/stdio-common'
> make[1]: *** [stdio-common/subdir_lib] Error 2
> make[1]: Leaving directory `/root/glibc-2.3.2'
> make: *** [all] Error 2
>
> When I compile with gcc 3.2.3 all is ok.
>
> Anyone can help me ?
>
glibc-2.3.2-sscanf.patch
--- stdio-common/sscanf.c.~1.8.~ 2003-01-16 11:25:20.000000000 +0100
+++ stdio-common/sscanf.c 2003-03-05 12:07:34.000000000 +0100
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,95,96,98,2002 Free Software Foundation, Inc.
+/* Copyright (C) 1991,95,96,98,2002, 2003 Free Software
Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it
and/or
@@ -27,9 +27,7 @@
/* Read formatted input from S, according to the format string
FORMAT. */
/* VARARGS2 */
int
-sscanf (s, format)
- const char *s;
- const char *format;
+sscanf (const char *s, const char *format, ...)
{
va_list arg;
int done;
--
Confucius: He who play in root, eventually kill tree.
Registered with The Linux Counter. http://counter.li.org/
Slackware 9.0 Kernel 2.4.20 i686 (GCC) 3.3
Uptime: 13 days, 21:49, 1 user, load average: 1.35, 1.25, 1.34
--
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-dev' in the subject header of the message
> Hi,
>
> I tried to compile glibc 2.3.2 with gcc 3.3 and I got this:
>
> ...
> sscanf.c:31: warning: conflicting types for built-in function `sscanf'
> sscanf.c: In function `sscanf':
> sscanf.c:37: error: `va_start' used in function with fixed args
> make[2]: *** [/root/glibc-build/stdio-common/sscanf.o] Error 1
> make[2]: Leaving directory `/root/glibc-2.3.2/stdio-common'
> make[1]: *** [stdio-common/subdir_lib] Error 2
> make[1]: Leaving directory `/root/glibc-2.3.2'
> make: *** [all] Error 2
>
> When I compile with gcc 3.2.3 all is ok.
>
> Anyone can help me ?
>
glibc-2.3.2-sscanf.patch
--- stdio-common/sscanf.c.~1.8.~ 2003-01-16 11:25:20.000000000 +0100
+++ stdio-common/sscanf.c 2003-03-05 12:07:34.000000000 +0100
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,95,96,98,2002 Free Software Foundation, Inc.
+/* Copyright (C) 1991,95,96,98,2002, 2003 Free Software
Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it
and/or
@@ -27,9 +27,7 @@
/* Read formatted input from S, according to the format string
FORMAT. */
/* VARARGS2 */
int
-sscanf (s, format)
- const char *s;
- const char *format;
+sscanf (const char *s, const char *format, ...)
{
va_list arg;
int done;
--
Confucius: He who play in root, eventually kill tree.
Registered with The Linux Counter. http://counter.li.org/
Slackware 9.0 Kernel 2.4.20 i686 (GCC) 3.3
Uptime: 13 days, 21:49, 1 user, load average: 1.35, 1.25, 1.34
--
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-dev' in the subject header of the message