header file inline causing problems

Steve Pribyl steve@netfuel.com
Wed Apr 6 20:10:00 GMT 2005


I am getting duplicate methods in my libgcj.a on mingw and it looks like it is 
caused by a problem with an inline function in the header.
Example
In the source tree libjava/java/util/logging/Logger.java
 /**
 * Returns the name of this logger.
 *
 * @return the name of this logger, or <code>null</code> if
 * the logger is anonymous.
 */
 public String getName()
 {
 /* Note that the name of a logger cannot be changed during
 * its lifetime, so no synchronization is needed.
 */
 return name;
 }
In the obj tree libjava/java/util/logging/Logger.h
 virtual ::java::lang::String *getName () { return name; }
This causes both Logger.o and natLogger.o to contain the Logger.getName code.
mingw$ nm libgcj.a
00000000 t .text$_ZN4java4util7logging6Logger7getNameEv
00000000 T __ZN4java4util7logging6Logger7getNameEv
00000890 T __ZN4java4util7logging6Logger7getNameEv
mingw$ gcc -v
Using built-in specs.
Target: i386-mingw32msvc
Configured with: ../gcc-4.0.0-cvs/configure -v --prefix=/h/mingw-4.0.0-cvs 
--target=i386-mingw32msvc --host=i386-mingw32msvc --build=i686-pc-linux-gnu 
--with-gnu-as --with-gnu-ld --without-newlib --disable-multilib --disable-nls 
--disable-win32-registry --disable-shared --enable-sjlj-exceptions 
--enable-libgcj --disable-java-awt --without-x --enable-java-gc=boehm 
--disable-libgcj-debug --enable-interpreter --enable-hash-synchronization 
--enable-libstdcxx-debug --enable-threads --enable-languages=c,c++,java : 
(reconfigured) ../gcc-4.0.0-cvs/configure -v --prefix=/h/mingw-4.0.0-cvs 
--target=i386-mingw32msvc --host=i386-mingw32msvc --build=i686-pc-linux-gnu 
--with-gnu-as --with-gnu-ld --without-newlib --disable-multilib --disable-nls 
--disable-win32-registry --disable-shared --enable-sjlj-exceptions 
--enable-libgcj --disable-java-awt --without-x --enable-java-gc=boehm 
--disable-libgcj-debug --enable-interpreter --enable-hash-synchronization 
--enable-libstdcxx-debug --enable-threads --enable-languages=c,c++,java
Thread model: win32
gcc version 4.0.0 20050404 (prerelease)
Cross-compiler gcc -v
Using built-in specs.
Target: i386-mingw32msvc
Configured with: /vmware/mingw/source/gcc-4.0.0-cvs/configure -v 
--prefix=/opt/cross-tools --target=i386-mingw32msvc 
--with-headers=/opt/cross-tools/i386-mingw32msvc/include --with-gnu-as 
--with-gnu-ld --without-newlib --disable-multilib
Thread model: win32
gcc version 4.0.0 20050404 (prerelease)
If you need more information or have suggestions please let me know. It seems 
that what ever is happening may affect other simlar functions.
-- 
Steve Pribyl
Steve AT NetFuel dot com
Computer Infrastructure Practitioner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 4706 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://gcc.gnu.org/pipermail/java/attachments/20050406/ff2785e6/attachment.bin>


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /