From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 072857FB5F for ; Sat, 24 Oct 2015 12:59:17 +0200 (CEST) IronPort-PHdr: 9a23:fKGewhBR2li5PGv8WkfJUyQJP3N1i/DPJgcQr6AfoPdwSP/9oMbcNUDSrc9gkEXOFd2CrakU1qyO6+jJYi8p39WoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6kO74TNaIBjjLw09fr2zQd6PyZzvn8mJuLTtICxwzAKnZr1zKBjk5S7wjeIxxbVYF6Aq1xHSqWFJcekFjUlhJFaUggqurpzopM0r221qtvkg789NV7nhN+R9FOQATWduD2dgrvbsuBbfVwyXojM5U24WmxdMSUCR6RDxXp78tm3hsedyxDOdJeX3S6w5XXKp6KI9DFfYgTkGOiRx1GzNjd042JJSvhOsvVpbzpTTcamUMuB/d+XTZ4VeDSBKV8NVEihAGZ+Ubo0VDuNHM/wS5932rl4K6B+/HhWEBeX1yzYOiGWgjoMg1OF0PQjY3QBoNtYKq3PMtJ2hOL0bFOa407LgyDjfZuhK0Dz+roPPd0Zy8rm3QbtsfJ+JmgEUHATfgwDV8NS9Mg== Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=dra-news@metastack.com; spf=Pass smtp.mailfrom=dra-news@metastack.com; spf=None smtp.helo=postmaster@outmail149078.authsmtp.net Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of dra-news@metastack.com) identity=pra; client-ip=62.13.149.78; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="dra-news@metastack.com"; x-sender="dra-news@metastack.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of dra-news@metastack.com designates 62.13.149.78 as permitted sender) identity=mailfrom; client-ip=62.13.149.78; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="dra-news@metastack.com"; x-sender="dra-news@metastack.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@outmail149078.authsmtp.net) identity=helo; client-ip=62.13.149.78; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="dra-news@metastack.com"; x-sender="postmaster@outmail149078.authsmtp.net"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0BPAACcYytWmU6VDT5dgwqBAG8GqUAGlG0BDYFaHYYAAoEsOBQBAQEBAQEBARABAQEBAQgLCwchLoIrggcBAQEDAQM3RAsCAQgSBgoUEDIXAQ0BAQQBGoggCQMJxTMBAQEHAQEBAQEBAQEXBIYwhUWEOwEBHziDGoEUBZY2hRyIBgacKR8BAYJTFgeBVXKFWDqBBgEBAQ X-IPAS-Result: A0BPAACcYytWmU6VDT5dgwqBAG8GqUAGlG0BDYFaHYYAAoEsOBQBAQEBAQEBARABAQEBAQgLCwchLoIrggcBAQEDAQM3RAsCAQgSBgoUEDIXAQ0BAQQBGoggCQMJxTMBAQEHAQEBAQEBAQEXBIYwhUWEOwEBHziDGoEUBZY2hRyIBgacKR8BAYJTFgeBVXKFWDqBBgEBAQ X-IronPort-AV: E=Sophos;i="5.20,192,1444687200"; d="scan'208";a="151629842" Received: from outmail149078.authsmtp.net ([62.13.149.78]) by mail3-smtp-sop.national.inria.fr with ESMTP; 24 Oct 2015 12:59:15 +0200 Received: from mail-c232.authsmtp.com (mail-c232.authsmtp.com [62.13.128.232]) by punt22.authsmtp.com (8.14.2/8.14.2/) with ESMTP id t9OAxEOk088783; Sat, 24 Oct 2015 11:59:14 +0100 (BST) Received: from romulus.metastack.com (114.212-105-213.static.virginmediabusiness.co.uk [213.105.212.114]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2/) with ESMTP id t9OAxDWt044113; Sat, 24 Oct 2015 11:59:13 +0100 (BST) Received: from remus.metastack.local (remus.metastack.com [172.16.0.1]) by romulus.metastack.com (8.14.2/8.14.2) with ESMTP id t9OAxChZ020502 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Sat, 24 Oct 2015 11:59:12 +0100 Received: from Remus.metastack.local ([fe80::547c:3c42:e1da:eda2]) by Remus.metastack.local ([fe80::547c:3c42:e1da:eda2%10]) with mapi id 14.03.0248.002; Sat, 24 Oct 2015 11:59:12 +0100 From: David Allsopp To: "Soegtrop, Michael" , Xavier Leroy , "caml-list@inria.fr" Thread-Topic: [Caml-list] Effect of Windows LLP64 architecture on 64 bit MingW OCaml Thread-Index: AdENmsKQlrGb4SdjTW+mxn2nfuieSgACo8EAACYH9CAAAuWq8A== Date: Sat, 24 Oct 2015 10:59:10 +0000 Message-ID: References: <0F7D3B1B3C4B894D824F5B822E3E5A172CE32E38@IRSMSX102.ger.corp.intel.com> <562A5C92.50206@inria.fr> <0F7D3B1B3C4B894D824F5B822E3E5A172CE3315A@IRSMSX102.ger.corp.intel.com> In-Reply-To: <0F7D3B1B3C4B894D824F5B822E3E5A172CE3315A@IRSMSX102.ger.corp.intel.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.16.0.18] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Organization: MetaStack Solutions Ltd. X-Scanned-By: MIMEDefang 2.65 on 172.16.0.20 X-Server-Quench: 4319b259-7a3e-11e5-829e-00151795d556 X-AuthReport-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCd1ZAARAlZZVg1f DC4bFwdFRBksPQFF ChxFJgxfNl8UURhQ KkJXbgESJgdAAnZS R3kJW1VRQFxwU2Z8 YQtSIwdcYVRPXwB0 UklLXFNTEBpqBAMB SFoXLWg6A2ICeHp0 ZEdhEHFfXUB4O0J+ Q0cGF2gPeGAxazUC UUENch5ccgofYx9F a1V+U3oINWACYDQC Ml17DBs4ODEaLCVO XjRFAFwcTE0XVjky Dy8DGzkoAlZNYwEL cUBuI0QXHEcNP04u LEEsEVUee0FOQgdf AyMFJS5fKGZJYAEi CAcy X-Authentic-SMTP: 61633634383431.1037:706 X-AuthFastPath: 0 (Was 255) X-AuthSMTP-Origin: 213.105.212.114/25 X-AuthVirus-Status: No virus detected - but ensure you scan with your own anti-virus system. Subject: RE: [Caml-list] Effect of Windows LLP64 architecture on 64 bit MingW OCaml Michael Soegtrop wrote: > Dear Xavier, >=20 > yes, it answers my question, thanks! Andreas Hauptmann gave a similar > answer before, but apparently as private mail. So let me post my reply > here on the list: >=20 > Dear Andreas, >=20 > thanks for the pointers and details! Because the web doc is way outdated > (https://ocaml.org/docs/install.html states there is just a 32 bit mingw > build) I mistakenly tried to build mingw64 with configure and stumbled > over a few bad uses of long in auto-aux stuff. But I agree that the main > part of Ocaml looks clean in this respect. Just some libraries look a bit > fishy, e.g. >=20 > CAMLprim value unix_write(value fd, value buf, value vofs, value vlen) { > long ofs, len, written; > int numbytes, ret; > char iobuf[UNIX_BUFFER_SIZE]; >=20 > Begin_root (buf); > ofs =3D Long_val(vofs); > len =3D Long_val(vlen); >=20 > This assignment of Long_val to a long doesn't seem to be correct. Or is > this function just used for Linux? There are just 190 occurrences of > \blong\b in the whole sources. It might make sense to remove all such uses > outside of OS abstraction files. You need to look in otherlibs/win32unix for the Windows sources. otherlibs/= win32unix/write.c has intnat. > Btw.: The configure mechanism is not that bad for Mingw builds on Cygwin, > if host, target and prefix are set properly. The main problems are: >=20 > - config/auto-aux/runtest and its users get confused by Mingw test apps > returning strings terminated with \r\n instead of \n. Piping the output > through tr -d '\r' fixes this. > - bad uses of long in auto-aux files, e.g. endian.c > - The flexlink handling needs some fixes > - It is way odd that there is no -build option to configure like with gcc. > A compiler build needs to be aware of 3 OSes: the one on which the > compiler is build, the one on which the built compiler runs and the one > for which it generates code. For gcc all 3 are configurable. Some > configure/make things are clearer and easier if all 3 OSes are known. > E.g. pathes tend to be different on the build and host OS when building a > Mingw compiler on Cygwin. >=20 > I think it might be not so much work to get rid of the separate make files > and use configure for mingw and cygwin builds as well. FWIW, this might be pulling itself into my native Windows OPAM port - we're= interested in Windows/Cygwin cross-compilers (i.e. ocamlopt being a Cygwin= executable which outputs native Windows executables using mingw64/msvc and= vice versa) and it makes sense to unify the build process at the same time= as trying to do that. I did some preliminary work too a few years ago getting configure's output = to match the template files in config/ - a good initial step would be to ke= ep Makefile.nt but "hide" it from the user by having configure set which Ma= kefile actually gets called at the toplevel (i.e. you say make world and co= nfigure sets things up so that that is actually make -f Makefile.nt world i= f necessary). Quite apart from breaking mainline OCaml, the change will be = pretty invasive to forks and other branches being worked on!=20 David