[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ***JUNK MAIL*** FW: libobjc compile issue on mingw
From: |
David Chisnall |
Subject: |
Re: ***JUNK MAIL*** FW: libobjc compile issue on mingw |
Date: |
Sun, 18 Aug 2013 18:33:53 +0100 |
On 18 Aug 2013, at 18:25, Adam Fedor <address@hidden> wrote:
> I finally had some time to work on this and have got (perhaps) a little
> farther (I compiled with clang, although I get similar errors with gcc). I
> still these errors:
>
> h:/Source/nsis/sources/gstep-current/svn-libobjc2/block_trampolines.S:113:
> Error: junk at end of line, first unrecognized character is `-'
>
> Which I can solve by deleting these lines in block_trampolines.S and
> objc_msgSend.S:
>
> Index: block_trampolines.S
> ===================================================================
> --- block_trampolines.S (revision 36982)
> +++ block_trampolines.S (working copy)
> @@ -110,5 +110,4 @@
> CDECL(__objc_block_trampoline_end_sret):
> #endif
> #if HAS_SECTION_DIRECTIVE
> -.section .note.GNU-stack,"",%progbits
> #endif
>
> Which didn't seem to cause any side effects, but then I ran into the errors
> Jerry had below. Based on some googling, I tried to fix the this error by
> removing "-fPIC" and defining "-DDLL_EXPORT", but that didn't seem to help.
> Finally I just removed this line (sorry, I don't know any assembly):
The correct fix is probably to ensure that HAS_SECTION_DIRECTIVE is not defined
on win32 (or just change it to #ifdef __ELF__, since I think that is only
needed on ELF platforms).
> Index: objc_msgSend.x86-32.S
> ===================================================================
> --- objc_msgSend.x86-32.S (revision 36982)
> +++ objc_msgSend.x86-32.S (working copy)
> @@ -80,7 +80,6 @@
> 7:
> popl %ebx;
> 8:
> - addl $_GLOBAL_OFFSET_TABLE_+(8b-7b), %ebx
> leal address@hidden(%ebx), %eax
> mov (%eax), %eax
> popl %ebx
>
> and the file compiled, but I got an error message later when linking (which
> appears related):
>
> CMakeFiles/objc.dir/objc_msgSend.S.obj:fake:(.text+0x72): undefined reference
> to address@hidden'
> CMakeFiles/objc.dir/objc_msgSend.S.obj:fake:(.text+0x84): undefined reference
> to address@hidden'
> CMakeFiles/objc.dir/objc_msgSend.S.obj:fake:(.text+0x101): undefined
> reference to address@hidden'
> CMakeFiles/objc.dir/objc_msgSend.S.obj:fake:(.text+0x113): undefined
> reference to address@hidden'
> CMakeFiles/objc.dir/objc_msgSend.S.obj:fake:(.text+0x190): undefined
> reference to address@hidden'
> CMakeFiles/objc.dir/objc_msgSend.S.obj:fake:(.text+0x1a2): undefined
> reference to address@hidden'
>
> I'm still trying to find something that works for that. Also, FYI asprintf
> and mkstemp are not defined on MingW, but it's trivial to add a definition
> for those (patch attached, although probably in the wrong place).
I believe that for win32, you should be able to replace this entire sequence
with a direct reference to SmallObjectClasses, as DLLs on Win32 are not
position-independent code (the sequence from the call 7f to the leal are just
finding the address of SmallObjectClasses).
I believe that Mathieu had some patches to fix the memory allocation in
block_to_imp.c correctly.
David
>
> Adam
> <mingw.patch>
>
>
>
> On Jul 10, 2013, at 7:48 AM, Jerry White <address@hidden> wrote:
>
>> David, this is Jerry White again. I am writing you from my personal email
>> because I am having to do this testing away from the office.
>>
>> I deleted my previous download of libobjc2 and obtained the trunk, as you
>> suggested. The compilation appears to get a little further now in that we
>> get past block_trampolines.S. Now we appear to get stuck on objc_msgSend.S
>> (as you guessed would happen). I am including the pertinent output below.
>>
>> Assembling block_trampolines.S...
>> Assembling objc_msgSend.S...
>> c:/gnustep/bin/../lib/gcc/mingw32/4.6.1/../../../../mingw32/bin/as.exe: BFD
>> (GNU Binutils) 2.21.53.2
>> 0110804 assertion fail ../../binutils-2.21.53/bfd/coff-i386.c:584
>> ./objc_msgSend.x86-32.S: Assembler messages:
>> ./objc_msgSend.x86-32.S:98: Error: cannot represent relocation type
>> BFD_RELOC_386_GOTPC
>> c:/gnustep/bin/../lib/gcc/mingw32/4.6.1/../../../../mingw32/bin/as.exe: BFD
>> (GNU Binutils) 2.21.53.2
>> 0110804 assertion fail ../../binutils-2.21.53/bfd/coff-i386.c:584
>> ./objc_msgSend.x86-32.S:102: Error: cannot represent relocation type
>> BFD_RELOC_386_GOTPC
>> c:/gnustep/bin/../lib/gcc/mingw32/4.6.1/../../../../mingw32/bin/as.exe: BFD
>> (GNU Binutils) 2.21.53.2
>> 0110804 assertion fail ../../binutils-2.21.53/bfd/coff-i386.c:584
>> ./objc_msgSend.x86-32.S:106: Error: cannot represent relocation type
>> BFD_RELOC_386_GOTPC
>> clang.exe: error: assembler (via gcc) command failed with exit code 1 (use
>> -v to see invocation)
>> make: *** [objc_msgSend.o] Error 1
>
> _______________________________________________
> Gnustep-dev mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/gnustep-dev