need to switch from generic to gnu on clocale, plz help

eric fsshl at att.net
Thu Jun 30 03:05:43 UTC 2011


Dear Mathias Klose(of ubuntu/debian):

  I am in Ubuntu10.04(but upgrade kernel to 2.6.35-25 through cache)
and self build from(4.4.3 unbuntu's cache) to 4.5.2
but my system not work well in locale and gnu/gcc 's helper
told I probably need to switch from generic to gnu
----------
root at eric-laptop:/home/eric/cppcookbook# g++ -v testlocale1.cpp 
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/i686-pc-linux-gnu/4.5.2/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ./configure
Thread model: posix
gcc version 4.5.2 (GCC) 
COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=generic'
'-march=pentiumpro'
 /usr/local/libexec/gcc/i686-pc-linux-gnu/4.5.2/cc1plus -quiet -v
-D_GNU_SOURCE testlocale1.cpp -quiet -dumpbase testlocale1.cpp
-mtune=generic -march=pentiumpro -auxbase testlocale1 -version
-o /tmp/ccKXdPdt.s
GNU C++ (GCC) version 4.5.2 (i686-pc-linux-gnu)
	compiled by GNU C version 4.5.2, GMP version 5.0.2, MPFR version 3.0.1,
MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param
ggc-min-heapsize=131072
ignoring nonexistent directory
"/usr/local/lib/gcc/i686-pc-linux-gnu/4.5.2/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/lib/gcc/i686-pc-linux-gnu/4.5.2/../../../../include/c
++/4.5.2
 /usr/local/lib/gcc/i686-pc-linux-gnu/4.5.2/../../../../include/c
++/4.5.2/i686-pc-linux-gnu
 /usr/local/lib/gcc/i686-pc-linux-gnu/4.5.2/../../../../include/c
++/4.5.2/backward
 /usr/local/include
 /usr/local/lib/gcc/i686-pc-linux-gnu/4.5.2/include
 /usr/local/lib/gcc/i686-pc-linux-gnu/4.5.2/include-fixed
 /usr/include
End of search list.
GNU C++ (GCC) version 4.5.2 (i686-pc-linux-gnu)
	compiled by GNU C version 4.5.2, GMP version 5.0.2, MPFR version 3.0.1,
MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param
ggc-min-heapsize=131072
Compiler executable checksum: bf25e0c26b0f7b87953b14877b2b65cc
COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=generic'
'-march=pentiumpro'
 as -V -Qy --32 -o /tmp/ccZdf3kv.o /tmp/ccKXdPdt.s
GNU assembler version 2.20.1 (i486-linux-gnu) using BFD version (GNU
Binutils for Ubuntu) 2.20.1-system.20100303
COMPILER_PATH=/usr/local/libexec/gcc/i686-pc-linux-gnu/4.5.2/:/usr/local/libexec/gcc/i686-pc-linux-gnu/4.5.2/:/usr/local/libexec/gcc/i686-pc-linux-gnu/:/usr/local/lib/gcc/i686-pc-linux-gnu/4.5.2/:/usr/local/lib/gcc/i686-pc-linux-gnu/
LIBRARY_PATH=/usr/local/lib/gcc/i686-pc-linux-gnu/4.5.2/:/usr/local/lib/gcc/i686-pc-linux-gnu/4.5.2/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=generic'
'-march=pentiumpro'
 /usr/local/libexec/gcc/i686-pc-linux-gnu/4.5.2/collect2 --eh-frame-hdr
-m elf_i386
-dynamic-linker /lib/ld-linux.so.2 /usr/lib/crt1.o /usr/lib/crti.o /usr/local/lib/gcc/i686-pc-linux-gnu/4.5.2/crtbegin.o -L/usr/local/lib/gcc/i686-pc-linux-gnu/4.5.2 -L/usr/local/lib/gcc/i686-pc-linux-gnu/4.5.2/../../.. /tmp/ccZdf3kv.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/local/lib/gcc/i686-pc-linux-gnu/4.5.2/crtend.o /usr/lib/crtn.o
----------------------------------------------------------------
Is that in 'mtune=generic'
        to        gnu         ?
(guy told me as --enable-clocale=gnu)
because my /generic/c_locale.cc
        restrict me too much comparing to /gnu/c_locale.cc
in my /gcc-4.5.2/libstdc++-v3/config/local/ directory

although I don't mind to upgrade/update to higher version of kernel or
gcc/g++, short way by modify configure's internal setting is better for
me.

 /* I ever tried to copy/overwrite c_locale.cc in gnu/ directory to
  * generic/ directory, then rebuild.  But at stage of make, it stop/
  * abort/failed by a lot of errors.
  * I also check INSTALL directory, build/configure.html, it didn't
  * mention locale
  *
  *and please check the following test program
  *---------------------------------
  *
this time it compile well (no error)

On Wed, 2011-06-29 at 23:18 +0100, Jonathan Wakely wrote:
> On 29 June 2011 23:10, eric wrote:
> > test1.cpp:7:67: error: operator '&&' has no right operand
> 
> That's because gmail wrapped these lines:
> 
> #if (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) &&
> !defined(__UCLIBC__)
> 
> Try putting a \ character at the end of the first line, after the &&
> 
> Please make that change and try again. This should tell us if your
> glibc doesn't have locale support, it's the test that libstdc++ uses
> to enable clocale=gnu
> 
> 
> > test1.cpp:10:2: error: #error bad glibc
> >
> >
> > On Wed, 2011-06-29 at 21:51 +0100, Jonathan Wakely wrote:
> >>
> >> #define _GNU_SOURCE 1
> >> #include <string.h>
> >> #include <locale.h>
> >>
> >> #include <features.h>
> >> #if (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) &&
> >> !defined(__UCLIBC__)
> >> #else
> >> #error bad glibc
> >> #endif
> >>
> >>
> >> int
> >> main ()
> >> {
> >>     char s[128];
> >>     __locale_t loc;
> >>     strxfrm_l(s, "C", 5, loc);
> >>     strerror_l(5, loc);
> >>
> >>
> >>     return 0;
> >> }
> >>
> >>
> >
> >
*----------------------------------------------
* so is that very sure my locale problem is I need to switch from
* generic to gnu?
*/

plz help and thanks a lot in advance
Eric





More information about the Ubuntu-devel-discuss mailing list