This is the mail archive of the cygwin-apps mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [HEADSUP] Please try to build your packages for 64 bit


Hi Bob,

On Apr 20 11:24, Bob Heckel wrote:
> On Fri, Apr 19, 2013 at 6:45 AM, Corinna Vinschen wrote:
> > ...
> > Right now, we have a couple of missing dependencies in the 64 bit
> > distro.  If one of the packages is yours, it would be nice if you could
> > try to build it.  Here's the list of missing deps as of today:
> > ...
> >   w3m
> > ...
> 
> Hi,
> 
> I'm having trouble packaging 64-bit gc-7.2d "libgc" (upon which w3m
> depends).  There are extensive 32-bit Cygwin adaptations to the upstream
> libgc code. After much trial and error it seems I lack the experience in
> Windows memory internals required to build a 64-bit port.
> 
> I'll continue trying but in the interest of speed, at this point I would
> gladly turn over this 64-bit package to any volunteer.

I skimmed through the os_dep.c file and at first glance I only see
one problem:

  # else /* CYGWIN32 */
    /* An alternate version for Cygwin (adapted from Dave Korn's        */
    /* gcc version of boehm-gc).                                        */
    GC_API int GC_CALL GC_get_stack_base(struct GC_stack_base *sb)
    {
      extern void * _tlsbase __asm__ ("%fs:4");
      sb -> mem_base = _tlsbase;
      return GC_SUCCESS;
    }
  # endif /* CYGWIN32 */

This only works on i686, but not on x86_64.  In theory, you could just
do something like this (x86_64 uses the %gs selector to point to the
Thread Environment Block, rather than %fs on i686, and the offset
reflects the different pointer size):

  #ifdef __x86_64__
      extern void * _tlsbase __asm__ ("%gs:8");
  #else
      extern void * _tlsbase __asm__ ("%fs:4");
  #endif

But that's kind of dangerous, because the x86_64 gcc can "optimize" this
wrongly.  We had this case in the 64 bit Cygwin as well at one point.  I
suggest to change the above code to this target-independent expression:

      extern void * _tlsbase = NtCurrentTeb()->Tib.StackBase;

If you have more strange problems, feel free to explain them here.


HTH,
Corinna

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]