Le 05/02/2012 16:44, Andrew Benton a écrit :
> On Sun, 05 Feb 2012 12:46:24 +0100
> Pierre Labastie<[email protected]>  wrote:
>
>>> Maybe try (supposing the build tree has not been removed):
>>>
>>> echo '#include<cstdio>' |/mnt/lfs/sources/gcc-build/gcc/xgcc -shared-libgcc 
>>> \
>>> -B/mnt/lfs/sources/gcc-build/gcc -nostdinc++  \
>>> -B/tools/x86_64-unknown-linux-gnu/bin/ \
>>> -B/tools/x86_64-unknown-linux-gnu/lib/ \
>>> -isystem /tools/x86_64-unknown-linux-gnu/include \
>>> -isystem /tools/x86_64-unknown-linux-gnu/sys-include \
>>> -I/mnt/lfs/sources/gcc-4.6.2/gcc \
>>> -I/mnt/lfs/sources/gcc-build/x86_64-unknown-linux-gnu/libstdc++-v3/include/x86_64-unknown-linux-gnu
>>>  \
>>> -I/mnt/lfs/sources/gcc-build/x86_64-unknown-linux-gnu/libstdc++-v3/include \
>>> -I/mnt/lfs/sources/gcc-4.6.2/libstdc++-v3/libsupc++ \
>>> -D_GNU_SOURCE \
>>> -E -Wp,-dU -
>>>
>>> Regards
>>> pierre
>>>
>>>
>> Sorry, change the last line to:
>>
>> -E -Wp,-dU -xc++-header -
> To save spamming the list I've put that up here:
> http://www.linuxfromscratch.org/~andy/dump-1.txt
>
> Andy
I run the same command after building gcc-pass2 as of current LFS,
and diffed the output respective to Andy's.

There are quite a few differences in line numbers, so I do not put
the resulting diff. Relevant parts (+ is Andy's, - is mine):
----------------------------------------------------
@@ -60,6 +72,7 @@
  #undef _POSIX_C_SOURCE
  #undef _POSIX_SOURCE
  #undef _BSD_SOURCE
+#define _ISOC11_SOURCE 1
  #define _SVID_SOURCE 1
  #define _BSD_SOURCE 1
  #define _XOPEN_SOURCE 700

@@ -67,7 +80,6 @@
  #define _POSIX_SOURCE 1
  #define _ISOC99_SOURCE 1
  #undef __STDC_VERSION__
-#undef _ISOC9X_SOURCE
  #undef __STRICT_ANSI__
  #define _LARGEFILE_SOURCE 1
  #define _LARGEFILE64_SOURCE 1
@@ -82,28 +94,29 @@

@@ -567,17 +579,16 @@
  #undef __GNUC_VA_LIST
  # 40 "/mnt/lfs/sources/gcc-build/gcc/include/stdarg.h" 3 4
  typedef __builtin_va_list __gnuc_va_list;
-# 54 "/tools/include/libio.h" 2 3
+# 55 "/tools/include/libio.h" 2 3
  #define __GNUC_VA_LIST
  #define __P(args) args
-#undef _PARAMS
  #define _G_HAVE_PRINTF_FP 1
  #undef EOF
  #define NULL __null

@@ -690,7 +701,7 @@



-typedef __ssize_t __io_write_fn (void *__cookie, __const char *__buf,
+typedef __ssize_t __io_write_fn (void *__cookie, const char *__buf,
       size_t __n);


(there are a lot of other declarations differing by __const -> const
Do not think it is usefull to put them all)

@@ -1141,18 +1152,13 @@

  extern char *fgets (char *__restrict __s, int __n, FILE *__restrict 
__stream)
       ;
+#define __USE_ISOC11 1
+# 646 "/tools/include/stdio.h" 3

-
-
-
-
-
-extern char *gets (char *__s) ;
-
-# 642 "/tools/include/stdio.h" 3
+# 655 "/tools/include/stdio.h" 3
  extern char *fgets_unlocked (char *__restrict __s, int __n,
          FILE *__restrict __stream) ;
-# 658 "/tools/include/stdio.h" 3
---------------------------------------------------------

Glearly, gets is not declared, because __USE_ISOC11 1 is defined. According
to the patch mentionned earlier in the thread, there should also be a 
check of whether __cplusplus
is defined and if it is less than 201103L (actually it is defined and 
the value is 1,
which makes the comparison look like nonsense, but 1 <=201103L is true).

Maybe be look at /tools/include/stdio.h around the 630th line and see if 
the code

#if !defined __USE_ISOC11 \
    || (defined __cplusplus && __cplusplus <= 201103L)

is there...

If not, your glibc has not been patched. If yes, it looks like there is
something wrong in the preprocessor of gcc.

Maybe Bryan has a better idea...

Regards
Pierre
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to