[Bug libobjc/23214] New: libobjc doesn't initialize protocols in some cases

2005-08-03 Thread jeremy at deadbeef dot com
I have a test case and a patch that fixes this.  I found the problem on 
mingw32 but I believe that this will be a problem on every platform, and for 
every version of gcc (gnu Objc runtime only).

I will attempt to attach the testcase and patch.

-- 
   Summary: libobjc doesn't initialize protocols in some cases
   Product: gcc
   Version: 3.4.2
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: libobjc
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jeremy at deadbeef dot com
CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: mingw32
  GCC host triplet: mingw32
GCC target triplet: mingw32


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23214


[Bug libobjc/23214] libobjc doesn't initialize protocols in some cases

2005-08-03 Thread jeremy at deadbeef dot com

--- Additional Comments From jeremy at deadbeef dot com  2005-08-03 13:39 
---
Created an attachment (id=9419)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9419&action=view)
Patch to init.c in libobjc to fix protocol problem.

This patch is relative to CVS.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23214


[Bug libobjc/23214] libobjc doesn't initialize protocols in some cases

2005-08-03 Thread jeremy at deadbeef dot com

--- Additional Comments From jeremy at deadbeef dot com  2005-08-03 13:41 
---
Created an attachment (id=9420)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9420&action=view)
Test case #1

Complie like this
gcc -g protocolCase1.m -lobjc -o protocolCase1
then run the program and watch it crash.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23214


[Bug libobjc/23214] libobjc doesn't initialize protocols in some cases

2005-08-03 Thread jeremy at deadbeef dot com

--- Additional Comments From jeremy at deadbeef dot com  2005-08-03 13:44 
---
Created an attachment (id=9421)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9421&action=view)
test case #2a

Requires the protocolCase2b.m attachment as well.

Compile using gcc -g protocolCase2b.m protocolCase2.m -lobjc -o protocolCase2
run the program and watch it crash.

Don't change the link order, 2b.m must occur before 2.m or it won't fail.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23214


[Bug libobjc/23214] libobjc doesn't initialize protocols in some cases

2005-08-03 Thread jeremy at deadbeef dot com

--- Additional Comments From jeremy at deadbeef dot com  2005-08-03 13:44 
---
Created an attachment (id=9422)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9422&action=view)
test case #2b

See attachment 9421.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23214


[Bug libobjc/23215] New: libobjc doesn't work on windows.

2005-08-03 Thread jeremy at deadbeef dot com
2 problems:

I noticed that thr-win32.c has no implementation, only stubs.  There is a 
version that has implementation at http://savannah.gnu.org/cgi-
bin/viewcvs/gnustep/gnustep/dev-libs/libobjc/thr-win32.c?rev=HEAD&content-
type=text/vnd.viewcvs-markup
That is not my code, and I am not the copyright holder, so I don't know what 
you need to do to get this into gcc.

second problem, libobjc isn't built as a dll on windows, and it needs to be so 
that other dlls can use objective-c.

Solve those two problems, and objc on win32 will be perfect!

-- 
   Summary: libobjc doesn't work on windows.
   Product: gcc
   Version: 3.4.2
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: libobjc
AssignedTo: unassigned at gcc dot gnu dot org
    ReportedBy: jeremy at deadbeef dot com
CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: mingw32
  GCC host triplet: mingw32
GCC target triplet: mingw32


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23215


[Bug libobjc/23214] libobjc doesn't initialize protocols in some cases

2005-08-03 Thread jeremy at deadbeef dot com

--- Additional Comments From jeremy at deadbeef dot com  2005-08-03 13:52 
---
No no, it is not a duplicate.  You will see that test case #1 will still fail 
even after you fix bug 18255.  libobjc fails to initialize statics if the 
first static was initialized as a side effect of being used in a class.

-- 
   What|Removed |Added

 Status|RESOLVED|UNCONFIRMED
 Resolution|DUPLICATE   |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23214


[Bug libobjc/23215] libobjc doesn't work on windows.

2005-08-03 Thread jeremy at deadbeef dot com

--- Additional Comments From jeremy at deadbeef dot com  2005-08-03 14:17 
---
Subject: Re:  libobjc doesn't work on windows.

I did try --enable-shared, and it still did not compile as a dll.  Either 
the configure in the CVS repos is not up to date and needs to be regenerated 
from configure.ac or else something else is wrong.

- Original Message - 
From: "pinskia at gcc dot gnu dot org" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, August 03, 2005 8:57 AM
Subject: [Bug libobjc/23215] libobjc doesn't work on windows.


>
> --- Additional Comments From pinskia at gcc dot gnu dot org 
> 2005-08-03 13:57 ---
> libobjc inside GCC does not use thr-*.c (except for thr-objc.c which is 
> just a wrapper around the gthr-
> *.h files) at all but gthr-win32.h inside the gcc directory which is also 
> used by libstdc++.
>
> Did you try --enable-shared as I think building shared libraries on win32 
> is disabled by default?
> And if you want to report a bug about that, well that is really a libtool 
> bug.
>
> So I think this can be considered a non bug if --enabled-shared works for 
> you.
>
> -- 
>   What|Removed |Added
> 
>   Severity|normal  |minor
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23215
>
> --- You are receiving this mail because: ---
> You reported the bug, or are watching the reporter.
> 



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23215


[Bug libobjc/23215] libobjc doesn't work on windows.

2005-08-03 Thread jeremy at deadbeef dot com

--- Additional Comments From jeremy at deadbeef dot com  2005-08-03 17:32 
---
Sorry that this is not a nice diff, but I am working from unclean sources 
(mingw 3.4.4 snapshot source)

It appears that libobjc/Makefile.in needs a target like this:
libobjc.la: $(OBJS)
$(LIBTOOL_LINK) $(CC) -o $@ $(OBJS) \
-rpath $(glibcpp_toolexeclibdir) \
-version-info $(LIBOBJC_VERSION) -no-undefined

And then libtool has a bug also, in archive_expsym_cmds it checks to see if 
the first line of the def file has EXPORTS= in it, but in export_symbols_cmds 
it removed the EXPORTS line using sed.

Then --enable-shared might work.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23215


[Bug libobjc/23215] libobjc doesn't work on windows.

2005-08-03 Thread jeremy at deadbeef dot com

--- Additional Comments From jeremy at deadbeef dot com  2005-08-03 20:05 
---
Sorry, the key was the -no-undefined bit.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23215