gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Porting libobjc2 to MinGW


From: Hovik Melikyan
Subject: Re: Porting libobjc2 to MinGW
Date: Wed, 17 Dec 2014 11:34:38 +0000

Hi David,

The triple is i686-pc-windows-gnu (cmake's decision) and -fPIC is
used, still clang coredumps on the reference to GOT.

Anyway, I removed the caching mechanism with SmallObjectClasses that
was causing trouble and with some other changes got the library to
compile on MinGW. Half of the tests passed, so getting closer! Will
restore the cache of course, once I figure what PIC means on Windows.

Calling conventions: as I understand it, the first two arguments are
passed the same way on SysV and Win32. A bit more problematic are
values returned if they are structs and especially non-POD ones. In
fact the test suite doesn't verify these things, so will add tests at
some point.

Thanks, and will keep the list posted if there is any interest on this.


--
H.M.


On Wed, Dec 17, 2014 at 11:02 AM, David Chisnall <address@hidden> wrote:
> Hi,
>
> I'm not sure what relocations look like on Windows.  The best thing to do is 
> try compiling a simple program that refers to an extern global with -S -fPIC 
> and see what it looks like on Windows.  That said, I've just tried this and 
> my copy of clang emits code that looks like that and compiles it with the 
> i386-pc-mingw triple.  Is it perhaps a linker error, not a compiler error?
>
> Note that this code still won't actually work on Windows, as it assumes the 
> SysV calling convention.  Fixing it to work with Windows is not hard, but as 
> I don't have a Windows machine I'm unable to test it.
>
> David
>
> On 16 Dec 2014, at 03:15, Hovik Melikyan <address@hidden> wrote:
>
>> Hello,
>>
>> I'm trying to compile libobjc2 on Windows/MinGW. At the moment I'm
>> stuck on this line in objc_msgSend.x86-32.S:
>>
>>    addl  $_GLOBAL_OFFSET_TABLE_+(8b-7b), %ebx
>>
>> Clang aborts here with this message: "unsupported relocation type" (I
>> think it's an assertion).
>>
>> Command line used:
>>
>> clang.exe  -DGC_DEBUG -DGNUSTEP -DNO_LEGACY \
>>    -DTYPE_DEPENDENT_DISPATCH -D_BSD_SOURCE=1 \
>>    -D_XOPEN_SOURCE=700 -D__BSD_VISIBLE=1 \
>>    -D__OBJC_RUNTIME_INTERNAL__=1 -Dobjc_EXPORTS -fPIC \
>>    -c objc_msgSend.S
>>
>> with clang 3.5.
>>
>> I think I understand what global offset table is for, but I have no
>> clue why clang's assembly refuses to compile it.
>>
>> Any ideas on how to fix this line to compile and work on MinGW 32?
>>
>> (I'm pretty sure there are a lot more problems ahead with this port.
>> At least the calling convention in this asm file will have to be taken
>> care of, and possibly more. I'm just wondering if anyone has ever had
>> any success with it. I can't find anything apart from some older posts
>> here in 2010 then 2013, with no positive outcome.)
>>
>> Thanks!
>>
>> --
>> H.M.
>>
>> _______________________________________________
>> Gnustep-dev mailing list
>> address@hidden
>> https://lists.gnu.org/mailman/listinfo/gnustep-dev
>
>
>
>
> -- Sent from my IBM 1620
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]