caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] flexdll issue with lablgtk
@ 2015-10-26 16:43 Soegtrop, Michael
  2015-10-26 16:49 ` Alain Frisch
  2015-10-27  8:27 ` Andreas Hauptmann
  0 siblings, 2 replies; 5+ messages in thread
From: Soegtrop, Michael @ 2015-10-26 16:43 UTC (permalink / raw)
  To: Alain Frisch, caml-list

Dear Alain,

as it looks I want to build flexdll/flexlink from sources earlier than I intended ;-) There seems to be an issue with mingw64 builds of lablgtk on Cygwin:

https://github.com/alainfrisch/flexdll/issues/6

I did run into the same issue and wanted to ask if there is already a better fix than undoing the COMDAT section changes as mentioned above.

Also, since I still don't fully understand this, I wonder what is the proper way of doing. After I do the following steps:

- install binary version of flexdll
- build and install Ocaml
- build and install flexdll from source

Do I have to build and install Ocaml again using the new flexdll or would you think it is safe to keep the one build with the original flexdll?

Best regards,

Michael
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Prof. Dr. Hermann Eul
Chairperson of the Supervisory Board: Tiffany Doon Silva
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928


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

* Re: [Caml-list] flexdll issue with lablgtk
  2015-10-26 16:43 [Caml-list] flexdll issue with lablgtk Soegtrop, Michael
@ 2015-10-26 16:49 ` Alain Frisch
  2015-10-27  8:27 ` Andreas Hauptmann
  1 sibling, 0 replies; 5+ messages in thread
From: Alain Frisch @ 2015-10-26 16:49 UTC (permalink / raw)
  To: Soegtrop, Michael, caml-list

On 26/10/2015 17:43, Soegtrop, Michael wrote:
> I did run into the same issue and wanted to ask if there is already a better fix than undoing the COMDAT section changes as mentioned above.

I don't know a better fix.  If you confirm that the fix solves the 
problem, please let me know.

> Also, since I still don't fully understand this, I wonder what is the proper way of doing. After I do the following steps:
>
> - install binary version of flexdll
> - build and install Ocaml
> - build and install flexdll from source
>
> Do I have to build and install Ocaml again using the new flexdll or would you think it is safe to keep the one build with the original flexdll?

It should be safe to keep the original one, but of course, it would be 
good to confirm that the fix doesn't break anything in OCaml itself, so 
doing the full cycle again with the new flexdll would be nice.

Best regards,

Alain

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

* Re: [Caml-list] flexdll issue with lablgtk
  2015-10-26 16:43 [Caml-list] flexdll issue with lablgtk Soegtrop, Michael
  2015-10-26 16:49 ` Alain Frisch
@ 2015-10-27  8:27 ` Andreas Hauptmann
  2015-10-27  9:05   ` Soegtrop, Michael
  2015-10-27 10:06   ` Soegtrop, Michael
  1 sibling, 2 replies; 5+ messages in thread
From: Andreas Hauptmann @ 2015-10-27  8:27 UTC (permalink / raw)
  To: caml-list

Hi,

On Mon, 26 Oct 2015 16:43:38 +0000
Soegtrop, Michael wrote:
> https://github.com/alainfrisch/flexdll/issues/6
> 
> I did run into the same issue and wanted to ask if there is already a
> better fix than undoing the COMDAT section changes as mentioned above.

It either won't solve the issue or it will introduce new ones (I
don't remember details, but I've tried it). 

As a temporary workaround, you can try to strip your invalid dll files
(e.g. 'x86_64-w64-mingw32-strip --strip-unneeded  dlllablgtk2.dll') or
switch to an older version of the gcc-toolchain (4.8 or 4.7).


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

* RE: [Caml-list] flexdll issue with lablgtk
  2015-10-27  8:27 ` Andreas Hauptmann
@ 2015-10-27  9:05   ` Soegtrop, Michael
  2015-10-27 10:06   ` Soegtrop, Michael
  1 sibling, 0 replies; 5+ messages in thread
From: Soegtrop, Michael @ 2015-10-27  9:05 UTC (permalink / raw)
  To: Andreas Hauptmann, Alain Frisch, caml-list

[-- Attachment #1: Type: text/plain, Size: 1629 bytes --]

Dear Andreas, Alain,

since it was already almost through, I finished the flexdll bootstrapping build (get binary flexdll - build Ocaml - build flexdll - rebuild Ocaml) with the modified flexdll sources (patch attached for reference). My build environment is Mingw64 host/target build on Cygwin64.

My observations are:

- Some Ocaml binaries are substantially different between the first and second build (not just different build path). Not sure if this is expected.
- Menhir, CamlP4 and CamlP5 build fine with the second stage Ocaml, but I didn't test if they work. I run all my scripts with "set -o errexit", so I am quite sure that it was successful if it runs through.
- lablgtk make stops essentially with the first build command
 
	make -C src world
	make[1]: Entering directory '/home/soegtrop/OCAML/lablgtk-2.18.3/src'
	ocamlc.opt -c -pp "camlp4o -impl" -impl varcc.ml4
	Fatal error: cannot load shared library dllunix
	Reason: Invalid access to memory location.
	File "varcc.ml4", line 1:
	Error: Error while running external preprocessor
	Command line: camlp4o -impl "varcc.ml4" > D:\bin\cygwin64test\tmp\ocamlppa21f37

So as it looks this change results in a corrupted dllunix library.

I will now try the approach suggested by Andreas.

Best regards,

Michael
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Prof. Dr. Hermann Eul
Chairperson of the Supervisory Board: Tiffany Doon Silva
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

[-- Attachment #2: flexdll-0.34.patch --]
[-- Type: application/octet-stream, Size: 1088 bytes --]

diff -c flexdll-0.34.orig/reloc.ml flexdll-0.34.patched/reloc.ml
*** flexdll-0.34.orig/reloc.ml	2015-01-22 17:30:07.000000000 +0100
--- flexdll-0.34.patched/reloc.ml	2015-10-27 09:01:06.146099400 +0100
***************
*** 346,351 ****
--- 346,354 ----
      ) else true
    in
    let section sec =
+     (* M.SOEGTROP: disabled cause of problems with lablgtk for mingw64 build on cygwin.
+        See https://github.com/alainfrisch/flexdll/commit/37e6b5ad904b0d4648cebb09c19ed10e6f8dea28
+        
      if sec.sec_opts &&& 0x1000l <> 0l && has_prefix ".rdata$.refptr." sec.sec_name then
        begin
          (* under Cygwin64, gcc introduces mergable (link once) COMDAT sections to store
***************
*** 354,359 ****
--- 357,363 ----
          sec.sec_opts <- 0xc0500040l;
          sec.sec_name <- Printf.sprintf ".flexrefptrsection%i" (Oo.id (object end));
        end;
+     *)
  
      let min = ref Int32.max_int and max = ref Int32.min_int in
      let sym = lazy (let s = Symbol.intern sec 0l in
Common subdirectories: flexdll-0.34.orig/test and flexdll-0.34.patched/test

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

* RE: [Caml-list] flexdll issue with lablgtk
  2015-10-27  8:27 ` Andreas Hauptmann
  2015-10-27  9:05   ` Soegtrop, Michael
@ 2015-10-27 10:06   ` Soegtrop, Michael
  1 sibling, 0 replies; 5+ messages in thread
From: Soegtrop, Michael @ 2015-10-27 10:06 UTC (permalink / raw)
  To: Andreas Hauptmann, Alain Frisch (alain.frisch@lexifi.com), caml-list

Dear Andreas, Alain,

I just wanted to confirm that e.g. the following does build lablgtk successfully:

    make world || true
    x86_64-w64-mingw32-strip.exe --strip-unneeded src/dlllablgtk2.dll
    make world

Best regards,

Michael

Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Prof. Dr. Hermann Eul
Chairperson of the Supervisory Board: Tiffany Doon Silva
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928


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

end of thread, other threads:[~2015-10-27 10:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-26 16:43 [Caml-list] flexdll issue with lablgtk Soegtrop, Michael
2015-10-26 16:49 ` Alain Frisch
2015-10-27  8:27 ` Andreas Hauptmann
2015-10-27  9:05   ` Soegtrop, Michael
2015-10-27 10:06   ` Soegtrop, Michael

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 NNTP newsgroup(s).