Parts of gcc are compiled without libiconv even if it's present in the system and --with-libiconv-prefix specified correctly. The reason for this is usage of HAVE_ICONV_H macro. 1. The check for iconv.h in configure does not use the value of --with-libiconv-prefix option. 2. HAVE_ICONV_H is useless because check for libiconv uses iconv.h anyway. 3. HAVE_ICONV is changed in some source files like this: #ifndef HAVE_ICONV_H #undef HAVE_ICONV #endif - which is inherently incorrect in and of itself: any information produced by configure must not be changed in the source code. If configure tests don't work right - fix them, but all source code must be compiled with the same global settings.
Created attachment 13557 [details] Removes HAVE_ICONV_H from source code. This should fix the bug. And, probably, some other problems with gcc not using iconv.
This code has been removed in 4.3.0 anyways as the java source parser is gone. Only the bytecode parser exists on the trunk.
(In reply to comment #2) > This code has been removed in 4.3.0 anyways as the java source parser is gone. > Only the bytecode parser exists on the trunk. That still means 4.1 and 4.2 branches can be fixed. Also not only java source parser is affected: libcpp/internal.h has this bug too. I just don't know how to expose it there. Which component should I tag as buggy? libstdc++?
I don't think libstdc++ (the C++ runtime library) has anything to do with this.
The patch is incomplete, as libcpp/configure.in still checks for iconv.h. Anyway the best thing to do here is submit a patch or patches to the gcc patch list. Include a ChangeLog entry, etc.
libcpp is the C PreProcessor (not the standard C++ library).
Created attachment 13562 [details] Removes HAVE_ICONV_H from source code. Added libcpp/configure and libcpp/configure.ac to the patch.
(In reply to comment #6) > libcpp is the C PreProcessor (not the standard C++ library). Thanks. Now I know how to expose the bug here as well. It's -f*-charset options of cpp.
Subject: Bug 31932 Author: tromey Date: Mon Mar 30 20:54:18 2009 New Revision: 145316 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=145316 Log: 2009-03-30 Sergiy Vyshnevetskiy <serg@vostok.net> PR preprocessor/31932: * internal.h: Don't mention HAVE_ICONV_H. * configure, config.in: Rebuild. * configure.ac: Don't check for iconv.h. Modified: trunk/libcpp/ChangeLog trunk/libcpp/config.in trunk/libcpp/configure trunk/libcpp/configure.ac trunk/libcpp/internal.h
I checked in the fix on the trunk.
Oops, updated wrong field.
Fixed so closing.