From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 6F2B07EE33 for ; Fri, 3 Feb 2017 10:16:42 +0100 (CET) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=nicolas.ojeda.bar@lexifi.com; spf=None smtp.mailfrom=nicolas.ojeda.bar@lexifi.com; spf=None smtp.helo=postmaster@vrout30.yaziba.net Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of nicolas.ojeda.bar@lexifi.com) identity=pra; client-ip=185.56.204.33; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="nicolas.ojeda.bar@lexifi.com"; x-sender="nicolas.ojeda.bar@lexifi.com"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of nicolas.ojeda.bar@lexifi.com) identity=mailfrom; client-ip=185.56.204.33; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="nicolas.ojeda.bar@lexifi.com"; x-sender="nicolas.ojeda.bar@lexifi.com"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@vrout30.yaziba.net) identity=helo; client-ip=185.56.204.33; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="nicolas.ojeda.bar@lexifi.com"; x-sender="postmaster@vrout30.yaziba.net"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3AI21G3xLQIMGCnkC0ftmcpTZWNBhigK39O0sv0rFi?= =?us-ascii?q?tYgUKfvxwZ3uMQTl6Ol3ixeRBMOAuq4C1LOd6/moGTRZp83e4DZaKN0EfiRGoP?= =?us-ascii?q?tVtjRoONSCB0z/IayiRA0BN+MGamVY+WqmO1NeAsf0ag6aiHSz6TkPBke3blIt?= =?us-ascii?q?dazdU7TfhMWv1u2054abI0AR3GL8MvtOK0CdrR/QrdURmYtVCjg+xwGB9nBIYe?= =?us-ascii?q?VN2WRwJRSTmBvz692Y95Nn/j5ZvPQsscVHVPOpUb4/SOl+DT8hN+ku0+rpuBXK?= =?us-ascii?q?eiED/DNIVGQdlR5BGE7C7hz2V9H7uzHSsudt2Sebe8bxSOZnCnyZ8653RUqw22?= =?us-ascii?q?88PDkj/TSS05QogQ=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0A8AAApSpRYlyHMOLldGwEBAQMBAQEJA?= =?us-ascii?q?QEBFQEBAQECAQEBAQgBAQEBhAmBCQeDUZwTEJc4IoYAAoJSB0MUAQEBAQEBAQE?= =?us-ascii?q?BAQESAQEBAQEIFghMgjMEARYBBIIXAQQBI1YFCwkCBAc3AgIiEgEFARwGE4lpC?= =?us-ascii?q?AQBjzGRDT+MAoIlizoBAQEHAQEBAQEjizqHU4JfBZVKhFGBSIZoiyCCTo40kUM?= =?us-ascii?q?UHoETAjaBbFAXBYQ5JYFJdIdSgU4BAQE?= X-IPAS-Result: =?us-ascii?q?A0A8AAApSpRYlyHMOLldGwEBAQMBAQEJAQEBFQEBAQECAQE?= =?us-ascii?q?BAQgBAQEBhAmBCQeDUZwTEJc4IoYAAoJSB0MUAQEBAQEBAQEBAQESAQEBAQEIF?= =?us-ascii?q?ghMgjMEARYBBIIXAQQBI1YFCwkCBAc3AgIiEgEFARwGE4lpCAQBjzGRDT+MAoI?= =?us-ascii?q?lizoBAQEHAQEBAQEjizqHU4JfBZVKhFGBSIZoiyCCTo40kUMUHoETAjaBbFAXB?= =?us-ascii?q?YQ5JYFJdIdSgU4BAQE?= X-IronPort-AV: E=Sophos;i="5.33,328,1477954800"; d="scan'208,217";a="258687995" Received: from vrout30.yaziba.net ([185.56.204.33]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 03 Feb 2017 10:16:30 +0100 Received: from mtaout20.int.yaziba.net (mtaout20.int.yaziba.net [10.4.20.37]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by vrout30.yaziba.net (mx10.yaziba.net) with ESMTPS id 01ECD52621 for ; Fri, 3 Feb 2017 10:16:30 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mtaout20.int.yaziba.net (Postfix) with ESMTP id 00CE71601EB for ; Fri, 3 Feb 2017 10:16:29 +0100 (CET) X-Virus-Scanned: amavisd-new at mtaout20.int.yaziba.net Received: from mtaout20.int.yaziba.net ([127.0.0.1]) by localhost (mtaout20.int.yaziba.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id P9fiAEDhlDnQ for ; Fri, 3 Feb 2017 10:16:29 +0100 (CET) Received: from mail-qt0-f177.google.com (mail-qt0-f177.google.com [209.85.216.177]) by mtaout20.int.yaziba.net (Postfix) with ESMTPSA id B07A01604D4 for ; Fri, 3 Feb 2017 10:16:29 +0100 (CET) Received: by mail-qt0-f177.google.com with SMTP id v23so25568667qtb.0 for ; Fri, 03 Feb 2017 01:16:29 -0800 (PST) X-Gm-Message-State: AIkVDXIlNqo06g0b2NTj/JOpI0vxT30WjTGGiwaSXGZadWqVSqhWfEipTlQv6RF1UPW+08jmYgDU5Zcg+xiwaQ== X-Received: by 10.237.62.182 with SMTP id n51mr12212698qtf.252.1486113388680; Fri, 03 Feb 2017 01:16:28 -0800 (PST) MIME-Version: 1.0 Received: by 10.237.56.225 with HTTP; Fri, 3 Feb 2017 01:16:08 -0800 (PST) In-Reply-To: References: From: =?UTF-8?Q?Nicol=C3=A1s_Ojeda_B=C3=A4r?= Date: Fri, 3 Feb 2017 10:16:08 +0100 X-Gmail-Original-Message-ID: Message-ID: To: =?UTF-8?Q?Christoph_H=C3=B6ger?= Cc: OCaml Mailing List Content-Type: multipart/alternative; boundary=001a113a384aa0f90405479cbc2f X-DRWEB-SCAN: ok X-VRSPAM-SCORE: -100 X-VRSPAM-STATE: legit X-VRSPAM-CAUSE: gggruggvucftvghtrhhoucdtuddrfeelgedrjedugddtfecutefuodetggdotefrucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepjghfhfffkffuvfgtsegrtderredttdejnecuhfhrohhmpefpihgtohhljohspgfqjhgvuggrpgeumohruceonhhitgholhgrshdrohhjvggurgdrsggrrheslhgvgihifhhirdgtohhmqeenucffohhmrghinhepthgvshhtrdhmlhenucfkphepvddtledrkeehrddvudeirddujeejnecurfgrrhgrmhepmhhouggvpehsmhhtphhouhht X-VRSPAM-EXTCAUSE: mhhouggvpehsmhhtphhouhht Subject: Re: [Caml-list] Is there some builtin function that flushes buffers on shutdown? --001a113a384aa0f90405479cbc2f Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Christoph, I can't check now, but it sounds like you forgot to link $(ocamlc -where)/std_exit.o into your executable. Cheers! Nicolas On Fri, Feb 3, 2017 at 9:56 AM, Christoph H=C3=B6ger < christoph.hoeger@celeraone.com> wrote: > Dear all, > > I managed to manually link and run an object file generated by ocamlopt. A > small part seems to be missing, however: > > =E2=9E=9C llvmlink ocamlfind opt -package ANSITerminal -linkpkg -verbose > -output-obj -o test.object.o test.ml > > =E2=9E=9C llvmlink clang -I$(ocamlc -where) -lm wrapper.c test.object.o = -o > wrapper ~/.opam/4.04.0/lib/ocaml/libunix.a -ldl ~/.opam/4.04.0/lib/ocaml/= libasmrun.a > /home/choeger/.opam/4.04.0/lib/ANSITerminal/libANSITerminal_stubs.a > > These commands produce an executable output, but the screen remains empty. > This changes, when I manually flush the stdout buffer in the code (I obta= in > the desired results then). > > Find attached the test sources. When I uncomment the Printf.printf in > test.ml, everything seems to work fine. But when I compile the test using > ocamlopt solely, this is not necessary. It seems some buffers do not get > flushed here. Does anyone know, why? > > regards, > > Christoph > > --001a113a384aa0f90405479cbc2f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Christoph,

I can't check now, bu= t it sounds like you forgot to link $(ocamlc -where)/std_exit.o into your e= xecutable.

Cheers!
Nicolas

On F= ri, Feb 3, 2017 at 9:56 AM, Christoph H=C3=B6ger <christoph.h= oeger@celeraone.com> wrote:
Dear all,

I managed= to manually link and run an object file generated by ocamlopt. A small par= t seems to be missing, however:

=E2=9E=9C=C2=A0 llvmlink ocamlfind o= pt -package ANSITerminal -linkpkg -verbose -output-obj -o test.object.o test.ml

=E2=9E=9C=C2= =A0 llvmlink clang -I$(ocamlc -where) -lm wrapper.c test.object.o -o wrappe= r ~/.opam/4.04.0/lib/ocaml/libunix.a -ldl ~/.opam/4.04.0/lib/ocaml/libasmrun.a /home/choeger/.opam/4.04.0/lib/ANSITerminal/libANSI= Terminal_stubs.a

These commands produce an executable output, = but the screen remains empty. This changes, when I manually flush the stdou= t buffer in the code (I obtain the desired results then).

Fin= d attached the test sources. When I uncomment the Printf.printf in test.ml, everything seems to work= fine. But when I compile the test using ocamlopt solely, this is not neces= sary. It seems some buffers do not get flushed here. Does anyone know, why?=

regards,

Christoph

<= /div>

--001a113a384aa0f90405479cbc2f--