64bit: C++ templates

Corinna Vinschen corinna-cygwin@cygwin.com
Thu May 16 08:25:00 GMT 2013

Hi Yaakov,

On May 15 11:32, Kai Tietz wrote:
> Hi,
> the issue is a more general on and related to harfbuzz' use of
> -fvisibility-inlines-hidden for mingw-targets, but not for cygwin
> targets.  Btw the issue should be latent present for 32-bit too.
> Well, nevertheless my test have shown that this option indeed fixes
> that described issue.

Yesterday it turned out that the visibility stuff is not the real
problem.  Mingw gcc 4.8 also produces the same set of symbols, but it
doesn't fail when linking.

Some more testing now showed clearly that this problem is related to the
high address used as base addresses in the Cygwin toolchain.  If you
build the harfbuzz DLL not with


but instead with a fixed address in the lower 31 bit address area,
for instance

  -Wl,--image-base -Wl,0x7ff00000

the problem disappears and you can successfully build the DLL.
Alternatively, you can also workaround this issue by building harfbuzz
with the -mcmodel=large option, which doesn't suffer this problem due to
the way symbols are only indirectly addressed.

Right now it seems this is a bfd bug in the relocation code.  The code
tests these 32 bit pc-relative offsets by checking if the result still
fits into 31 bit, without taking the high image base into account.
Also, for some reason this doesn't occur with all symbols, but only with
a very specific set of symbols (weak and a special kind of section

That's it for now.  We're still looking into providing a solution.


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

More information about the Cygwin-developers mailing list