From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17733 invoked by alias); 15 Mar 2009 15:34:36 -0000 Received: (qmail 17064 invoked by alias); 15 Mar 2009 15:34:24 -0000 Date: Sun, 15 Mar 2009 15:34:00 -0000 Subject: [Bug libobjc/39465] New: libobjc does not find classes of DLLs X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "gcc-bugzilla at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2009-03/txt/msg01040.txt.bz2 When building a program that uses an objc library as a DLL, libobjc can't find its classes. When the program and the library are statically linked, it works. My libobjc itself is linked as a static library. Environment: System: Linux asgard.webkeks.org 2.6.28.5 #1 SMP Sat Feb 14 14:16:10 CET 2009 i686 Intel(R) Core(TM)2 CPU 6600 @ 2.40GHz GenuineIntel GNU/Linux host: mingw32 build: i686-pc-linux-gnu target: i686-pc-linux-gnu configured with: ../gcc-4.3.0-20080502/configure -v --prefix=/usr --libexecdir=/usr/lib --program-prefix=mingw32- --target=mingw32 --with-headers=/usr/mingw32/include --without-x --disable-nls --disable-win32-registry --disable-shared --disable-java-awt --disable-libgcj-debug --with-gcc --with-gnu-ld --with-gnu-as --enable-threads --enable-languages=c,c++,objc --enable-libgcj --enable-java-gc=boehm --enable-interpreter --enable-hash-synchronization --enable-libstdcxx-debug How-To-Repeat: asgard:/tmp$ cat foo.h #import @interface MyObj: Object - (void)foo; @end asgard:/tmp$ cat foo.m #import #import "foo.h" @implementation MyObj - (void)foo { puts("foo!"); } @end asgard:/tmp$ cat test.m #import "foo.h" int main() { MyObj *x = [MyObj new]; [x foo]; return 0; } asgard:/tmp$ mingw32-gcc -shared -Wl,--out-implib,libfoo.dll.a foo.m -o libfoo.dll -lobjc asgard:/tmp$ mingw32-gcc -L. test.m -lfoo -lobjc Info: resolving ___objc_class_name_MyObj by linking to __imp____objc_class_name_MyObj (auto-import) /usr/lib/gcc/mingw32/4.3.0/../../../../mingw32/bin/ld: warning: auto-importing has been activated without --enable-auto-import specified on the command line. This should work unless it involves constant data structures referencing symbols from auto-imported DLLs. asgard:/tmp$ wine a.exe objc runtime: cannot find class MyObj ------- Comment #1 from js-gcc at webkeks dot org 2009-03-15 15:34 ------- Fix: I guess some change to libobjc is needed so it can find classes inside DLLs. -- Summary: libobjc does not find classes of DLLs Product: gcc Version: 3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libobjc AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: js-gcc at webkeks dot org GCC build triplet: i686-pc-linux-gnu GCC host triplet: mingw32 GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39465