public inbox for cygwin-developers@cygwin.com
 help / color / mirror / Atom feed
* Error building libffi on x86_64
@ 2013-03-13  4:27 Yaakov
  2013-03-13  9:25 ` Kai Tietz
  2013-03-13  9:28 ` Kai Tietz
  0 siblings, 2 replies; 5+ messages in thread
From: Yaakov @ 2013-03-13  4:27 UTC (permalink / raw)
  To: cygwin-developers

I have encountered the following error attempting to build
libffi-3.0.12 on Cygwin:

src/x86/.libs/win64.o:/usr/src/debug/libffi-3.0.12-1/src/x86/win64.S:298:(.text+0x69): relocation truncated to fit: R_X86_64_32S against symbol `ffi_closure_win64_inner' defined in .text section in src/x86/.libs/ffi.o

The only matches on Google for this sort of error were for >2GB code on
Linux, but I suspect the problem here is with the medium code model.

Here's what I'm working with:

http://cygwin-ports.git.sourceforge.net/git/gitweb.cgi?p=cygwin-ports/libffi


Yaakov

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Error building libffi on x86_64
  2013-03-13  4:27 Error building libffi on x86_64 Yaakov
@ 2013-03-13  9:25 ` Kai Tietz
  2013-03-13 10:14   ` Yaakov
  2013-03-13  9:28 ` Kai Tietz
  1 sibling, 1 reply; 5+ messages in thread
From: Kai Tietz @ 2013-03-13  9:25 UTC (permalink / raw)
  To: cygwin-developers

2013/3/13 Yaakov <yselkowitz@users.sourceforge.net>:
> I have encountered the following error attempting to build
> libffi-3.0.12 on Cygwin:
>
> src/x86/.libs/win64.o:/usr/src/debug/libffi-3.0.12-1/src/x86/win64.S:298:(.text+0x69): relocation truncated to fit: R_X86_64_32S against symbol `ffi_closure_win64_inner' defined in .text section in src/x86/.libs/ffi.o

Hmm, I think the issue is here that the instruction used at this place
misses ip-relative addressing.

At line 298  we have       mov     $SYMBOL_NAME(ffi_closure_win64_inner), %rax

Could you try if you get same isse with that line replaced by  lea
SYMBOL_NAME(ffi_closure_win64_inner)(%rip), %rax

> The only matches on Google for this sort of error were for >2GB code on
> Linux, but I suspect the problem here is with the medium code model.

Well, as ffi_closure_win64_inner is a *near* symbol to win64.S - as it
is within same library and is a static one - I suspect that the issue
is related to medium (means far data) scenario.

Otherway might be to translate libffi itself by using the option
-mcmodel=small instead.  BUt I assuem it is more related by
none-ip-relative addressing within that assembler file.

> Here's what I'm working with:
>
> http://cygwin-ports.git.sourceforge.net/git/gitweb.cgi?p=cygwin-ports/libffi
>
>
> Yaakov

Kai

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Error building libffi on x86_64
  2013-03-13  4:27 Error building libffi on x86_64 Yaakov
  2013-03-13  9:25 ` Kai Tietz
@ 2013-03-13  9:28 ` Kai Tietz
  1 sibling, 0 replies; 5+ messages in thread
From: Kai Tietz @ 2013-03-13  9:28 UTC (permalink / raw)
  To: cygwin-developers

Hi Jakoov,

2013/3/13 Yaakov schrieb:
> I have encountered the following error attempting to build
> libffi-3.0.12 on Cygwin:
>
> src/x86/.libs/win64.o:/usr/src/debug/libffi-3.0.12-1/src/x86/win64.S:298:(.text+0x69): relocation truncated to fit: R_X86_64_32S against symbol `ffi_closure_win64_inner' defined in .text section in src/x86/.libs/ffi.o

Hmm, I think the issue is here that the instruction used at this place
misses ip-relative addressing.

At line 298  we have       mov     $SYMBOL_NAME(ffi_closure_win64_inner), %rax

Could you try if you get same isse with that line replaced by  lea
SYMBOL_NAME(ffi_closure_win64_inner)(%rip), %rax

> The only matches on Google for this sort of error were for >2GB code on
> Linux, but I suspect the problem here is with the medium code model.

Well, I am a bit in doubt about this due libffi is a static library,
which is always near to an image.  But well ...

> Here's what I'm working with:
>
> http://cygwin-ports.git.sourceforge.net/git/gitweb.cgi?p=cygwin-ports/libffi
>
>
> Yaakov

Kai

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Error building libffi on x86_64
  2013-03-13  9:25 ` Kai Tietz
@ 2013-03-13 10:14   ` Yaakov
  2013-03-13 10:38     ` Teemu Nätkinniemi
  0 siblings, 1 reply; 5+ messages in thread
From: Yaakov @ 2013-03-13 10:14 UTC (permalink / raw)
  To: cygwin-developers

On Wed, 13 Mar 2013 10:25:03 +0100, Kai Tietz wrote:
> 2013/3/13 Yaakov:
> > I have encountered the following error attempting to build
> > libffi-3.0.12 on Cygwin:
> >
> > src/x86/.libs/win64.o:/usr/src/debug/libffi-3.0.12-1/src/x86/win64.S:298:(.text+0x69): relocation truncated to fit: R_X86_64_32S against symbol `ffi_closure_win64_inner' defined in .text section in src/x86/.libs/ffi.o
> 
> Hmm, I think the issue is here that the instruction used at this place
> misses ip-relative addressing.
> 
> At line 298  we have       mov     $SYMBOL_NAME(ffi_closure_win64_inner), %rax
> 
> Could you try if you get same isse with that line replaced by  lea
> SYMBOL_NAME(ffi_closure_win64_inner)(%rip), %rax

That compiles; results of make check:

                === libffi Summary ===

# of expected passes            1754
# of unexpected failures        10
# of unexpected successes       44
# of expected failures          6
# of unsupported tests          55

The failures were in libffi.call/cls_longdouble.c execution tests and
libffi.special/unwindtest.cc tests.  I have uploaded dejagnu and
expect, and updated my patch accordingly.

> > The only matches on Google for this sort of error were for >2GB code on
> > Linux, but I suspect the problem here is with the medium code model.
> 
> Well, as ffi_closure_win64_inner is a *near* symbol to win64.S - as it
> is within same library and is a static one - I suspect that the issue
> is related to medium (means far data) scenario.

Standalone libffi is built as a shared library.

> Otherway might be to translate libffi itself by using the option
> -mcmodel=small instead.  BUt I assuem it is more related by
> none-ip-relative addressing within that assembler file.

Thanks for the help,


Yaakov

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Error building libffi on x86_64
  2013-03-13 10:14   ` Yaakov
@ 2013-03-13 10:38     ` Teemu Nätkinniemi
  0 siblings, 0 replies; 5+ messages in thread
From: Teemu Nätkinniemi @ 2013-03-13 10:38 UTC (permalink / raw)
  To: cygwin-developers

On Wed, Mar 13, 2013 at 12:14 PM, Yaakov
<yselkowitz@users.sourceforge.net> wrote:
> On Wed, 13 Mar 2013 10:25:03 +0100, Kai Tietz wrote:
>> 2013/3/13 Yaakov:
>> > I have encountered the following error attempting to build
>> > libffi-3.0.12 on Cygwin:
>> >
>> > src/x86/.libs/win64.o:/usr/src/debug/libffi-3.0.12-1/src/x86/win64.S:298:(.text+0x69): relocation truncated to fit: R_X86_64_32S against symbol `ffi_closure_win64_inner' defined in .text section in src/x86/.libs/ffi.o
>>
>> Hmm, I think the issue is here that the instruction used at this place
>> misses ip-relative addressing.
>>
>> At line 298  we have       mov     $SYMBOL_NAME(ffi_closure_win64_inner), %rax
>>
>> Could you try if you get same isse with that line replaced by  lea
>> SYMBOL_NAME(ffi_closure_win64_inner)(%rip), %rax
>
> That compiles; results of make check:

Great as now Python can be compiled successfully, I noticed that
ctypes didn't compile earlier as it depends on libffi but for some
reason cygport compiled and packaged it.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-03-13 10:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-13  4:27 Error building libffi on x86_64 Yaakov
2013-03-13  9:25 ` Kai Tietz
2013-03-13 10:14   ` Yaakov
2013-03-13 10:38     ` Teemu Nätkinniemi
2013-03-13  9:28 ` Kai Tietz

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).