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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 59AC87EE33 for ; Fri, 3 Feb 2017 12:38:24 +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@vrout10.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.32; 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.32; 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@vrout10.yaziba.net) identity=helo; client-ip=185.56.204.32; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="nicolas.ojeda.bar@lexifi.com"; x-sender="postmaster@vrout10.yaziba.net"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3A7XeQ4RNX44X+nw4L/UUl6mtUPXoX/o7sNwtQ0KIM?= =?us-ascii?q?zox0KP/8rarrMEGX3/hxlliBBdydsKMYzbWP+PqwESxYuNDa7yBEKMQNHzY+yu?= =?us-ascii?q?wo3CUYSPafDkP6KPO4JwcbJ+9lEGFfwnegLEJOE9z/bVCB6le77DoVBwmtfVEt?= =?us-ascii?q?fre9Msfogs+2z+G//YHIK0UN3WLlIOA6EBLjhgXLt9IKhpNiHYavxRbT6i9De/?= =?us-ascii?q?5X3n9vPVLVnxHx6cqq1JVu9ylKsvUn+ohLVqCsLIoiSrkNKjUtNGS8//rMtxTP?= =?us-ascii?q?RDylamFUBmMXmR1MChOD6xP3Up63uCLgnu5wyCiUPIv9SrViCmfq1LtiVBK90H?= =?us-ascii?q?RPDDU+6myCz5Uo1K8=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0BeAAAqa5RYfSDMOLldGgEBAQECAQEBA?= =?us-ascii?q?QgBAQEBFAEBAQEBAQEBAQEBBwEBAQEBhAmBCQeDUZwTEJc4IoYAAoJTB0MUAQE?= =?us-ascii?q?BAQEBAQEBAQESAQELFApMgjMEARYBBIIWAQEBAwEjVgULCQILDSoCAiISAQUBH?= =?us-ascii?q?AYTiWkIBAGPYZENP4wCgiWLOAEBAQcBAQEBASOLOodTgl8FlUqEUYFIhmiLIIJ?= =?us-ascii?q?OjjSKOIcLFB6BEwI2gWxQFwWEXoFJdAGHUYFOAQEB?= X-IPAS-Result: =?us-ascii?q?A0BeAAAqa5RYfSDMOLldGgEBAQECAQEBAQgBAQEBFAEBAQE?= =?us-ascii?q?BAQEBAQEBBwEBAQEBhAmBCQeDUZwTEJc4IoYAAoJTB0MUAQEBAQEBAQEBAQESA?= =?us-ascii?q?QELFApMgjMEARYBBIIWAQEBAwEjVgULCQILDSoCAiISAQUBHAYTiWkIBAGPYZE?= =?us-ascii?q?NP4wCgiWLOAEBAQcBAQEBASOLOodTgl8FlUqEUYFIhmiLIIJOjjSKOIcLFB6BE?= =?us-ascii?q?wI2gWxQFwWEXoFJdAGHUYFOAQEB?= X-IronPort-AV: E=Sophos;i="5.33,328,1477954800"; d="scan'208,217";a="258714361" Received: from vrout10.yaziba.net ([185.56.204.32]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 03 Feb 2017 12:38:23 +0100 Received: from mtaout10.int.yaziba.net (mtaout10.int.yaziba.net [10.4.20.36]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by vrout10.yaziba.net (mx10.yaziba.net) with ESMTPS id E4583522A8 for ; Fri, 3 Feb 2017 12:38:22 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mtaout10.int.yaziba.net (Postfix) with ESMTP id DA5FD1602BF for ; Fri, 3 Feb 2017 12:38:22 +0100 (CET) X-Virus-Scanned: amavisd-new at Received: from mtaout10.int.yaziba.net ([127.0.0.1]) by localhost (mtaout10.int.yaziba.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 9YArfzMZyzRg for ; Fri, 3 Feb 2017 12:38:22 +0100 (CET) Received: from mail-qt0-f170.google.com (mail-qt0-f170.google.com [209.85.216.170]) by mtaout10.int.yaziba.net (Postfix) with ESMTPSA id 980AE1600D6 for ; Fri, 3 Feb 2017 12:38:22 +0100 (CET) Received: by mail-qt0-f170.google.com with SMTP id w20so30020352qtb.1 for ; Fri, 03 Feb 2017 03:38:22 -0800 (PST) X-Gm-Message-State: AMke39mku1C2I0NQmqQqF9EQrj4jaVEdy5iRE4CPegljme+N4KIYj8c19rMWsBgBAJgiLtmcMrR/O4in/WGi8Q== X-Received: by 10.55.168.68 with SMTP id r65mr13763557qke.189.1486121899715; Fri, 03 Feb 2017 03:38:19 -0800 (PST) MIME-Version: 1.0 Received: by 10.237.56.225 with HTTP; Fri, 3 Feb 2017 03:37:59 -0800 (PST) In-Reply-To: References: From: =?UTF-8?Q?Nicol=C3=A1s_Ojeda_B=C3=A4r?= Date: Fri, 3 Feb 2017 12:37:59 +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=94eb2c06575cecfc8605479eb74c X-DRWEB-SCAN: ok X-VRSPAM-SCORE: -100 X-VRSPAM-STATE: legit X-VRSPAM-CAUSE: gggruggvucftvghtrhhoucdtuddrfeelgedrjedugdefvdcutefuodetggdotefrucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepjghfhfffkffuvfgtsegrtderredttdejnecuhfhrohhmpefpihgtohhljohspgfqjhgvuggrpgeumohruceonhhitgholhgrshdrohhjvggurgdrsggrrheslhgvgihifhhirdgtohhmqeenucffohhmrghinhepthgvshhtrdhmlhdpshhtuggpvgigihhtrdhmlhenucfkphepvddtledrkeehrddvudeirddujedtnecurfgrrhgrmhepmhhouggvpehsmhhtphhouhht X-VRSPAM-EXTCAUSE: mhhouggvpehsmhhtphhouhht Subject: Re: [Caml-list] Is there some builtin function that flushes buffers on shutdown? --94eb2c06575cecfc8605479eb74c Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable That should be std_exit.cmx, not std_exit.ml. Sorry about the typo. Cheers, Nicolas On Fri, Feb 3, 2017 at 11:52 AM, Nicol=C3=A1s Ojeda B=C3=A4r < nicolas.ojeda.bar@lexifi.com> wrote: > Hi Christoph, > > You are right, but that is because std_exit.cmx does not get linked by > default when using -output-obj, so > in fact you need to add it by hand: > > ocamlfind opt -package ANSITerminal -linkpkg -verbose -output-obj -o > test.object.o test.ml std_exit.ml > > Cheers! > Nicolas > > > > On Fri, Feb 3, 2017 at 11:15 AM, Christoph H=C3=B6ger < > christoph.hoeger@celeraone.com> wrote: > >> That sounded totally reasonable, but is not the cause. When I think about >> it, it cannot work that way, since the linker should have complained abo= ut >> a missing symbol, right? >> >> On Fri, Feb 3, 2017 at 10:16 AM, Nicol=C3=A1s Ojeda B=C3=A4r < >> nicolas.ojeda.bar@lexifi.com> wrote: >> >>> 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 -verb= ose >>>> -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 co= de (I >>>> obtain 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 >>>> >>>> >>> >> > --94eb2c06575cecfc8605479eb74c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
That should be std_exit.cmx, not std_exit.ml.

Sorry about the typo.
<= br>
Cheers,
Nicolas


On Fri, Feb 3, 2017 at 11:= 52 AM, Nicol=C3=A1s Ojeda B=C3=A4r <nicolas.ojeda.bar@lexifi.co= m> wrote:
= Hi Christoph,

You are right, but that is because std_exi= t.cmx does not get linked by default when using -output-obj, so
i= n fact you need to add it by hand:

=C2=A0 ocamlfin= d opt -package ANSITerminal -linkpkg -verbose -output-obj -o test.object.o = test.ml std_exit.ml

Che= ers!
Nicolas



On Fri, Feb 3, 2017 at 11:15 AM, Christoph H=C3=B6ger <christoph.hoeger@celeraone.com> wrote:
That sounded totally reasonable, b= ut is not the cause. When I think about it, it cannot work that way, since = the linker should have complained about a missing symbol, right?
<= div class=3D"m_6654372845565649398HOEnZb">

On Fri, Feb= 3, 2017 at 10:16 AM, Nicol=C3=A1s Ojeda B=C3=A4r <nicolas.ojed= a.bar@lexifi.com> wrote:
Hi Christoph,

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

Cheers!
Nicolas

<= /div>
<= div class=3D"m_6654372845565649398m_803961760944610414h5">

On Fri, Feb 3, 2017 at 9:56 AM, Ch= ristoph H=C3=B6ger <christoph.hoeger@celeraone.com&g= t; wrote:
Dear all,

I managed to manually link and run= an object file generated by ocamlopt. A small part seems to be missing, ho= wever:

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

=E2=9E=9C=C2=A0 llvmlink clang -I$(ocam= lc -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 empt= y. This changes, when I manually flush the stdout buffer in the code (I obt= ain 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 buffer= s do not get flushed here. Does anyone know, why?

regards,
=
Christoph





--94eb2c06575cecfc8605479eb74c--