described what to do regarding to -g with ocaml bytecode programs and libraries
authorStefano Zacchiroli <zack@debian.org>
Mon, 9 Apr 2007 17:51:12 +0000 (17:51 +0000)
committerStefano Zacchiroli <zack@debian.org>
Mon, 9 Apr 2007 17:51:12 +0000 (17:51 +0000)
debian/changelog
debian/policy/chapter-generalities.xml
debian/policy/chapter-libpack.xml
debian/policy/chapter-progpack.xml

index 1bc1ed85d91c31d1484ca23691428aac703d6181..d2abcad2ca0bc325af915fbd16782d4b89172965 100644 (file)
@@ -10,8 +10,11 @@ ocaml (3.09.3-2) UNRELEASED; urgency=low
       substituted for @OCamlDllDir@ in .in files
     - remove files which have been generated from their .in counterparts upon
       clean target invocation
+  * Policy
+    - mandate the compilation of *.cm[ao] with debugging information for
+      libraries and forbid it for bytecode programs
 
- -- Stefano Zacchiroli <zack@debian.org>  Tue,  2 Jan 2007 19:35:02 +0100
+ -- Stefano Zacchiroli <zack@debian.org>  Mon, 09 Apr 2007 19:46:36 +0200
 
 ocaml (3.09.3-1) experimental; urgency=low
 
index 7a920ae45fd66bf0dca04c36fbf07855d9472556..65afdd9edf78eeccc6329a8d77ed234ed6c1966e 100644 (file)
@@ -10,7 +10,7 @@
     <filename>ocamlopt</filename>) are generally faster than bytecode
     executables since they are compiled specifically for an
     architecture. Bytecode executables (produced by the compiler
-    <filename>ocamlc</filename>) have the advantage of being portable,
+    &ocamlc;) have the advantage of being portable,
     which means that a bytecode executable can be run on any
     architecture without having to be recompiled. Bytecode executables
     are smaller than native code executables. If considering only one
@@ -37,8 +37,8 @@
     <para>
     The <filename>ocaml-native-compilers</filename> package contains
     the OCaml compiler executables built in native mode:
-    <filename>ocamlc.opt</filename>, which produces bytecode, and
-    <filename>ocamlopt.opt</filename>, which produces native
+    <command>ocamlc.opt</command>, which produces bytecode, and
+    <command>ocamlopt.opt</command>, which produces native
     code. Since the OCaml compilers are themselves written in OCaml
     this package exists only on architectures where compilation to
     native code is supported.
@@ -47,7 +47,7 @@
     <para>
     The <filename>ocaml-nox</filename> package contains the OCaml
     compiler executables built in bytecode mode:
-    <filename>ocamlc</filename>, which produces bytecode, and on
+    <command>ocamlc</command>, which produces bytecode, and on
     architectures where compilation to native code is supported the
     compiler <filename>ocamlopt</filename>, which produces native
     code. It is important to understand that on architectures where
         <tbody>
           <row>
             <entry>Compiler executable in bytecode</entry>
-           <entry>ocamlc</entry>
-           <entry>ocamlopt</entry>
+           <entry><command>ocamlc</command></entry>
+           <entry><command>ocamlopt</command></entry>
           </row>
           <row>
             <entry>Compiler executable in native code</entry>
-           <entry>ocamlc.opt</entry>
-           <entry>ocamlopt.opt</entry>
+           <entry><command>ocamlc.opt</command></entry>
+           <entry><command>ocamlopt.opt</command></entry>
           </row>
         </tbody>
       </tgroup>
             </listitem>
             <listitem>
                 <para>
-                 The <filename>ocaml-native-compilers</filename> package contains the OCaml compilers built in native mode (<filename>ocamlc.opt</filename> and <filename>ocamlopt.opt</filename>).
+                 The <filename>ocaml-native-compilers</filename> package contains the OCaml compilers built in native mode (<command>ocamlc.opt</command> and <command>ocamlopt.opt</command>).
                </para>
                <note>
                  <para>The compilers themselves are built in native mode, nonetheless, both compilers for compiling toward bytecode and native code are contained in this package.</para>
          standard library directory</emphasis>, which is
        <filename>/usr/lib/ocaml/VERSION/</filename>, at the time of writing
        <filename>&ocaml-sys-dir;</filename>. This location can be obtained
-       from the OCaml compiler by invoking it as <code>ocamlc -where</code>.
+       from the OCaml compiler by invoking it as <userinput>ocamlc -where</userinput>.
       </para>
 
   </section>
         <itemizedlist>
             <listitem><para>bytecode executables (they can be recognized since they start with the shebang line <code>#!/usr/bin/ocamlrun</code>)</para></listitem>
            <listitem>
-             <para>bytecode executables linked in <emphasis>custom mode</emphasis>. They are generated by <filename>ocamlc</filename> (or <filename>ocamlc.opt</filename>), when the <code>-custom</code> flag is given at link time. Those executables are in ELF format and include both the final bytecode and the bytecode interpreter. <filename>strip</filename> should never be invoked on them, since it will remove the bytecode part.
+             <para>bytecode executables linked in <emphasis>custom mode</emphasis>. They are generated by <command>ocamlc</command> (or <command>ocamlc.opt</command>), when the <userinput>-custom</userinput> flag is given at link time. Those executables are in ELF format and include both the final bytecode and the bytecode interpreter. <command>strip</command> should never be invoked on them, since it will remove the bytecode part.
              </para>
            </listitem>
             <listitem><para>native executables (in ELF format)</para></listitem>
 
     <warning>
       <para>
-         The <varname>+</varname> preceding any library in the <option>-I</option> of ocamlc or ocamlopt won't be expanded to the local standard library path. You need to specify the path entirely.
+       The <varname>+</varname> preceding any library in the <option>-I</option> of <command>ocamlc</command> or <command>ocamlopt</command> won't be expanded to the local standard library path. You need to specify the path entirely.
       </para>
     </warning>
 
index d5c3c255b67b4b649af334ae9e78a6d4a45c1bef..01d8c5f48b0e449aba41e340cc79d69b746eaa83 100644 (file)
@@ -1,5 +1,5 @@
 <section>
-    <title>Creating a package for a library</title>
+    <title>Creating Packages for OCaml Libraries</title>
 
     <para>
         A package which provides an OCaml library called <filename>xxx</filename> should be split as follows:
                <para>
                  <filename>libxxx-ocaml-dev</filename> packages should be in <code>Section: libdevel</code>
                </para>
+               <para>
+                 All &ocaml-name; bytecode libraries
+                 (<filename>*.cma</filename>) and bytecode object files
+                 (<filename>*.cmo</filename>) should be compiled for
+                 debugging, i.e. they should be compiled passing the
+                 <option>-g</option> option to <command>ocamlc</command> (or
+                 <command>ocamlc.opt</command>).
+               </para>
             </listitem>
         </itemizedlist>
     </para>
index f380dce7041cbcf5c4841cde823f4141148f6144..c9de9e8cb281e8405d25cc223da6934a679e88ff 100644 (file)
@@ -75,8 +75,15 @@ the requirements of the compilation of the program.
 </para>
 
 <para>
-    Bytecode programs which are compiled by <code>ocamlc -custom</code> must not be stripped. In particular, their package should be excluded from the <filename>dh_strip</filename> script. When compiled this way, an elf executable is generated containing the ocaml interpreter, and the bytecode of the program in a section which is removed when the program is stripped. For more information, see the bug <ulink url="http://bugs.debian.org/256900">256900</ulink>. An override for the lintian warning is considered as acceptable in this situation.
+    Bytecode programs which are compiled by <userinput>ocamlc -custom</userinput> must not be stripped. In particular, their package should be excluded from the <command>dh_strip</command> script. When compiled this way, an elf executable is generated containing the ocaml interpreter, and the bytecode of the program in a section which is removed when the program is stripped. For more information, see the bug <ulink url="http://bugs.debian.org/256900">256900</ulink>. An override for the lintian warning is considered as acceptable in this situation.
 </para>
+
+<para>
+  Bytecode programs should not be compiled for debugging, i.e. they should not
+  be compiled passing the <option>-g</option> option to
+  <command>ocamlc</command> (or <command>ocamlc.opt</command>).
+</para>
+
 </section>
 
 <section id="bytecode-native-prog">