public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "gcc-bugzilla at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libobjc/39465]  New: libobjc does not find classes of DLLs
Date: Sun, 15 Mar 2009 15:34:00 -0000	[thread overview]
Message-ID: <bug-39465-17449@http.gcc.gnu.org/bugzilla/> (raw)


        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 <objc/Object.h>

        @interface MyObj: Object
        - (void)foo;
        @end
        asgard:/tmp$ cat foo.m
        #import <stdio.h>

        #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


             reply	other threads:[~2009-03-15 15:34 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-15 15:34 gcc-bugzilla at gcc dot gnu dot org [this message]
2009-03-16  7:27 ` [Bug libobjc/39465] " ayers at gcc dot gnu dot org
2009-03-16 11:24 ` js-gcc at webkeks dot org
2009-03-16 11:41 ` ayers at gcc dot gnu dot org
2009-03-16 11:46 ` js-gcc at webkeks dot org
2009-03-16 23:51 ` ayers at gcc dot gnu dot org
2009-03-17 14:05 ` js-gcc at webkeks dot org
2009-04-06 19:41 ` js-gcc at webkeks dot org
2009-04-06 21:22 ` ayers at gcc dot gnu dot org
2009-04-06 21:39 ` js-gcc at webkeks dot org
2009-04-06 21:59 ` ayers at gcc dot gnu dot org
2009-06-09 19:17 ` js-gcc at webkeks dot org
2009-06-09 19:27 ` js-gcc at webkeks dot org
2009-07-16 21:16 ` js-gcc at webkeks dot org
2009-12-20  0:31 ` js-gcc at webkeks dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-39465-17449@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).