[Pkg-ocaml-maint-commits] [SCM] bin-prot packaging branch, master, updated. debian/1.2.24-1-17-ga2c5a54
The following commit has been merged in the master branch: commit a2c5a54ba3c141a458b8775522476160a8bb094c Author: Stephane Glondu Date: Wed Jul 13 23:12:15 2011 +0200 Update changelog and prepare upload to unstable diff --git a/debian/changelog b/debian/changelog index 7214f3c..572f6d8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +bin-prot (1.3.1-2) unstable; urgency=low + + * Fix several portability issues (Closes: #631829) +- use cpp as default preprocessor on unknown OS (!linux) +- alignment (e.g. mipsel) +- endianness (e.g. mips) + * Fix bigstring layout bug (and FTBFS with OCaml 3.12.1) + + -- Stéphane Glondu Wed, 13 Jul 2011 23:12:12 +0200 + bin-prot (1.3.1-1) unstable; urgency=low * New upstream release -- bin-prot packaging ___ Pkg-ocaml-maint-commits mailing list Pkg-ocaml-maint-commits@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-ocaml-maint-commits
[Pkg-ocaml-maint-commits] [SCM] bin-prot packaging branch, master, updated. debian/1.2.24-1-17-ga2c5a54
The following commit has been merged in the master branch: commit 08cc68b4f09db35752a40d32d17f823e1f1487ea Author: Stephane Glondu Date: Wed Jul 13 23:02:57 2011 +0200 Fix endianness issues (e.g. mips) diff --git a/debian/patches/0004-Fix-endianness.patch b/debian/patches/0004-Fix-endianness.patch new file mode 100644 index 000..586cbd6 --- /dev/null +++ b/debian/patches/0004-Fix-endianness.patch @@ -0,0 +1,91 @@ +From: Stephane Glondu +Date: Wed, 13 Jul 2011 22:58:36 +0200 +Subject: Fix endianness + +Use functions from to cope with big-endiannes. Fixes FTBFS +on e.g. mips. + +Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=631829 +--- + lib/read_stubs.c |7 ++- + lib/write_stubs.c | 13 - + 2 files changed, 14 insertions(+), 6 deletions(-) + +diff --git a/lib/read_stubs.c b/lib/read_stubs.c +index c8dac01..2ac14cb 100644 +--- a/lib/read_stubs.c b/lib/read_stubs.c +@@ -22,6 +22,11 @@ + * * + **/ + ++#define _BSD_SOURCE ++#include ++ ++#define le8toh(x) (x) ++ + /* Stubs for reading basic values in the binary protocol */ + + #include "common_stubs.h" +@@ -90,7 +95,7 @@ static inline void raise_Read_error(int loc, unsigned long pos) + TYPE n; \ + if (unlikely(next > eptr)) \ + caml_raise_constant(*v_bin_prot_exc_Buffer_short); \ +-n = *(TYPE *) *sptr_ptr; \ ++n = le##SIZE##toh(*(TYPE *) *sptr_ptr); \ + CHECK \ + *sptr_ptr = next; \ + return n; \ +diff --git a/lib/write_stubs.c b/lib/write_stubs.c +index 1cd94c4..039e1b1 100644 +--- a/lib/write_stubs.c b/lib/write_stubs.c +@@ -22,6 +22,9 @@ + * * + **/ + ++#define _BSD_SOURCE ++#include ++ + /* Stubs for writing basic values in the binary protocol */ + + #include "common_stubs.h" +@@ -73,7 +76,7 @@ static inline value write_neg_int8(char *sptr, char *eptr, char n) + static inline void do_write_int16(char *sptr, short n) + { + *sptr++ = CODE_INT16; +- *(short *) sptr = n; ++ *(short *) sptr = htole16(n); + } + + static inline value write_int16(char *sptr, char *eptr, short n) +@@ -87,7 +90,7 @@ static inline value write_int16(char *sptr, char *eptr, short n) + static inline void do_write_int32(char *sptr, int n) + { + *sptr++ = CODE_INT32; +- *(int *) sptr = n; ++ *(int *) sptr = htole32(n); + } + + static inline value write_int32(char *sptr, char *eptr, int n) +@@ -102,7 +105,7 @@ static inline value write_int32(char *sptr, char *eptr, int n) + static inline void do_write_int64(char *sptr, long n) + { + *sptr++ = CODE_INT64; +- *(long *) sptr = n; ++ *(long *) sptr = htole64(n); + } + + static inline value write_int64(char *sptr, char *eptr, long n) +@@ -190,8 +193,8 @@ static inline value write_int64_type(char *sptr, char *eptr, int64 n) + if (unlikely(next > eptr)) caml_raise_constant(*v_bin_prot_exc_Buffer_short); + *sptr++ = CODE_INT64; + isptr = (int *) sptr; +- *isptr++ = I64_to_int32(n); +- *isptr = I64_to_int32(I64_lsr(n, 32)); ++ *isptr++ = htole32(I64_to_int32(n)); ++ *isptr = htole32(I64_to_int32(I64_lsr(n, 32))); + return (value) next; + } + +-- diff --git a/debian/patches/series b/debian/patches/series index 4367494..7395b4e 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,3 +1,4 @@ 0001-Fix-bigstring-layout-bug.patch 0002-Use-cpp-as-default-preprocessor-on-unknown-OS.patch 0003-Fix-alignment.patch +0004-Fix-endianness.patch -- bin-prot packaging ___ Pkg-ocaml-maint-commits mailing list Pkg-ocaml-maint-commits@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-ocaml-maint-commits
[Pkg-ocaml-maint-commits] [SCM] bin-prot packaging branch, master, updated. debian/1.2.24-1-17-ga2c5a54
The following commit has been merged in the master branch: commit 9dbdd60a85ce5c0ae5e825d1b0d99f2d3abde4e4 Author: Stephane Glondu Date: Wed Jul 13 09:29:17 2011 +0200 Use cpp as default preprocessor on unknown OS diff --git a/debian/patches/0002-Use-cpp-as-default-preprocessor-on-unknown-OS.patch b/debian/patches/0002-Use-cpp-as-default-preprocessor-on-unknown-OS.patch new file mode 100644 index 000..0e66cf0 --- /dev/null +++ b/debian/patches/0002-Use-cpp-as-default-preprocessor-on-unknown-OS.patch @@ -0,0 +1,29 @@ +From: Stephane Glondu +Date: Wed, 13 Jul 2011 09:22:50 +0200 +Subject: Use cpp as default preprocessor on unknown OS + +One could also add "GNU" (Hurd) and "GNU/kFreeBSD" as cases handled +the same way as Linux (but they are probably not the only ones). This +should be fix FTBFS on Debian's hurd-any and kfreebsd-any. + +Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=631829 +--- + myocamlbuild.ml |3 +-- + 1 files changed, 1 insertions(+), 2 deletions(-) + +diff --git a/myocamlbuild.ml b/myocamlbuild.ml +index 7f9d7ea..0f1653d 100644 +--- a/myocamlbuild.ml b/myocamlbuild.ml +@@ -469,9 +469,8 @@ let dispatch_default = MyOCamlbuildBase.dispatch_default package_default;; + let cpp = + let base_cpp = + match Ocamlbuild_pack.My_unix.run_and_open "uname -s" input_line with +-| "Linux" -> "cpp" + | "Darwin" -> "cc -E -x c -w" +-| s -> failwith ("unknow os: " ^ s) ++| _ -> "cpp" + in + match Sys.word_size with + | 64 -> S [A"-pp"; P(base_cpp ^" -DARCH_SIXTYFOUR")] +-- diff --git a/debian/patches/series b/debian/patches/series index 0b8bff1..2788b22 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1,2 @@ 0001-Fix-bigstring-layout-bug.patch +0002-Use-cpp-as-default-preprocessor-on-unknown-OS.patch -- bin-prot packaging ___ Pkg-ocaml-maint-commits mailing list Pkg-ocaml-maint-commits@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-ocaml-maint-commits
[Pkg-ocaml-maint-commits] [SCM] bin-prot packaging branch, master, updated. debian/1.2.24-1-17-ga2c5a54
The following commit has been merged in the master branch: commit 51e0f46c4068b918f796e2150670f1ea8f0b55bc Author: Stephane Glondu Date: Wed Jul 13 21:09:35 2011 +0200 Fix alignment issues (e.g. mipsel) diff --git a/debian/patches/0003-Fix-alignment.patch b/debian/patches/0003-Fix-alignment.patch new file mode 100644 index 000..e178ef3 --- /dev/null +++ b/debian/patches/0003-Fix-alignment.patch @@ -0,0 +1,46 @@ +From: Stephane Glondu +Date: Wed, 13 Jul 2011 21:02:17 +0200 +Subject: Fix alignment + +This patch fixes FTBFS on architectures that need aligned double +access (e.g. mipsel). + +Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=631829 +--- + lib/read_stubs.c |4 +++- + lib/write_stubs.c |3 ++- + 2 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/lib/read_stubs.c b/lib/read_stubs.c +index dfdef9e..c8dac01 100644 +--- a/lib/read_stubs.c b/lib/read_stubs.c +@@ -399,9 +399,11 @@ CAMLprim inline value read_float_stub(char **sptr_ptr, char *eptr) + { + char *sptr = *sptr_ptr; + char *next = sptr + sizeof(double); ++ double tmp; + if (unlikely(next > eptr)) caml_raise_constant(*v_bin_prot_exc_Buffer_short); + *sptr_ptr = next; +- return caml_copy_double(*(double *) sptr); ++ memcpy(&tmp, sptr, sizeof(double)); ++ return caml_copy_double(tmp); + } + + MK_ML_READER(float) +diff --git a/lib/write_stubs.c b/lib/write_stubs.c +index 68970ec..1cd94c4 100644 +--- a/lib/write_stubs.c b/lib/write_stubs.c +@@ -311,8 +311,9 @@ CAMLprim value write_string_stub(char *sptr, char *eptr, value v_str) + CAMLprim inline value write_float_stub(char *sptr, char *eptr, value v_n) + { + char *next = sptr + sizeof(double); ++ double tmp = Double_val(v_n); + if (unlikely(next > eptr)) caml_raise_constant(*v_bin_prot_exc_Buffer_short); +- *(double *) sptr = Double_val(v_n); ++ memcpy(sptr, &tmp, sizeof(double)); + return (value) next; + } + +-- diff --git a/debian/patches/series b/debian/patches/series index 2788b22..4367494 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,2 +1,3 @@ 0001-Fix-bigstring-layout-bug.patch 0002-Use-cpp-as-default-preprocessor-on-unknown-OS.patch +0003-Fix-alignment.patch -- bin-prot packaging ___ Pkg-ocaml-maint-commits mailing list Pkg-ocaml-maint-commits@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-ocaml-maint-commits
[Pkg-ocaml-maint-commits] [SCM] bin-prot packaging branch, master, updated. debian/1.2.24-1-17-ga2c5a54
The following commit has been merged in the master branch: commit 12c93c1c303bc1adcaafa86bcf4fe52041f9fa6f Author: Stephane Glondu Date: Wed Jul 13 09:18:55 2011 +0200 Fix bigstring layout bug (and FTBFS with OCaml 3.12.1) diff --git a/debian/patches/0001-Disable-bigstring-tests-temporary-measure.patch b/debian/patches/0001-Disable-bigstring-tests-temporary-measure.patch deleted file mode 100644 index 299e57f..000 --- a/debian/patches/0001-Disable-bigstring-tests-temporary-measure.patch +++ /dev/null @@ -1,37 +0,0 @@ -From: Stephane Glondu -Date: Mon, 27 Jun 2011 15:21:47 +0200 -Subject: Disable bigstring tests (temporary measure) - -They are failing because of changes in comparisons of big arrays in -OCaml 3.12.1... - lib_test/bin_prot_test.ml | 15 --- - 1 files changed, 0 insertions(+), 15 deletions(-) - -diff --git a/lib_test/bin_prot_test.ml b/lib_test/bin_prot_test.ml -index 75b7f31..d245f69 100644 a/lib_test/bin_prot_test.ml -+++ b/lib_test/bin_prot_test.ml -@@ -854,21 +854,6 @@ module Make (Spec : SPEC) (Read : Reader_spec) (Write : Writer_spec) = struct - ] - ); - --"bigstring" >:: -- (fun () -> --let n = 128 in --let header = 3 in --let size = header + n in --let bstr = mk_bigstring n in --check_all size "bigstring" -- Read.bin_read_bigstring -- Write.bin_write_bigstring -- [ --(bstr, "[| ... |]", size); --(mk_bigstring 0, "[||]", 1); -- ] -- ); -- - "variant_tag" >:: - (fun () -> - check_all 4 "variant_tag" --- diff --git a/debian/patches/0001-Fix-bigstring-layout-bug.patch b/debian/patches/0001-Fix-bigstring-layout-bug.patch new file mode 100644 index 000..cd327d5 --- /dev/null +++ b/debian/patches/0001-Fix-bigstring-layout-bug.patch @@ -0,0 +1,76 @@ +From: Markus Mottl +Date: Wed, 13 Jul 2011 09:16:25 +0200 +Subject: Fix bigstring layout bug + +This should only affect value comparisons with OCaml 3.12.1 or later +(and fixes FTBFS). Extracted from Markus Mottl's repository. + +Origin: http://hg.ocaml.info/release/bin-prot/raw-rev/bf832c1bc4af +--- + lib/read_ml.ml |2 +- + lib/read_stubs.c |8 + lib/unsafe_read_c.ml |2 +- + 3 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/lib/read_ml.ml b/lib/read_ml.ml +index dacb49e..6f054fc 100644 +--- a/lib/read_ml.ml b/lib/read_ml.ml +@@ -398,7 +398,7 @@ let bin_read_list bin_read_el buf ~pos_ref = + List.rev rev_lst + + #ifndef ARCH_SIXTYFOUR +-let dummy_float_buf = Array1.create char c_layout 8 ++let dummy_float_buf = create_buf 8 + let () = ignore (Write_ml.bin_write_float dummy_float_buf ~pos:0 3.1) + let max_array_length_2 = Sys.max_array_length / 2 + #endif +diff --git a/lib/read_stubs.c b/lib/read_stubs.c +index 396c345..dfdef9e 100644 +--- a/lib/read_stubs.c b/lib/read_stubs.c +@@ -517,7 +517,7 @@ CAMLprim inline value read_raw_string_stub( + + /* Reading bigarrays */ + +-#define MK_BA1_READER(NAME, TYPE, TFLAG) \ ++#define MK_BA1_READER(NAME, TYPE, TFLAG, TLAYOUT) \ + CAMLprim inline value read_##NAME##_stub(char **sptr_ptr, char *eptr) \ + { \ + unsigned long len = read_nat0(sptr_ptr, eptr); \ +@@ -531,7 +531,7 @@ CAMLprim inline value read_raw_string_stub( + dim = len; \ + v_res = \ + caml_ba_alloc( \ +-CAML_BA_##TFLAG | CAML_BA_FORTRAN_LAYOUT, 1, NULL, &dim); \ ++CAML_BA_##TFLAG | CAML_BA_##TLAYOUT##_LAYOUT, 1, NULL, &dim); \ + *sptr_ptr = next; \ + if (unlikely(tot_size > 65536)) { \ + Begin_roots1(v_res); \ +@@ -545,10 +545,10 @@ CAMLprim inline value read_raw_string_stub( + \ + MK_ML_READER(NAME) + +-MK_BA1_READER(bigstring, char, UINT8) ++MK_BA1_READER(bigstring, char, UINT8, C) + + #define MK_VEC_MAT_READERS(NAME, TYPE, TFLAG) \ +- MK_BA1_READER(NAME##_vec, TYPE, TFLAG) \ ++ MK_BA1_READER(NAME##_vec, TYPE, TFLAG, FORTRAN) \ + \ + CAMLprim inline value read_##NAME##_mat_stub(char **sptr_ptr, char *eptr) \ + { \ +diff --git a/lib/unsafe_read_c.ml b/lib/unsafe_read_c.ml +index 731a366..10f5d2c 100644 +--- a/lib/unsafe_read_c.ml b/lib/unsafe_read_c.ml +@@ -98,7 +98,7 @@ let bin_read_list bin_read_el sptr_ptr eptr = + List.rev rev_lst + + #ifndef ARCH_SIXTYFOUR +-let dummy_float_buf = Array1.create char c_layout 8 ++let dummy_float_buf = create_buf 8 + let () = ignore (Write_ml.bin_write_float dummy_float_buf ~pos:0 3.1) + let dummy_float_buf_eptr = get_eptr dummy_float_buf ~pos:0 + let max_array_length_2 = Sys.max_array_length / 2 +-- diff --git a/debian/patches/series b/debian/patches/series index 4623feb..0b8bff1 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1 @@ -0001-Disable-bigstring-tests-temporary-measure.patch +0001-Fix-bigstring-layout-bug.patch -- bin-prot packaging __