[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: problem for ocaml-xstr on m68k



On Sun, 13 May 2001, Stefano Zacchiroli wrote:
>
>On Tue, May 08, 2001 at 03:44:29PM +0200, Stefano Zacchiroli wrote:
>> I've received the report for a bug on compiling ocaml-xstr on
>> architecture (strange !!! :)))
>[snip]
>> Fatal error: the file /usr/bin/install is not a bytecode executable file
>> make[1]: *** [install] Error 2
>> make[1]: Leaving directory `/build/buildd/xstr-0.2'
>> make: *** [install] Error 2
>
>unfortunately, the problem were not strictly related to a machine
>related issue.
>The problem still exists on m68k machine.
>
>I have take a look at the "ocamlfind install" execution with strace on
>the two arch, on i386 the file are installad by hand, while on m68k are
>installed using /usr/bin/install.
>
>And why /usr/bin/install fails ?
>
>This question is not related to ocamlfind-mini cause this shellscript is
>not installed.
>
>I obviously accept any kind of suggestion :), specially from Gerd :))

I suppose that the O'caml startup code does not work properly for executables
linked with -custom. The error message is misleading but is easy to explain if
you look at the file startup.c in ocaml/byterun: caml_main first calls
attemt_open with &argv[0] which is /path/to/ocamlfind. This fails (don't know
why). Then a piece of code is executed which is only necessary for ocamlrun,
i.e. it assumes the executable is invoked as ocamlrun ocamlfind. Because of
this, attemt_open is called with &argv[pos] where pos = position after
ocamlrun options, here pos = 1. attempt_open replaces argv[1] by the absolute
path of the (assumed) executable, so "install" is searched using PATH and
argv[1] becomes /usr/bin/install. The error message "the file xxx is not a
bytecode executable file" is printed in caml_main.

So the question is why attemt_open(&argv[0],...) is not working. To debug that
set OCAMLRUNPARAM='v=256' which forces attempt_open to output a bit more.

Gerd
-- 
----------------------------------------------------------------------------
Gerd Stolpmann      Telefon: +49 6151 997705 (privat)
Viktoriastr. 100             
64293 Darmstadt     EMail:   gerd@gerd-stolpmann.de
Germany                     
----------------------------------------------------------------------------
 



Reply to: