public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: David Allsopp <David.Allsopp@cl.cam.ac.uk>
To: "cygwin@cygwin.com" <cygwin@cygwin.com>
Subject: RE: Regression for OCaml introduced by rebase 4.4.4
Date: Fri, 09 Feb 2018 11:30:00 -0000	[thread overview]
Message-ID: <E51C5B015DBD1348A1D85763337FB6D90189A89353@Remus.metastack.local> (raw)
In-Reply-To: <20180208150438.GB21649@calimero.vinschen.de>

Corinna Vinschen wrote:
> On Feb  8 11:47, David Allsopp wrote:
> > TL;DR flexlink-compiled DLLs (i.e. ocaml libraries) are broken by the
> > 0x200000000 base address requirement added in rebase 4.4.4. Possible
> > fixes for this at the bottom.
> >
> > Commit bfd383 in the rebase sources introduces a new minimum base
> > address requirement of 0x200000000 for Cygwin64. This is a problem for
> > the correct operation of the flexdll package and affects ocaml. On a
> > fresh up-to-date
> > Cygwin64 installation, install the ocaml package:
> >
> >   $ rebase -i /usr/lib/ocaml/stublibs/*
> >   /usr/lib/ocaml/stublibs/dllbigarray.so    base 0x000000010000 size
> > 0x00015000 *
> >   /usr/lib/ocaml/stublibs/dllcamlstr.so     base 0x000000010000 size
> > 0x00014000 *
> >   /usr/lib/ocaml/stublibs/dllgraphics.so    base 0x000000010000 size
> > 0x00038000 *
> > [...]
> > Here you can see a problem we already know about with flexlink - all
> > libraries have a base address of 0x10000
> > (https://github.com/alainfrisch/flexdll/issues/50).
> >
> > However, this allows you to load libraries dynamically:
> >
> >   $ ocaml
> >           OCaml version 4.04.2
> >
> >   # #load "unix.cma";;
> >   # #directory "+threads";;
> >   # #load "threads.cma";;
> >
> > but not fork (we know about this problem):
> >
> >   # Unix.fork ();;
> >         0 [main] ocamlrun 5688 child_info_fork::abort: address space
> > needed by 'dllunix.so' (0x400000) is already occupied
> >   Exception: Unix.Unix_error (Unix.EAGAIN, "fork", "").
> >
> > Now do a rebaseall.
> >
> >   $ rebase -i /usr/lib/ocaml/stublibs/*
> >   /usr/lib/ocaml/stublibs/dllvmthreads.so   base 0x0003fec20000 size
> > 0x0001f000
> >   /usr/lib/ocaml/stublibs/dllunix.so        base 0x0003fec40000 size
> > 0x0004c000
> > [...]
> >
> > So forking should now be fine. However:
> >
> >   $ ocaml
> >           OCaml version 4.04.2
> >
> >   # #load "unix.cma";;
> >   Cannot load required shared library dllunix.
> >   Reason: /usr/lib/ocaml/stublibs/dllunix.so: flexdll error: cannot
> > relocate RELOC_REL32, target is too far: 0xfffffffc013d8b5f
> 0x13d8b5f.
> 
> The problem is this:  Given that the lib is in a safe space anyway, why
> do you still try to relocate it?  That's exactly what you don't have to
> do anymore and you shouldn't do this.  The DLL is loaded where it
> belongs, end of story.  What should another relocation gain?  So, just
> wwitch it off for 64 bit Cygwin, no?

See other message, but we're not relocating the DLL, we're performing COFF relocations on specific symbols which were deferred from link time.


David

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


  reply	other threads:[~2018-02-09 11:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-08 11:47 David Allsopp
2018-02-08 15:04 ` Corinna Vinschen
2018-02-09 11:30   ` David Allsopp [this message]
2018-02-08 15:15 ` Corinna Vinschen
2018-02-09 11:30   ` David Allsopp
2018-02-09 11:40     ` Corinna Vinschen
2018-02-09 13:11       ` Corinna Vinschen
2018-02-09 13:19         ` David Allsopp
2018-02-09 13:13       ` David Allsopp
2018-02-09 17:11         ` Corinna Vinschen
2018-02-15 11:44           ` David Allsopp
2018-02-15 12:02             ` Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E51C5B015DBD1348A1D85763337FB6D90189A89353@Remus.metastack.local \
    --to=david.allsopp@cl.cam.ac.uk \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).