caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: r0ller <r0ller@freemail.hu>
To: Gerd Stolpmann <info@gerd-stolpmann.de>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] ocamlc compiles hello world, ocamlopt not
Date: Fri, 11 Jan 2013 10:28:25 +0100 (CET)	[thread overview]
Message-ID: <freemail.20130111102825.32442.2@xmldata03.freemail.hu> (raw)
In-Reply-To: <1357834108.3150.198.camel@thinkpad>

Hi Gerd,

Minix3 is an ELF based system indeed. I asked the guys on the minix3 forum and one of the developers said that neither the default minix toolchain (clang) nor the minix port of gcc prepends leading underscores. However, he had a hint about checking if the ocaml package itself is trying to guess during its build whether leading underscore prepending is done on the host system or not. If so, that guessing might have gone wrong in case of minix3. After googling a bit, I found something indicating that point may be valid, (cited from http://asm.sourceforge.net/howto/conventions.html#AEN647 ):

Some C compilers prepend an underscore before every symbol, while others do not.
Particularly, Linux a.out GCC does such prepending, while Linux ELF GCC does not.
If you need to cope with both behaviors at once, see how existing packages do. For instance, get an old Linux source tree, the Elk, qthreads, or OCaml...

If that's true, I'd need to recompile the ocaml package whilst trying to indicate somehow that the minix3 system does not need leading underscore prepending, right? Do you think this to be a valid assumption? If so, do you happen to know how can I influence the ocaml build in such a way?

Thanks&regards,
r0ller


Gerd Stolpmann <info@gerd-stolpmann.de> írta:
>Am Donnerstag, den 10.01.2013, 15:48 +0100 schrieb r0ller:>
> Hi Gerd,>
> >
> Thanks for the quick answer! Please, find the output of nm attached -for the first try, size limit was exceeded, hopefully now it'll get through as attachment.>
>
Interesting. I guess you use an ELF-based system (Minix-3.2)? If not it>
could be a limitation of a.out.>
>
Another theory: the symbol names coming from assembler sources seem to>
always have a leading underscore, which seems to have been auto-added by>
the assembler. This is a very old convention you don't find on modern OS>
anymore, so it could be that this is the source of the problem. See>
http://stackoverflow.com/questions/2627511/why-do-c-compilers-prepend-underscores-to-external-names,>
but pay attention to the fact that at some day the underscore was>
handled differently, and was used for internal symbols. So what could>
have happened: The assembler still thinks that symbols from the C>
compiler are prefixed with an underscore, but this is in fact not true.>
This would be a problem of the installed compiler toolchain. Maybe you>
do not use the right assembler matching the C compiler?>
>
Gerd>
>
>
>
>
> Thanks&regards,>
> r0ller>
> >
> Gerd Stolpmann <info@gerd-stolpmann.de> írta:>
> >Am Donnerstag, den 10.01.2013, 14:57 +0100 schrieb r0ller@freemail.hu:>
> These errors would mean that stdlib.a and libasmrun.a do not contain the>
> symbols they are supposed to contain.>
> What's the output of>
> >
> nm /usr/local/lib/ocaml/libasmrun.a?>
> You should normally find here the missing symbols the linker is>
> complaining about.>
> >
> Gerd>
> >
> ------------------------------------------------------------>>
> Gerd Stolpmann, Darmstadt, Germany    gerd@gerd-stolpmann.de>>
> Creator of GODI and camlcity.org.>>
> Contact details:        http://www.camlcity.org/contact.html>>
> Company homepage:       http://www.gerd-stolpmann.de>>
> *** Searching for new projects! Need consulting for system>>
> *** programming in Ocaml? Gerd Stolpmann can help you.>>
> ------------------------------------------------------------>>
> >>
> >
> >
> -- >
> Caml-list mailing list.  Subscription management and archives:>
> https://sympa.inria.fr/sympa/arc/caml-list>
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners>
> Bug reports: http://caml.inria.fr/bin/caml-bugs>
>
-- >
------------------------------------------------------------>
Gerd Stolpmann, Darmstadt, Germany    gerd@gerd-stolpmann.de>
Creator of GODI and camlcity.org.>
Contact details:        http://www.camlcity.org/contact.html>
Company homepage:       http://www.gerd-stolpmann.de>
*** Searching for new projects! Need consulting for system>
*** programming in Ocaml? Gerd Stolpmann can help you.>
------------------------------------------------------------>
>
>
-- >
Caml-list mailing list.  Subscription management and archives:>
https://sympa.inria.fr/sympa/arc/caml-list>
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners>
Bug reports: http://caml.inria.fr/bin/caml-bugs

  reply	other threads:[~2013-01-11  9:28 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-10 14:48 r0ller
2013-01-10 16:08 ` Gerd Stolpmann
2013-01-11  9:28   ` r0ller [this message]
2013-01-11  9:56     ` Xavier Leroy
     [not found] <fa.rDSh+u4grOqB/jgTnZaDUQoT+s0@ifi.uio.no>
     [not found] ` <fa.53tG84D0PDsZ/dZaWLkOQvsLfTU@ifi.uio.no>
2013-01-16 10:20   ` r0ller
     [not found] <fa.tMEIU2eZ10ydMQJpEId8zYmuWpo@ifi.uio.no>
     [not found] ` <fa.5ytRg9PGwzfRT5U12a+96CThPHM@ifi.uio.no>
     [not found]   ` <fa.fEvQzwMsL9tn+Q+kKoqZrwKQpHs@ifi.uio.no>
     [not found]     ` <fa.gj9h88pWsiKoDqywSvikWobc2Gk@ifi.uio.no>
     [not found]       ` <fa.yuD604fWUWzMhQKQ2PVUY9+PSRs@ifi.uio.no>
     [not found]         ` <fa.SiWjqBgSRaJHHtRDr1LQlRGec/I@ifi.uio.no>
2013-01-16  9:29           ` r0ller
     [not found]           ` <fa.vGYTX053VB/7kO+WVlnBXs6LyWM@ifi.uio.no>
2013-01-16  9:36             ` r0ller
     [not found]             ` <fa.3ZA77VqUCTh0CDJf/dKc9fxM234@ifi.uio.no>
2013-01-16 10:16               ` r0ller
     [not found] <fa.J86NbZyp4NcoVDLx3IIZPjh6Xsw@ifi.uio.no>
     [not found] ` <fa.cI6IwITMmpEcG/xX8jnbm1tXnWU@ifi.uio.no>
2013-01-11 16:13   ` r0ller
2013-01-11 16:23     ` r0ller
2013-01-16  8:02       ` r0ller
2013-01-16  8:56         ` Francois Berenger
2013-01-16  9:01           ` AW: " Gerd Stolpmann
2013-01-16  9:48             ` Basile Starynkevitch
2013-01-16 22:32               ` Benedikt Meurer
2013-01-16 23:17                 ` Gabriel Scherer
2013-01-17 19:34                   ` Benedikt Meurer
  -- strict thread matches above, loose matches on Subject: below --
2013-01-10 13:57 r0ller
2013-01-10 14:25 ` Gerd Stolpmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=freemail.20130111102825.32442.2@xmldata03.freemail.hu \
    --to=r0ller@freemail.hu \
    --cc=caml-list@inria.fr \
    --cc=info@gerd-stolpmann.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).