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 D84317EE33 for ; Fri, 3 Feb 2017 11:53:17 +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=3A7fv4bBZ5qOF4EKARbpNtri7/LSx+4OfEezUN459i?= =?us-ascii?q?sYplN5qZpc+9bnLW6fgltlLVR4KTs6sC0LuK9f+5EjVRqdbZ6TZZL8wKD0dEwe?= =?us-ascii?q?wt3CUeQ+e9QXXhK/DrayFoVO9jb3RCu0+BDE5OBczlbEfTqHDhpRQbGxH4KBYn?= =?us-ascii?q?br+tQt2ap42N2uuz45zeZRlTzHr4OOsqbUb+kQKEnckMgJB+Lb4x/TtXrXZSM7?= =?us-ascii?q?BdxXlpPk6Uhxa65sC985N52y9dv/87/slGXOPxeKFuHpJCCzFzFWE+48liri7k?= =?us-ascii?q?TwaD70w23n9exhxJCA/B5Qq8WZX8viK8vONn8C2XLcz4TPY/XjH0vPQjcwPhlC?= =?us-ascii?q?pSb21xy2rQkMElyfsD+B8=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0BeAAB7YJRYfSDMOLldGgEBAQECAQEBA?= =?us-ascii?q?QgBAQEBFAEBAQEBAQEBAQEBBwEBAQEBhAmBCQeDUZwTEJc4IoYAAoJSB0IVAQE?= =?us-ascii?q?BAQEBAQEBAQESAQELFApMgjMEARYBBIIWAQEBAwEjVgULCQILDSoCAiISAQUBH?= =?us-ascii?q?AYTiWkIBAGPV5ENP4wCgiWLOQEBAQcBAQEBASOLOodTgl8FlUqEUYFIhmiLIIJ?= =?us-ascii?q?OjjSKOIcLFB6BEwI1gW1QFwWEXoFJdAGHUYFOAQEB?= X-IPAS-Result: =?us-ascii?q?A0BeAAB7YJRYfSDMOLldGgEBAQECAQEBAQgBAQEBFAEBAQE?= =?us-ascii?q?BAQEBAQEBBwEBAQEBhAmBCQeDUZwTEJc4IoYAAoJSB0IVAQEBAQEBAQEBAQESA?= =?us-ascii?q?QELFApMgjMEARYBBIIWAQEBAwEjVgULCQILDSoCAiISAQUBHAYTiWkIBAGPV5E?= =?us-ascii?q?NP4wCgiWLOQEBAQcBAQEBASOLOodTgl8FlUqEUYFIhmiLIIJOjjSKOIcLFB6BE?= =?us-ascii?q?wI1gW1QFwWEXoFJdAGHUYFOAQEB?= X-IronPort-AV: E=Sophos;i="5.33,328,1477954800"; d="scan'208,217";a="258707588" 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 11:53:16 +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 5931152026 for ; Fri, 3 Feb 2017 11:53:16 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mtaout10.int.yaziba.net (Postfix) with ESMTP id 824FC160291 for ; Fri, 3 Feb 2017 11:53:16 +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 9j2qIDT2RAl3 for ; Fri, 3 Feb 2017 11:53:16 +0100 (CET) Received: from mail-qt0-f182.google.com (mail-qt0-f182.google.com [209.85.216.182]) by mtaout10.int.yaziba.net (Postfix) with ESMTPSA id 42C681600C5 for ; Fri, 3 Feb 2017 11:53:16 +0100 (CET) Received: by mail-qt0-f182.google.com with SMTP id k15so29190973qtg.3 for ; Fri, 03 Feb 2017 02:53:16 -0800 (PST) X-Gm-Message-State: AIkVDXItKiwb/FBZnJqsx5GBLAJxzASVRnIoskq0I7n5wEMTVCW/UwmKmy1plrw7Y6XHyFSD7Ew+lJYrW9DV0g== X-Received: by 10.200.34.28 with SMTP id o28mr13158378qto.269.1486119195180; Fri, 03 Feb 2017 02:53:15 -0800 (PST) MIME-Version: 1.0 Received: by 10.237.56.225 with HTTP; Fri, 3 Feb 2017 02:52:54 -0800 (PST) In-Reply-To: References: From: =?UTF-8?Q?Nicol=C3=A1s_Ojeda_B=C3=A4r?= Date: Fri, 3 Feb 2017 11:52:54 +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=001a1140f04cb90f5605479e169e X-DRWEB-SCAN: ok X-VRSPAM-SCORE: -100 X-VRSPAM-STATE: legit X-VRSPAM-CAUSE: gggruggvucftvghtrhhoucdtuddrfeelgedrjedugddvfecutefuodetggdotefrucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepjghfhfffkffuvfgtsegrtderredttdejnecuhfhrohhmpefpihgtohhljohspgfqjhgvuggrpgeumohruceonhhitgholhgrshdrohhjvggurgdrsggrrheslhgvgihifhhirdgtohhmqeenucffohhmrghinhepthgvshhtrdhmlhdpshhtuggpvgigihhtrdhmlhenucfkphepvddtledrkeehrddvudeirddukedvnecurfgrrhgrmhepmhhouggvpehsmhhtphhouhht X-VRSPAM-EXTCAUSE: mhhouggvpehsmhhtphhouhht Subject: Re: [Caml-list] Is there some builtin function that flushes buffers on shutdown? --001a1140f04cb90f5605479e169e Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 about > 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 -verbo= se >>> -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 cod= e (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 >>> >>> >> > --001a1140f04cb90f5605479e169e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Christoph,

You are right, but that i= s because std_exit.cmx does not get linked by default when using -output-ob= j, so
in fact you need to add it by hand:

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

Cheers!
Nico= las


On Fri, Feb 3, 2017 at 11:15 AM, Christoph H=C3= =B6ger <christoph.hoeger@celeraone.com> wrote:<= br>
That sounded totally rea= sonable, but is not the cause. When I think about it, it cannot work that w= ay, since the linker should have complained about a missing symbol, right?<= br>

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 l= ink $(ocamlc -where)/std_exit.o into your executable.

<= div>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=C2=A0 llvmlink ocamlfind opt -package ANSITermin= al -linkpkg -verbose -output-obj -o test.object.o
test.ml

=E2=9E=9C=C2=A0 llvmlink clang -I$(o= camlc -where) -lm wrapper.c test.object.o -o wrapper ~/.opam/4.04.0/lib/oca= ml/libunix.a -ldl ~/.opam/4.04.0/lib/ocaml/libasmrun.a /home/choe= ger/.opam/4.04.0/lib/ANSITerminal/libANSITerminal_stubs.a

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

Find attached the test sour= ces. 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 buffe= rs do not get flushed here. Does anyone know, why?

regards,
Christoph




--001a1140f04cb90f5605479e169e--