Bug#827798: package mame FTBFS on mips64el (unrecognized command line option '-m64')

2016-06-22 Thread Daniel Knezevic
Hi,

You are right. I have changed the patch.
This patch is tested on mipsel and mips64el successfully.

Regards,
Daniel
--- mame-0.173.orig/makefile
+++ mame-0.173/makefile
@@ -150,6 +150,9 @@ endif
 ifneq ($(filter powerpc,$(UNAME_P)),)
 PLATFORM := powerpc
 endif 
+ifneq ($(filter mips64%,$(UNAME_M)),)
+ifeq ($(shell getconf LONG_BIT),64)
+PLATFORM := mips64
+endif
+endif
 ifeq ($(firstword $(filter Linux,$(UNAME))),Linux)
 OS := linux
 endif
--- mame-0.173.orig/scripts/genie.lua
+++ mame-0.173/scripts/genie.lua
@@ -1005,6 +1005,12 @@ if (_OPTIONS["PLATFORM"]=="arm64") then
 	}
 end
 
+if (_OPTIONS["PLATFORM"]=="mips64") then
+defines {
+"PTR64=1",
+}
+end
+
 local subdir
 if (_OPTIONS["target"] == _OPTIONS["subtarget"]) then
 	subdir = _OPTIONS["osd"] .. "/" .. _OPTIONS["target"]


Bug#827798: package mame FTBFS on mips64el (unrecognized command line option '-m64')

2016-06-21 Thread Daniel Knezevic
Package: mame
Version: 0.173-6
Severity: important
Tags: sid + patch
Justification: FTBFS
User: debian-m...@lists.debian.org
Usertags: mips-patch

Hello,
Package mame FTBFS on mips64el with following error:
g++: error: unrecognized command line option '-m64'

build log:
https://buildd.debian.org/status/fetch.php?pkg=mame=mips64el=0.173-6=1464007306

-m64 flag is not supported on mips64el.

I have created two patches. One patch is to remove -m64 flag for mips64el.
The other patch is for debian/rules, it adds -no-keep-memory flag for mips64el 
to fix linker issues with memory consumption.

Patches are tested on mips64el, i386 and amd64.
With these patches package was build successfully.

Please include these patches.

Thank you!

Regards,
Daniel
--- mame-0.173/debian/rules	2016-05-21 00:43:02.0 +
+++ ../mame/mame-0.173/debian/rules	2016-06-16 14:56:33.0 +
@@ -95,9 +95,7 @@
 endif
 
 ifeq ($(DEB_BUILD_ARCH),mips64el)
-DEB_OPTS += \
-PTR64=1 \
-NOASM=
+export DEB_LDFLAGS_MAINT_APPEND = -Wl,--no-keep-memory
 endif
 
 ifeq ($(DEB_BUILD_ARCH),powerpc)
--- mame-0.173.orig/makefile
+++ mame-0.173/makefile
@@ -150,6 +150,9 @@ endif
 ifneq ($(filter powerpc,$(UNAME_P)),)
 PLATFORM := powerpc
 endif 
+ifneq ($(filter mips64%,$(UNAME_M)),)
+PLATFORM := mips64
+endif
 ifeq ($(firstword $(filter Linux,$(UNAME))),Linux)
 OS := linux
 endif
--- mame-0.173.orig/scripts/genie.lua
+++ mame-0.173/scripts/genie.lua
@@ -1005,6 +1005,12 @@ if (_OPTIONS["PLATFORM"]=="arm64") then
 	}
 end
 
+if (_OPTIONS["PLATFORM"]=="mips64") then
+defines {
+"PTR64=1",
+}
+end
+
 local subdir
 if (_OPTIONS["target"] == _OPTIONS["subtarget"]) then
 	subdir = _OPTIONS["osd"] .. "/" .. _OPTIONS["target"]


Bug#827979: package quantlib-swig FTBFS on mips/mipsel (virtual memory exhausted)

2016-06-23 Thread Daniel Knezevic
Package: quantlib-swig
Version: 1.8-1
Severity: important
Tags: sid + patch
Justification: FTBFS
User: debian-m...@lists.debian.org
Usertags: mips-patch

Hello,
Package quantlib-swig FTBFS on mips and mipsel with following error:
virtual memory exhausted: Cannot allocate memory
error: command 'g++' failed with exit status 1

build logs:
https://buildd.debian.org/status/fetch.php?pkg=quantlib-swig=mips=1.8-1=1464237100
https://buildd.debian.org/status/fetch.php?pkg=quantlib-swig=mipsel=1.8-1=1464237390

I tried to reduce ggc-min-expand to 20, and with this change package compiles 
for me.

With attached patch I was able to build quantlib-swig successfully for both 
mips and mipsel.

Regards,
Daniel
--- orig/quantlib-swig-1.8/debian/rules	2016-06-23 11:48:51.0 +
+++ quantlib-swig-1.8/debian/rules	2016-06-23 09:21:51.0 +
@@ -62,7 +62,7 @@
 ## edd 06 Dec 2014  patch by Dejan Latinovic (see #772028) to add -mxgot
 ifneq "$(findstring $(cpu), mipsel mips)" ""
 #compilerflags   = -O2 -g0 
-compilerflags   = -O0 -g0 -mxgot
+compilerflags   = -O0 -g0 -mxgot --param ggc-min-expand=20
 endif
 
 ## edd 25 Dec 2002  g++-3.2 for s390


Bug#832575: dune-grid FTBFS on mips, mipsel (virtual memory exhausted)

2016-07-27 Thread Daniel Knezevic
Package: dune-grid
Version: 2.4.1-1
Severity: important
Tags: sid + patch
Justification: FTBFS
User: debian-m...@lists.debian.org
Usertags: mips-patch

Hi,

Package dune-grid FTBFS on mips and mipsel with following error:
virtual memory exhausted: Cannot allocate memory

build logs:
https://buildd.debian.org/status/fetch.php?pkg=dune-grid=mips=2.4.1-1=1466966398
https://buildd.debian.org/status/fetch.php?pkg=dune-grid=mipsel=2.4.1-1=1456760195

I tried to reduce ggc-min-expand to 20, and with this change package compiles 
for me.

With attached patch I was able to build dune-grid successfully for both mips 
and mipsel.

Regards,
Daniel
--- dune-grid-2.4.1.orig/configure.ac
+++ dune-grid-2.4.1/configure.ac
@@ -22,6 +22,16 @@ AC_SUBST([LDADD], '$(top_builddir)/dune/
 # make DUNE_GRID_LIBDIR available as it is needed for the alberta libs
 AC_SUBST(DUNE_GRID_LIBDIR, '$(top_builddir)/lib')

+# Check the platform information.
+AC_CANONICAL_HOST
+case "${host_cpu}" in
+mips | mipsel)
+AC_SUBST([TEST_CXXFLAGS], ["--param ggc-min-expand=20"])
+;;
+*)
+;;
+esac
+
 DUNE_SUMMARY_ALL

 # write output
--- dune-grid-2.4.1.orig/dune/grid/test/Makefile.am
+++ dune-grid-2.4.1/dune/grid/test/Makefile.am
@@ -63,7 +63,7 @@ EXTRA_PROGRAMS = $(ALBERTA_EXTRA_PROGS)

 # output coverage
 #COVERAGE = -fprofile-arcs -ftest-coverage
-AM_CXXFLAGS = $(COVERAGE)
+AM_CXXFLAGS = $(COVERAGE) @TEST_CXXFLAGS@
 AM_CPPFLAGS = @AM_CPPFLAGS@ -DHAVE_DUNE_GRID=1

 # The directory where the example grid files used for testing are located


Bug#830854: fsa FTBFS on mips*, arm* (unrecognized command line option '-m64')

2016-07-12 Thread Daniel Knezevic
Package: fsa
Version: 1.15.9+dfsg-1
Severity: important
Tags: sid + patch
Justification: FTBFS
User: debian-m...@lists.debian.org
Usertags: mips-patch
Forwarded: https://sourceforge.net/p/fsa/bugs/7/

Hi,

Package fsa FTBFS on mips* and arm* with following error:
g++: error: unrecognized command line option '-m64'

build logs:
https://buildd.debian.org/status/fetch.php?pkg=fsa=mips=1.15.9%2Bdfsg-1=1466041102
https://buildd.debian.org/status/fetch.php?pkg=fsa=mips64el=1.15.9%2Bdfsg-1=1466041193
https://buildd.debian.org/status/fetch.php?pkg=fsa=mipsel=1.15.9%2Bdfsg-1=1466040956

-m64 flag is not supported on mips* and arm* achitectures.

Patch is tested on mips, mipsel, mips64el and i386.
Patch may fix the build for arm but it is not tested.

Regards,
Daniel
--- fsa-1.15.9+dfsg.orig/configure.ac
+++ fsa-1.15.9+dfsg/configure.ac
@@ -76,7 +76,7 @@ case "${host_cpu}-${host_os}" in
 	esac;;
   *)
 AC_MSG_CHECKING([if gcc accepts -m64])
-CFLAGS="-m64"
+CXXFLAGS="-m64"
 AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
 		  [ext_CFLAGS="-m64"; AC_MSG_RESULT([yes])],
 		  [ext_CFLAGS="-D_FILE_OFFSET_BITS=64"; AC_MSG_RESULT([no])]);;



Bug#832426: sipwitch FTBFS on mips64el - incorrect symbols

2016-07-25 Thread Daniel Knezevic
Package: sipwitch
Version: 1.9.15-3
Severity: important
Tags: sid + patch
Justification: FTBFS
User: debian-m...@lists.debian.org
Usertags: mips-patch

Hi,


Package sipwitch FTBFS on mips64el with following error:
dpkg-gensymbols: warning: some new symbols appeared in the symbols file: see 
diff output below
dpkg-gensymbols: warning: some symbols or patterns disappeared in the symbols 
file: see diff output below
dpkg-gensymbols: warning: debian/libsipwitch1/DEBIAN/symbols doesn't match 
completely debian/libsipwitch1.symbols
--- debian/libsipwitch1.symbols (libsipwitch1_1.9.15-3_mips64el)
+++ dpkg-gensymbolsqMAiNS   2016-05-06 11:26:51.143472215 +
@@ -276,6 +276,8 @@
  _ZTVN8sipwitch7service8callbackE@Base 1.9.15
  _ZTVN8sipwitch7serviceE@Base 1.9.15
  _ZTVN8sipwitch9UserCacheE@Base 1.9.15
+ _ZTv0_n40_N7ucommon9stringbufILm1024EED0Ev@Base 1.9.15-3
+ _ZTv0_n40_N7ucommon9stringbufILm1024EED1Ev@Base 1.9.15-3
  (c++)"virtual thunk to sipwitch::Cache::~Cache()@Base" 1.9.15
  (c++)"virtual thunk to sipwitch::UserCache::release()@Base" 1.9.15
  (c++)"virtual thunk to sipwitch::UserCache::~UserCache()@Base" 1.9.15
@@ -283,6 +285,6 @@
  (c++)"virtual thunk to sipwitch::modules::sipwitch::~sipwitch()@Base" 1.9.15
  (c++)"virtual thunk to sipwitch::service::callback::~callback()@Base" 1.9.15
  (c++)"virtual thunk to sipwitch::service::~service()@Base" 1.9.15
- (c++|arch=!amd64 !arm64 !kfreebsd-amd64 !ppc64el !s390x !sparc64)"virtual 
thunk to ucommon::stringbuf<1024u>::~stringbuf()@Base" 1.9.15
+#MISSING: 1.9.15-3# (c++|arch=!amd64 !arm64 !kfreebsd-amd64 !ppc64el !s390x 
!sparc64)"virtual thunk to ucommon::stringbuf<1024u>::~stringbuf()@Base" 1.9.15
  (c++|arch=amd64 arm64 kfreebsd-amd64 ppc64el s390x sparc64)"virtual thunk to 
ucommon::stringbuf<1024ul>::~stringbuf()@Base" 1.9.15
  (c++)"virtual thunk to ucommon::treemap::~treemap()@Base" 1.9.15
dh_makeshlibs: failing due to earlier errors
/usr/share/cdbs/1/rules/debhelper.mk:262: recipe for target 
'binary-fixup/libsipwitch1' failed
make: *** [binary-fixup/libsipwitch1] Error 255

https://buildd.debian.org/status/fetch.php?pkg=sipwitch=mips64el=1.9.15-3=1462534017

The attached patch adds support to mips64el in debian/libsipwitch1.symbols file.

With this patch I was able to build sipwitch successfully for mips64el.

Thanks,
Daniel
--- orig/sipwitch-1.9.15/debian/libsipwitch1.symbols2016-04-24 16:05:44.0 +
+++ sipwitch-1.9.15/debian/libsipwitch1.symbols 2016-07-25 11:28:54.226686087 +
@@ -1,4 +1,4 @@
-# SymbolsHelper-Confirmed: 1.9.15 amd64 arm64 armel armhf hppa hurd-i386 i386 kfreebsd-amd64 kfreebsd-i386 m68k mips mipsel powerpc ppc64el s390x sparc64
+# SymbolsHelper-Confirmed: 1.9.15 amd64 arm64 armel armhf hppa hurd-i386 i386 kfreebsd-amd64 kfreebsd-i386 m68k mips mipsel mips64el powerpc ppc64el s390x sparc64
 libsipwitch.so.1 libsipwitch1 #MINVER#
  (optional=templinst)_ZN7ucommon12mapped_arrayIN8sipwitch5statsEED0Ev@Base 1.9.15
  (optional=templinst)_ZN7ucommon12mapped_arrayIN8sipwitch5statsEED1Ev@Base 1.9.15
@@ -284,6 +284,6 @@
  (c++)"virtual thunk to sipwitch::modules::sipwitch::~sipwitch()@Base" 1.9.15
  (c++)"virtual thunk to sipwitch::service::callback::~callback()@Base" 1.9.15
  (c++)"virtual thunk to sipwitch::service::~service()@Base" 1.9.15
- (c++|arch=!amd64 !arm64 !kfreebsd-amd64 !ppc64el !s390x !sparc64)"virtual thunk to ucommon::stringbuf<1024u>::~stringbuf()@Base" 1.9.15
- (c++|arch=amd64 arm64 kfreebsd-amd64 ppc64el s390x sparc64)"virtual thunk to ucommon::stringbuf<1024ul>::~stringbuf()@Base" 1.9.15
+ (c++|arch=!amd64 !arm64 !kfreebsd-amd64 !ppc64el !s390x !sparc64 !mips64el)"virtual thunk to ucommon::stringbuf<1024u>::~stringbuf()@Base" 1.9.15
+ (c++|arch=amd64 arm64 kfreebsd-amd64 ppc64el s390x sparc64 mips64el)"virtual thunk to ucommon::stringbuf<1024ul>::~stringbuf()@Base" 1.9.15
  (c++)"virtual thunk to ucommon::treemap::~treemap()@Base" 1.9.15


Bug#754755: [rt.cpan.org #98683] libinline-java-perl: FTBFS on mips: test suite issues

2016-08-02 Thread Daniel Knezevic
Hi,

Tests are still failing in version 0.58 during build.

I have found out that the tests are failing when Inline::Java uses JNI 
extensions
(PERL_INLINE_JAVA_JNI is set to 1), but the tests pass when Inline::Java run 
JVM in
the default client/server mode (PERL_INLINE_JAVA_JNI is unset).

--- debian/rules_orig   2016-08-02 12:16:34.206089692 +
+++ debian/rules2016-08-02 12:16:46.476196564 +
@@ -49,9 +49,6 @@

 export JAVA_HOME=/usr/lib/jvm/default-java

-# Have testsuite use JNI
-export PERL_INLINE_JAVA_JNI=1
-
 # Put aside upstream cruft during build
 DEB_UPSTREAM_CRUFT_MOVE = t/t13.txt

It may be some mips/mipsel specific issue, because the build succeeds on 
mips64el.
We are still investigating, any tip will be useful.

Can we use Inline::Java without JNI extension for mips/mipsel?

Regards,
Daniel


Bug#833900: libneo4j-client FTBFS on multiple architectures

2016-08-10 Thread Daniel Knezevic
Package: libneo4j-client
Version: 1.1.0-1
Severity: important
Tags: sid + patch
Justification: FTBFS
User: debian-m...@lists.debian.org
Usertags: mips-patch

Hi,

Package libneo4j-client FTBFS on multiple architectures (armel, armhf, hppa,
mips, mipsel and powerpcspe) with following error:
result_stream.c: In function 'run_result_field':
result_stream.c:583:37: error: cast increases required alignment of target type 
[-Werror=cast-align]
 const result_record_t *record = (const result_record_t *)self;
 ^

build logs:
https://buildd.debian.org/status/fetch.php?pkg=libneo4j-client=armel=1.1.0-1=1469106786
https://buildd.debian.org/status/fetch.php?pkg=libneo4j-client=armhf=1.1.0-1=1469106957
https://buildd.debian.org/status/fetch.php?pkg=libneo4j-client=hppa=1.1.0-1=1469109462
https://buildd.debian.org/status/fetch.php?pkg=libneo4j-client=mips=1.1.0-1=1469107053
https://buildd.debian.org/status/fetch.php?pkg=libneo4j-client=mipsel=1.1.0-1=1469106870
https://buildd.debian.org/status/fetch.php?pkg=libneo4j-client=powerpcspe=1.1.0-1=1469569233

The attached patch fixes the alignment issue by replacing type casting with
container_of() macro.

With this patch I was able to build opensips successfully for mips and mipsel.
It may fix the build for other architectures too.

Regards,
Daniel
--- libneo4j-client-1.1.0.orig/src/lib/result_stream.c
+++ libneo4j-client-1.1.0/src/lib/result_stream.c
@@ -580,7 +580,8 @@ int run_rs_close(neo4j_result_stream_t *
 neo4j_value_t run_result_field(const neo4j_result_t *self,
 unsigned int index)
 {
-const result_record_t *record = (const result_record_t *)self;
+const result_record_t *record = container_of(self,
+result_record_t, _result);
 REQUIRE(record != NULL, neo4j_null);
 return neo4j_list_get(record->list, index);
 }


Bug#828853: libexplain: FTBFS on mips and mipsel - 'FS_ECOMPR_FL' undeclared

2016-06-28 Thread Daniel Knezevic
Package: libexplain
Version: 1.4.D001-2+b1
Severity: serious
Tags: sid + patch
Justification: FTBFS
User: debian-m...@lists.debian.org
Usertags: mips-patch

Hi,

Package libexplain FTBFS on mips and mipsel with following error:
libexplain/buffer/file_inode_flags.c:47:27: error: 'FS_ECOMPR_FL' undeclared 
(first use in this function)
 { "FS_ECOMPR_FL", FS_ECOMPR_FL },
   ^
libexplain/buffer/file_inode_flags.c:47:27: note: each undeclared identifier is 
reported only once for each function it appears in
libexplain/buffer/file_inode_flags.c:47:9: warning: missing initializer for 
field 'value' of 'explain_parse_bits_table_t {aka const struct 
explain_parse_bits_table_t}' [-Wmissing-field-initializers]
 { "FS_ECOMPR_FL", FS_ECOMPR_FL },
 ^
In file included from libexplain/buffer/file_inode_flags.c:25:0:
./libexplain/parse_bits.h:31:21: note: 'value' declared here
 int value;
 ^
libexplain/buffer/file_inode_flags.c:56:29: error: 'FS_DIRECTIO_FL' undeclared 
(first use in this function)
 { "FS_DIRECTIO_FL", FS_DIRECTIO_FL },
 ^
libexplain/buffer/file_inode_flags.c:56:9: warning: missing initializer for 
field 'value' of 'explain_parse_bits_table_t {aka const struct 
explain_parse_bits_table_t}' [-Wmissing-field-initializers]
 { "FS_DIRECTIO_FL", FS_DIRECTIO_FL },
 ^
In file included from libexplain/buffer/file_inode_flags.c:25:0:
./libexplain/parse_bits.h:31:21: note: 'value' declared here
 int value;
 ^
Makefile:10623: recipe for target 'libexplain/buffer/file_inode_flags.lo' failed
make[1]: *** [libexplain/buffer/file_inode_flags.lo] Error 1

build logs:
https://buildd.debian.org/status/fetch.php?pkg=libexplain=mips=1.4.D001-2%2Bb1=1465482111
https://buildd.debian.org/status/fetch.php?pkg=libexplain=mipsel=1.4.D001-2%2Bb1=1465051476

The code as it is doesn't compile against latest linux headers because 
FS_ECOMPR_FL and FS_DIRECTIO_FL defines are removed:
https://github.com/torvalds/linux/commit/68ce7bfcd995a8a393b1b14fa67dbc16fa3dc784

On openSUSE this issue is resolved by defining the missing defines in 
libexplain package:
https://build.opensuse.org/package/view_file/openSUSE:Factory/libexplain/libexplain-1.4-missing-defines.patch?expand=1

With attached patch I was able to build libexplain successfully for mips, 
mipsel, i386 and amd64.

Regards,
Daniel
--- libexplain-1.4.D001.orig/libexplain/buffer/file_inode_flags.c
+++ libexplain-1.4.D001/libexplain/buffer/file_inode_flags.c
@@ -28,6 +28,14 @@

 #if defined(FS_IOC_GETFLAGS) || defined(FS_IOC32_GETFLAGS)

+#ifndef FS_ECOMPR_FL
+#define FS_ECOMPR_FL0x0800 /* Compression error */
+#endif
+
+#ifndef FS_DIRECTIO_FL
+#define FS_DIRECTIO_FL  0x0010 /* Use direct i/o */
+#endif
+
 void
 explain_buffer_file_inode_flags(explain_string_buffer_t *sb, int value)
 {



Bug#828848: dietlibc doesn't provide send() and recv() functions

2016-06-28 Thread Daniel Knezevic
Package: dielibc
Version: 0.34~cvs20160606
Severity: important
Tags: sid + patch
Justification:
User: debian-m...@lists.debian.org
Usertags: mips-patch

Hi,

Package tiny-initramfs FTBFS on mips64el with following error:
tiny_initramfs-nfs.o: In function `nfs4_ping':
/«PKGBUILDDIR»/build.standard/../nfs.c:398: undefined reference to `send'
/«PKGBUILDDIR»/build.standard/../nfs.c:401: undefined reference to `send'
/«PKGBUILDDIR»/build.standard/../nfs.c:421: undefined reference to `recv'
/«PKGBUILDDIR»/build.standard/../nfs.c:421: undefined reference to `recv'

build log:
https://buildd.debian.org/status/fetch.php?pkg=tiny-initramfs=mips64el=0.1-2=1465191375

It seems dietlibc doesn't provide send() and recv() functions for mips64el.
There are no syscalls or implementations for send() and recv() functions for 
mips64el.

I found out that for x86_64 there are no syscalls for send() and recv() 
functions, but
they are implemented as a wrapper around sendto() and recvfrom() funtions.
I did the same thing for mips64el, patch that contains needed changes is 
attached.

Using dietlibc built with mentioned patch I was able to build tiny-initramfs 
successfully for mips64el.
Could you please consider including this patch?

Regards,
Daniel
--- /dev/null
+++ dietlibc-0.34~cvs20160606/mips64/recv.c
@@ -0,0 +1,13 @@
+#include 
+#include 
+#include 
+
+int __libc_recv(int fd, void * buf, size_t n, int flags);
+  /* shut up gcc warning about missing prototype */
+
+int __libc_recv(int fd, void * buf, size_t n, int flags) {
+  return recvfrom(fd, buf, n, flags, 0, 0);
+}
+
+int recv(int a, void * b, size_t c, int flags)
+  __attribute__ ((weak, alias("__libc_recv")));
--- /dev/null
+++ dietlibc-0.34~cvs20160606/mips64/send.c
@@ -0,0 +1,13 @@
+#include 
+#include 
+#include 
+
+int __libc_send(int fd, const void * buf, size_t n, int flags);
+  /* shut up gcc warning about missing prototype */
+
+int __libc_send(int fd, const void * buf, size_t n, int flags) {
+  return sendto(fd, buf, n, flags, NULL, 0);
+}
+
+int send(int a, const void * b, size_t c, int flags)
+  __attribute__ ((weak, alias("__libc_send")));


Bug#828953: mxt-app FTBFS on 32bit architectures (i386, mips) on testing

2016-06-29 Thread Daniel Knezevic
Package: mxt-app
Version: 1.27-1
Severity: serious
Tags: sid + patch
Justification: FTBFS
User: debian-m...@lists.debian.org
Usertags: mips-patch

Hi,

Package mxt-app FTBFS on 32bit architectures with following error:
make --no-print-directory check-TESTS
FAIL: run-unit-tests

   mxt-app 1.27: ./test-suite.log


# TOTAL: 1
# PASS:  0
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: run-unit-tests


[==] Running 1 test(s).
[ RUN  ] mxt_convert_hex_test
0x1a != 0
src/test/test_utilfuncs.c:65: error: Failure!

[  FAILED  ] mxt_convert_hex_test
[==] 1 test(s) run.
[  PASSED  ] 0 test(s).
[  FAILED  ] 1 test(s), listed below:
[  FAILED  ] mxt_convert_hex_test

 1 FAILED TEST(S)
FAIL run-unit-tests (exit status: 1)

build logs:
https://buildd.debian.org/status/fetch.php?pkg=mxt-app=mips=1.27-1=1465527085
https://buildd.debian.org/status/fetch.php?pkg=mxt-app=mipsel=1.27-1=1465521348
https://buildd.debian.org/status/fetch.php?pkg=mxt-app=i386=1.27-1=1464327106

The test is failing because of the undefined behaviour of strcpy() when dest 
buffer is smaller than src buffer.
Bug is in mxt_convert_hex_test function in /src/test/test_utilfuncs.c file.
Destination buffer (hex) is 4 bytes, and on strcpy(hex, "0FAB"); there is no 
space left to copy the null terminator.

The attached patch resolves buffer owerflow.
Patch is tested on i386, amd64, mips, mipsel, mips64el.

Earlier version was successfully built on 32bit architectures because there 
were no tests.

Thank you!

Regards,
Daniel
--- mxt-app-1.27.orig/src/test/test_utilfuncs.c
+++ mxt-app-1.27/src/test/test_utilfuncs.c
@@ -43,7 +43,7 @@ void mxt_convert_hex_test(void **state)
 {
   /* test setup */
   uint8_t databuf[5] = {0};
-  char hex[4];
+  char hex[5];
   uint16_t count;
   int ret;




Bug#810030: disque: FTBFS on big-endian systems

2016-07-07 Thread Daniel Knezevic
Hi,

The attached patch fixes the big-endian build.
The fix is reported upsream, but there is no reaction.
Should we wait for some reaction upstream
or is it possible to apply the patch for debian?

Regards,
Daniel
-- disque-1.0~rc1.orig/src/job.c
+++ disque-1.0~rc1/src/job.c
@@ -779,17 +779,17 @@ job *deserializeJob(unsigned char *p, si

 /* Deserialize the static part just copying and fixing endianess. */
 memcpy(j,p,JOB_STRUCT_SER_LEN);
-memrev16ifbe(j->repl);
-memrev64ifbe(j->ctime);
-memrev32ifbe(j->etime);
+memrev16ifbe(>repl);
+memrev64ifbe(>ctime);
+memrev32ifbe(>etime);
 if (sertype == SER_MESSAGE) {
 /* Convert back to absolute time if needed. */
 j->etime = server.unixtime + j->etime;
 }
-memrev32ifbe(j->delay);
-memrev32ifbe(j->retry);
-memrev16ifbe(>num_nacks);
-memrev16ifbe(>num_deliv);
+memrev32ifbe(>delay);
+memrev32ifbe(>retry);
+memrev16ifbe(>num_nacks);
+memrev16ifbe(>num_deliv);
 p += JOB_STRUCT_SER_LEN;
 len -= JOB_STRUCT_SER_LEN;





Bug#833830: adding support to fast_lock for mips and mips64el

2016-08-09 Thread Daniel Knezevic
Package: opensips
Version: 2.1.2-2
Severity: wishlist
Tags: sid + patch
User: debian-m...@lists.debian.org
Usertags: mips-patch

Hi,

During the investigation of the build failure (https://bugs.debian.org/833749)
we have found that the package does not support fast_lock for mips64el and mips.
The proposed solution fixes the build issues, but it uses posix semaphores.
Since mipsel (mips2) has fast_lock support we think it will be useful to 
support/enable
fast_lock for mips (mips32) and mip64el.

The attached patch adds support to detect mips32 architecture (as mips BE had
been migrated to MIP32R2 ISA) in Makefile.defs and enables fast_lock (hardware
locking support) for mips32 and mips64el.
The detection is achieved by adding a check for predefined compiler macros for
mips32 architecture (_MIPS_ISA_MIPS32, _MIPS_ARCH_MIPS32R2, _MIPS_ARCH_MIPS32).
For mips and mips64el arch specific definitions are added to enable fast_lock.

Mips and mips64el use the same assembler routines for the fast architecture
dependant locking primitives as mips2 implementation.
Could you please include this patch?

Regards,
Daniel
--- opensips-2.1.2.orig/Makefile.defs
+++ opensips-2.1.2/Makefile.defs
@@ -210,6 +210,7 @@ ppc64_macros= __ppc64__ _ARCH_PPC64
 mips_macros= __mips__ __mips _MIPS_ARCH_MIPS1
 mips2_macros= _MIPS_ISA_MIPS2 _MIPS_ISA_MIPS3 _MIPS_ISA_MIPS4 \
 			_MIPS_ARCH_MIPS2 _MIPS_ARCH_MIPS3 _MIPS_ARCH_MIPS4
+mips32_macros= _MIPS_ISA_MIPS32 _MIPS_ARCH_MIPS32R2 _MIPS_ARCH_MIPS32
 mips64_macros= _MIPS_ISA_MIPS64 _MIPS_ARCH_MIPS64
 
 alpha_macros= __alpha__ __alpha _M_ALPHA_
@@ -247,6 +248,8 @@ else ifneq ($(strip $(filter $(mips_macr
 
 ifneq ($(strip $(filter $(mips64_macros), $(predef_macros))),)
 CC_ARCH=mips64
+else ifneq ($(strip $(filter $(mips32_macros), $(predef_macros))),)
+CC_ARCH=mips32
 else ifneq ($(strip $(filter $(mips2_macros), $(predef_macros))),)
 CC_ARCH=mips2
 else # mips2_macros
@@ -694,6 +697,14 @@ ifeq ($(ARCH), mips2)
 	use_fast_lock=yes
 endif
 
+ifeq ($(ARCH), mips32)
+use_fast_lock=yes
+endif
+
+ifeq ($(ARCH), mips64)
+use_fast_lock=yes
+endif
+
 ifeq ($(ARCH), alpha)
 	use_fast_lock=yes
 endif
--- opensips-2.1.2.orig/fastlock.h
+++ opensips-2.1.2/fastlock.h
@@ -120,7 +120,7 @@ inline static int tsl(fl_lock_t* lock)
 			: "r"(1), "b" (lock) :
 			"memory", "cc"
 );
-#elif defined __CPU_mips2
+#elif defined(__CPU_mips2) || defined(__CPU_mips32) || defined(__CPU_mips64)
 	long tmp;
 	tmp=1; /* just to kill a gcc 2.95 warning */
 
@@ -228,7 +228,7 @@ inline static void release_lock(fl_lock_
 			: "memory"
 );
 	*lock = 0;
-#elif defined __CPU_mips2
+#elif defined(__CPU_mips2) || defined(__CPU_mips32) || defined(__CPU_mips64)
 	asm volatile(
 		".set noreorder \n\t"
 		"sync \n\t"
--- opensips-2.1.2.orig/futex_lock.h
+++ opensips-2.1.2/futex_lock.h
@@ -138,7 +138,7 @@ inline static int _atomic_xchg(fx_lock_t
 			: "r"(1), "b" (lock) :
 			"memory", "cc"
 );
-#elif defined __CPU_mips2
+#elif defined(__CPU_mips2) || defined(__CPU_mips32) || defined(__CPU_mips64)
 	long tmp;
 	tmp=1; /* just to kill a gcc 2.95 warning */
 


Bug#833749: opensips FTBFS on mips, mips64el and other architectures

2016-08-08 Thread Daniel Knezevic
Package: opensips
Version: 2.1.2-2
Severity: important
Tags: sid + patch
Justification: FTBFS
User: debian-m...@lists.debian.org
Usertags: mips-patch

Hi,

Package opensips FTBFS on mips, mips64el and other architectures with following 
error:
In file included from ../../pt.h:70:0,
 from ../../dprint.h:402,
 from ../../lock_ops.h:135,
 from ../../locking.h:65,
 from hslot.h:33,
 from urecord.h:38,
 from urecord.c:35:
../../statistics.h:144:8: error: unknown type name 'gen_lock_t'
 extern gen_lock_t *stat_lock;
^

build logs:
https://buildd.debian.org/status/fetch.php?pkg=opensips=mips=2.1.2-2=1461374393
https://buildd.debian.org/status/fetch.php?pkg=opensips=mips64el=2.1.2-2=1466980139
https://buildd.debian.org/status/fetch.php?pkg=opensips=arm64=2.1.2-2=1461066695
https://buildd.debian.org/status/fetch.php?pkg=opensips=hppa=2.1.2-2=1466630442
https://buildd.debian.org/status/fetch.php?pkg=opensips=m68k=2.1.2-2=1469744676
https://buildd.debian.org/status/fetch.php?pkg=opensips=s390x=2.1.2-2=1461066886
https://buildd.debian.org/status/fetch.php?pkg=opensips=sh4=2.1.2-2=1469693984

The build fails when USE_SYSV_SEM and NO_ATOMIC_OPS flags are defined.
USE_SYSV_SEM is defined when the archiecture is not recognized by Makefile.defs
or hardware locking (FAST_LOCK) is not supported for target architecture.

The detection of mips (mips32) architecture is missing from Makefile.defs, there
is no check for _MIPS_ISA_MIPS32 or _MIPS_ARCH_MIPS32R2 compiler macros.
Mips64el can be recognized by Makefile but arch specific definitions are 
missing for
this architecture.
For both, mips and mips64el, fast_lock is not used. USE_SYSV_SEM and 
NO_ATOMIC_OPS
flags are defined.
The build fails because of the code uder USE_SYSV_SEM flag in lock_ops.h file.

Mipsel build passes because it is recognized as mips2 and fast_lock is enabled 
for
that architecture.

For Linux, SYSV locking support is replaced with POSIX upstream.
The attached patch fixes the build by using posix locking support.

With this patch I was able to build opensips successfully for mips and mips64el.
It may fix the build for other architectures too.

Regards,
Daniel
--- opensips-2.1.2.orig/Makefile.defs
+++ opensips-2.1.2/Makefile.defs
@@ -1283,7 +1283,7 @@ ifeq ($(OS), linux)
 			-DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H \
 			-DHAVE_TIMEGM
 	ifneq ($(found_lock_method), yes)
-		DEFS+= -DUSE_SYSV_SEM  # try posix sems
+		DEFS+= -DUSE_POSIX_SEM  # try posix sems
 		found_lock_method=yes
 	endif
 	# check for >= 2.5.44
@@ -1499,6 +1499,13 @@ ifneq (,$(findstring CYGWIN, $(OS)))
 	endif
 endif
 
+#if POSIX sems are to be used, be sure to link with ptread
+ifneq (,$(findstring USE_POSIX_SEM, $(DEFS)))
+ifeq (,$(findstring pthread, $(LIBS)))
+LIBS+= -pthread
+endif
+endif
+
 #add libsctp if needed
 ifneq ($(SCTP),)
 LIBS+= -lsctp
--- opensips-2.1.2.orig/net/net_tcp.c
+++ opensips-2.1.2/net/net_tcp.c
@@ -838,7 +838,7 @@ static struct tcp_connection* tcpconn_ne
 
 error:
 	if (c) {
-		if (c->write_lock) lock_destroy(>write_lock);
+		lock_destroy(>write_lock);
 		shm_free(c);
 	}
 	return 0;


Bug#811306: FTBFS: mmpong-gl-data missing files: usr/share/games/mmpong-gl

2016-08-25 Thread Daniel Knezevic
Hi,

Package FTBFS on installation because of missing mmpong-gl exe.
mmpong-gl is not building because cmake configuration cannot find CEGUI-OPENGL.
Cmake configuration checks for CEGUI-OPENGL module by searching CEGUI-OPENGL.pc 
file.

Log:
-- Checking for one of the modules 'CEGUI-OPENGL'
-- disabling mmpong-gl because of missing dependencies.

In Debian stretch there is a new version of cegui-mk2 package available 
(0.8.7-1.2),
this version has CEGUI-0-OPENGL.pc instead of CEGUI-OPENGL.pc.
By changing the client_gl/CMakeLists.txt file to check for CEGUI-0-OPENGL the 
configuration
activates the build of mmpong-gl, but build of mmpong-gl fails because it uses 
an outdated api of CEGUI.
Mmpong was built successfully with cegui-mk2 0.7.6 three years ago.

I think there are two possible solutions to fix the package:
- disable installation of mmpong-gl (do not create mmpong-gl package)
- update mmpong to use the new api of cegui (not trivial solution)

Regards,
Daniel


Bug#836733: pyresample FTBFS on mips*: test suite issues

2016-09-05 Thread Daniel Knezevic
Package: pyresample
Version: 1.2.5-1
Severity: important
Tags: sid + patch
Justification: FTBFS
User: debian-m...@lists.debian.org
Usertags: mips-patch
Forwarded: https://github.com/pytroll/pyresample/issues/43

Hi,

Package pyresample FTBFS on mips* with following error:
> ==
> FAIL: test_custom_uncert (pyresample.test.test_kd_tree.Test)
> --
> Traceback (most recent call last):
>   File "/«PKGBUILDDIR»/pyresample/test/test_kd_tree.py", line 102, in 
> test_custom_uncert
> len(w) != 1, 'Failed to create neighbour warning')
> AssertionError: Failed to create neighbour warning
>
> ==
> FAIL: test_gauss_uncert (pyresample.test.test_kd_tree.Test)
> --
> Traceback (most recent call last):
>   File "/«PKGBUILDDIR»/pyresample/test/test_kd_tree.py", line 79, in 
> test_gauss_uncert
> len(w) != 1, 'Failed to create neighbour warning')
> AssertionError: Failed to create neighbour warning
>
> --
> Ran 115 tests in 582.910s
>
> FAILED (failures=2)

build logs:
https://buildd.debian.org/status/fetch.php?pkg=pyresample=mipsel=1.2.5-1=1470596543

Tests are failing because there are more warnings than expected on mips*.
With added debug prints the following warnings are raised:
> DBG: test_custom_uncert w[0] = {message : UserWarning('Searching for 8 
> neighbours in 3 data points',), category : 'UserWarning', filename : 
> '/build/pyresample-X1AqqR/pyresample-1.2.5/pyresample/kd_tree.py', lineno : 
> 314, line : None}
> DBG: test_custom_uncert w[1] = {message : RuntimeWarning('invalid value 
> encountered in multiply',), category : 'RuntimeWarning', filename : 
> '/build/pyresample-X1AqqR/pyresample-1.2.5/pyresample/kd_tree.py', lineno : 
> 834, line : None}
>
> DBG: test_gauss_uncert w[0] = {message : UserWarning('Searching for 8 
> neighbours in 3 data points',), category : 'UserWarn>ing', filename : 
> '/build/pyresample-X1AqqR/pyresample-1.2.5/pyresample/kd_tree.py', lineno : 
> 314, line : None}
> DBG: test_gauss_uncert w[1] = {message : RuntimeWarning('invalid value 
> encountered in multiply',), category : 'RuntimeWarning', filename : 
> '/build/pyresample-X1AqqR/pyresample-1.2.5/pyresample/kd_tree.py', lineno : 
> 834, line : None}

Tests are fixed by changing the asserts to handle more warnings than expected.
This solution was proposed upstream.

With attached patch I was able to build pyresample successfully for mips*.

Thanks,
Daniel




--- pyresample-1.2.5.orig/pyresample/test/test_kd_tree.py
+++ pyresample-1.2.5/pyresample/test/test_kd_tree.py
@@ -75,13 +75,13 @@ class Test(unittest.TestCase):
 res, stddev, count = kd_tree.resample_gauss(self.tswath, self.tdata,
 self.tgrid, 10, sigma,
 with_uncert=True)
-self.assertFalse(
-len(w) != 1, 'Failed to create neighbour warning')
-self.assertFalse(('Searching' not in str(
-w[0].message)), 'Failed to create correct neighbour warning')
+self.assertTrue(
+len(w) > 0, 'Failed to create neighbour warning')
+self.assertTrue((any('Searching' in str(_w.message) for _w in w)),
+'Failed to create correct neighbour warning')

 expected_res = 2.20206560694
-expected_stddev = 0.707115076173
+exprcted_stddev = 0.707115076173
 expected_count = 3
 self.assertAlmostEqual(res[0], expected_res, 5,
'Failed to calculate gaussian weighting with uncertainty')
@@ -98,10 +98,10 @@ class Test(unittest.TestCase):
 res, stddev, counts = kd_tree.resample_custom(self.tswath,
   self.tdata, self.tgrid,
   10, wf, with_uncert=True)
-self.assertFalse(
-len(w) != 1, 'Failed to create neighbour warning')
-self.assertFalse(('Searching' not in str(
-w[0].message)), 'Failed to create correct neighbour warning')
+self.assertTrue(
+len(w) > 0, 'Failed to create neighbour warning')
+self.assertTrue((any('Searching' in str(_w.message) for _w in w)),
+'Failed to create correct neighbour warning')

 self.assertAlmostEqual(res[0], 2.32193149, 5,
'Failed to calculate custom weighting with uncertainty')


Bug#775435: iwyu: FTBFS on mips64el

2016-10-06 Thread Daniel Knezevic
Tags: patch

Hi,

As James proposed I added -mxgot to the cxx flags for mips64el.

With attached patch I was able to build iwyu successfully for mips64el.

Thanks,
Daniel
--- debian/rules	2016-10-06 06:06:05.0 +
+++ debian/rules	2016-10-06 05:33:16.0 +
@@ -6,12 +6,18 @@
 
 TARGET_BUILD=iwyu-build
 VERSION=$(shell dpkg-parsechangelog |grep "^Version:"|sed -e "s|Version: \(.*\)|\1|")
+DEB_BUILD_ARCH?=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
+ADDITIONAL_CXX_FLAGS=""
+
+ifneq (,$(filter $(DEB_BUILD_ARCH),mips64el))
+	ADDITIONAL_CXX_FLAGS += -mxgot
+endif
 
 %:
 	dh $@ --buildsystem=cmake --builddirectory=$(TARGET_BUILD)
 
 override_dh_auto_configure:
-	dh_auto_configure -- -DLLVM_PATH=/usr/lib/llvm-3.8/
+	dh_auto_configure -- -DLLVM_PATH=/usr/lib/llvm-3.8/ -DCMAKE_CXX_FLAGS="$(ADDITIONAL_CXX_FLAGS)"
 
 override_dh_auto_build:
 	dh_auto_build



Bug#838295: openni-sensor-primesense: FTBFS: Unknown machine type: mips

2016-09-19 Thread Daniel Knezevic
Package: openni-sensor-primesense
Version: 5.1.0.41-3
Severity: important
Tags: sid + patch
Justification: FTBFS
User: debian-m...@lists.debian.org
Usertags: mips-patch

Hi,

Package openni-sensor-primesense FTBFS on mips* with following error:
> make[1]: Leaving directory '/«PKGBUILDDIR»'
>  debian/rules build-arch
> dh build-arch --buildsystem=makefile
>dh_testdir -a -O--buildsystem=makefile
>dh_update_autotools_config -a -O--buildsystem=makefile
>dh_auto_configure -a -O--buildsystem=makefile
>debian/rules override_dh_auto_build
> make[1]: Entering directory '/«PKGBUILDDIR»'
> cd Platform/Linux/CreateRedist && bash RedistMaker
> Unknown machine type: mips
> debian/rules:8: recipe for target 'override_dh_auto_build' failed
> make[1]: *** [override_dh_auto_build] Error 1
> make[1]: Leaving directory '/«PKGBUILDDIR»'
> debian/rules:5: recipe for target 'build-arch' failed
> make: *** [build-arch] Error 2

build log:
https://buildd.debian.org/status/fetch.php?pkg=openni-sensor-primesense=mips=5.1.0.41-5=1461373695

The attached patch adds support for mips*.
With this patch I was able to build openni-sensor-primesense successfully for 
mips, mipsel and mips64el.
Could you please include this patch?

Thanks,
Daniel

--- openni-sensor-primesense-5.1.0.41.orig/Platform/Linux/Build/Common/CommonDefs.mak
+++ openni-sensor-primesense-5.1.0.41/Platform/Linux/Build/Common/CommonDefs.mak
@@ -19,6 +19,8 @@ else ifneq (,$(findstring aarch64,$(MACH
 	HOST_PLATFORM = AArch64
 else ifneq (,$(findstring ppc,$(MACHINE)))
 	HOST_PLATFORM = Powerpc
+else ifneq (,$(findstring mips,$(MACHINE)))
+HOST_PLATFORM = Mips
 else
 	DUMMY:=$(error Can't determine host platform)
 endif
--- /dev/null
+++ openni-sensor-primesense-5.1.0.41/Platform/Linux/Build/Common/Platform.Mips
@@ -0,0 +1,9 @@
+ifeq "$(CFG)" "Release"
+
+# Optimization level, minus currently buggy optimizing methods (which break bit-exact)
+CFLAGS += -O3 -fno-tree-pre -fno-strict-aliasing
+
+# More optimization flags
+CFLAGS += -ftree-vectorize -ffast-math -funsafe-math-optimizations -fsingle-precision-constant
+
+endif
--- openni-sensor-primesense-5.1.0.41.orig/Platform/Linux/CreateRedist/RedistMaker
+++ openni-sensor-primesense-5.1.0.41/Platform/Linux/CreateRedist/RedistMaker
@@ -35,6 +35,8 @@ else
 		PLATFORM="Powerpc" ;;
 	arm*)
 		PLATFORM="Arm" ;;
+	mips*)
+		PLATFORM="Mips" ;;
 	*)
 		echo "Unknown machine type: $MACHINE_TYPE"
 		exit 1
--- openni-sensor-primesense-5.1.0.41.orig/Source/Utils/XnSensorServer/SensorServer.cpp
+++ openni-sensor-primesense-5.1.0.41/Source/Utils/XnSensorServer/SensorServer.cpp
@@ -56,7 +56,7 @@ int main(int argc, char* argv[])
 	nRetVal = XnSensorServerGetGlobalConfigFile(strConfigDir, strConfigFile, XN_FILE_MAX_PATH);
 	XN_CHECK_RC(nRetVal, "Resolving global config file");
 
-#if (XN_PLATFORM == XN_PLATFORM_LINUX_X86 || XN_PLATFORM == XN_PLATFORM_LINUX_ARM || XN_PLATFORM == XN_PLATFORM_LINUX_AARCH64 || XN_PLATFORM == XN_PLATFORM_LINUX_POWERPC || XN_PLATFORM == XN_PLATFORM_MACOSX)
+#if (XN_PLATFORM == XN_PLATFORM_LINUX_X86 || XN_PLATFORM == XN_PLATFORM_LINUX_ARM || XN_PLATFORM == XN_PLATFORM_LINUX_AARCH64 || XN_PLATFORM == XN_PLATFORM_LINUX_POWERPC || XN_PLATFORM == XN_PLATFORM_MACOSX || XN_PLATFORM == XN_PLATFORM_LINUX_MIPS)
 	xnLogSetOutputFolder("/var/log/primesense/XnSensorServer/");
 #endif
 
--- openni-sensor-primesense-5.1.0.41.orig/Source/XnDeviceSensorV2/XnDeviceSensorInit.h
+++ openni-sensor-primesense-5.1.0.41/Source/XnDeviceSensorV2/XnDeviceSensorInit.h
@@ -57,7 +57,7 @@
 
 	#define XN_SENSOR_USB_MISC_BUFFER_SIZE	0x1000
 	#define XN_SENSOR_USB_MISC_BUFFERS		1
-#elif (XN_PLATFORM == XN_PLATFORM_LINUX_X86 || XN_PLATFORM == XN_PLATFORM_LINUX_ARM || XN_PLATFORM == XN_PLATFORM_LINUX_AARCH64 || XN_PLATFORM == XN_PLATFORM_LINUX_POWERPC || XN_PLATFORM == XN_PLATFORM_MACOSX || XN_PLATFORM == XN_PLATFORM_ANDROID_ARM)
+#elif (XN_PLATFORM == XN_PLATFORM_LINUX_X86 || XN_PLATFORM == XN_PLATFORM_LINUX_ARM || XN_PLATFORM == XN_PLATFORM_LINUX_AARCH64 || XN_PLATFORM == XN_PLATFORM_LINUX_POWERPC || XN_PLATFORM == XN_PLATFORM_MACOSX || XN_PLATFORM == XN_PLATFORM_ANDROID_ARM || XN_PLATFORM == XN_PLATFORM_LINUX_MIPS)
 	#define XN_SENSOR_USB_IMAGE_BUFFER_SIZE_MULTIPLIER_ISO32
 	#define XN_SENSOR_USB_IMAGE_BUFFER_SIZE_MULTIPLIER_BULK40
 	#define XN_SENSOR_USB_IMAGE_BUFFER_SIZE_MULTIPLIER_LOWBAND_ISO		16
--- openni-sensor-primesense-5.1.0.41.orig/Source/XnDeviceSensorV2/XnSensorClient.cpp
+++ openni-sensor-primesense-5.1.0.41/Source/XnDeviceSensorV2/XnSensorClient.cpp
@@ -882,7 +882,7 @@ XnStatus XnSensorClient::StartServerProc
 	
 #if (XN_PLATFORM == XN_PLATFORM_WIN32)
 	nRetVal = GetModuleDir(strServerDir);
-#elif (XN_PLATFORM == XN_PLATFORM_LINUX_X86 || XN_PLATFORM == XN_PLATFORM_LINUX_ARM || XN_PLATFORM == XN_PLATFORM_LINUX_AARCH64 || XN_PLATFORM == XN_PLATFORM_LINUX_POWERPC || XN_PLATFORM == XN_PLATFORM_MACOSX)
+#elif (XN_PLATFORM == XN_PLATFORM_LINUX_X86 || XN_PLATFORM == XN_PLATFORM_LINUX_ARM || 

Bug#838364: fdk-aac: FTBFS on mips64el (conftest.c:1:0: error: '-march=mips32r2' is not compatible with the selected ABI)

2016-09-20 Thread Daniel Knezevic
Package: fdk-aac
Version: 0.1.3+20140816-2
Severity: important
Tags: sid + patch
Justification: FTBFS
User: debian-m...@lists.debian.org
Usertags: mips-patch

Hi,

Package fdk-aac FTBFS for mips64el on configure with following error:
> configure:3401: checking whether the C compiler works
> configure:3423: gcc -g -O2 -fstack-protector-strong -Wformat 
> -Werror=format-security -mips32r2 -mips32r2 -Wl,-z,relro conftest.c  >&5
> conftest.c:1:0: error: '-march=mips32r2' is not compatible with the selected 
> ABI

The attached patch removes "mips32r2" flag from debian/rules because it is not 
supported
on mips64el.
For mips and mipsel "mips32r2" is included in default gcc flags.
So, there is no need for this flag in debian/rules for these architectures.

After removing the mips32r2 flag the package still FTBFS with:
> error: narrowing conversion of '3204251762u' from 'unsigned int' to 'LONG 
> {aka long int}' inside { } [-Wnarrowing]
This bug was already reported here: https://bugs.debian.org/836933

Thanks,
Daniel
--- fdk-aac-0.1.3+20140816.orig/debian/rules	2016-09-20 10:01:52.0 +
+++ fdk-aac-0.1.3+20140816/debian/rules	2016-09-20 10:02:08.0 +
@@ -1,10 +1,5 @@
 #!/usr/bin/make -f
 
-ifneq (,$(findstring mips,$(DEB_HOST_ARCH)))
-	CPPFLAGS+= -mips32r2
-	export CPPFLAGS
-endif
-
 %:
 	dh $@ --parallel --with autoreconf


Bug#836933: fdk-aac: FTBFS with GCC 6: error: narrowing conversion of '2975553344u' from 'unsigned int' to 'LONG {aka long int}' inside { }

2016-09-20 Thread Daniel Knezevic
Hi,

I had the same issue on mips* and this commit:
https://github.com/mstorsjo/fdk-aac/commit/15b128dd826ba86ee962d86b0b06966a25ed9158
was enough to fix the build.

Thanks,
Daniel


Bug#834717: assimp FTBFS on big-endian architectures ('ByteSwap' has not been declared)

2016-08-18 Thread Daniel Knezevic
Package: assimp
Version: 3.3.1~dfsg-1
Severity: important
Tags: sid + patch
Justification: FTBFS
User: debian-m...@lists.debian.org
Usertags: mips-patch

Hi,

Package assimp FTBFS on big-endian architectures with following error:
In file included from /«PKGBUILDDIR»/code/glTFAsset.h:65:0,
 from /«PKGBUILDDIR»/code/glTFImporter.cpp:55:
/«PKGBUILDDIR»/code/glTFAsset.inl: In member function 'void 
glTF::Asset::ReadBinaryHeader(Assimp::IOStream&)':
/«PKGBUILDDIR»/code/ByteSwapper.h:217:24: error: 'ByteSwap' has not been 
declared
 #   define AI_SWAP4(p) ByteSwap::Swap4(&(p))
^
/«PKGBUILDDIR»/code/glTFAsset.inl:906:5: note: in expansion of macro 'AI_SWAP4'
 AI_SWAP4(header.version);
 ^~~~
/«PKGBUILDDIR»/code/ByteSwapper.h:217:24: error: 'ByteSwap' has not been 
declared
 #   define AI_SWAP4(p) ByteSwap::Swap4(&(p))
^
/«PKGBUILDDIR»/code/glTFAsset.inl:912:5: note: in expansion of macro 'AI_SWAP4'
 AI_SWAP4(header.sceneFormat);
 ^~~~
/«PKGBUILDDIR»/code/ByteSwapper.h:217:24: error: 'ByteSwap' has not been 
declared
 #   define AI_SWAP4(p) ByteSwap::Swap4(&(p))
^
/«PKGBUILDDIR»/code/glTFAsset.inl:917:5: note: in expansion of macro 'AI_SWAP4'
 AI_SWAP4(header.length);
 ^~~~
/«PKGBUILDDIR»/code/ByteSwapper.h:217:24: error: 'ByteSwap' has not been 
declared
 #   define AI_SWAP4(p) ByteSwap::Swap4(&(p))
^
/«PKGBUILDDIR»/code/glTFAsset.inl:918:5: note: in expansion of macro 'AI_SWAP4'
 AI_SWAP4(header.sceneLength);
 ^~~~
/«PKGBUILDDIR»/code/glTFAssetWriter.inl: In member function 'void 
glTF::AssetWriter::WriteBinaryData(Assimp::IOStream*, size_t)':
/«PKGBUILDDIR»/code/ByteSwapper.h:217:24: error: 'ByteSwap' has not been 
declared
 #   define AI_SWAP4(p) ByteSwap::Swap4(&(p))
^
/«PKGBUILDDIR»/code/glTFAssetWriter.inl:397:9: note: in expansion of macro 
'AI_SWAP4'
 AI_SWAP4(header.version);
 ^~~~
/«PKGBUILDDIR»/code/ByteSwapper.h:217:24: error: 'ByteSwap' has not been 
declared
 #   define AI_SWAP4(p) ByteSwap::Swap4(&(p))
^
/«PKGBUILDDIR»/code/glTFAssetWriter.inl:400:9: note: in expansion of macro 
'AI_SWAP4'
 AI_SWAP4(header.length);
 ^~~~
/«PKGBUILDDIR»/code/ByteSwapper.h:217:24: error: 'ByteSwap' has not been 
declared
 #   define AI_SWAP4(p) ByteSwap::Swap4(&(p))
^
/«PKGBUILDDIR»/code/glTFAssetWriter.inl:403:9: note: in expansion of macro 
'AI_SWAP4'
 AI_SWAP4(header.sceneLength);
 ^~~~
/«PKGBUILDDIR»/code/ByteSwapper.h:217:24: error: 'ByteSwap' has not been 
declared
 #   define AI_SWAP4(p) ByteSwap::Swap4(&(p))
^
/«PKGBUILDDIR»/code/glTFAssetWriter.inl:406:9: note: in expansion of macro 
'AI_SWAP4'
 AI_SWAP4(header.sceneFormat);
 ^~~~

build logs:
https://buildd.debian.org/status/fetch.php?pkg=assimp=hppa=3.3.1%7Edfsg-1=1470683943
https://buildd.debian.org/status/fetch.php?pkg=assimp=m68k=3.3.1%7Edfsg-1=1470682578
https://buildd.debian.org/status/fetch.php?pkg=assimp=mips=3.3.1%7Edfsg-1=1470684366
https://buildd.debian.org/status/fetch.php?pkg=assimp=powerpc=3.3.1%7Edfsg-1=1470676134
https://buildd.debian.org/status/fetch.php?pkg=assimp=ppc64=3.3.1%7Edfsg-1=1470681578
https://buildd.debian.org/status/fetch.php?pkg=assimp=s390x=3.3.1%7Edfsg-1=1470677803
https://buildd.debian.org/status/fetch.php?pkg=assimp=sparc64=3.3.1%7Edfsg-1=1470842903

Macros aren't namespaced, pre-processor knows nothing about namespaces.
AI_SWAP4(p) is just replaced with ByteSwap::Swap4(&(p)) function call, because
of a missing namespace the compiler can't find the ByteSwap class.

The attached patch fixes the build errors for big-endian architectures by adding
the missing "using namespace Assimp" to glTFAsset.inl file.

With this patch I was able to build assimp successfully for mips.
It may fix the build for other architectures too.

Regards,
Daniel

--- assimp-3.3.1~dfsg.orig/code/glTFAsset.inl
+++ assimp-3.3.1~dfsg/code/glTFAsset.inl
@@ -40,6 +40,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 
 #include "StringUtils.h"
 
+using namespace Assimp;
+
 namespace glTF {
 
 namespace {


Bug#835500: quiterss: FTBFS on mips and arm with signal TERM after 150min of inactivity

2016-08-26 Thread Daniel Knezevic

Package: quiterss
Version: 0.18.4+dfsg-1
Severity: important
Tags: sid
Justification: FTBFS
User: debian-m...@lists.debian.org

Hi,

Package quiterss FTBFS on mips and arm with following message:
> Build killed with signal TERM after 150 minutes of inactivity

The build fails because the execution of lupdate command takes too long.

> lupdate -locations relative QuiteRSS.pro

I had tested this command on MIPS boards (Cavium, Loongson, Broadcom) and the
execution times was between 250 and 450 minutes.

By increasing the timeout for this package in sbuild.conf file I was able to
build it successfully for mips*.

> $individual_stalled_pkg_timeout = {quiterss => 500};

Is it possible to solve this issue by configuring sbuild and increasing timeout
for quiterss package?

Regards,
Daniel


Bug#843857: w1retap: FTBFS on mips and mipsel: braces around scalar initializer [-Werror]

2016-11-10 Thread Daniel Knezevic
Package: w1retap
Version: 1.4.4-1
Severity: important
Tags: sid + patch
Justification: FTBFS
User: debian-m...@lists.debian.org
Usertags: mips-patch

Hi,

Package w1retap FTBFS on mips and mipsel with following error:
> w1retap.c:417:12: error: braces around scalar initializer [-Werror]
>  struct sigaction act ={{0}};
> ^

build logs:
https://buildd.debian.org/status/fetch.php?pkg=w1retap=mips=1.4.4-1=1478712530
https://buildd.debian.org/status/fetch.php?pkg=w1retap=mipsel=1.4.4-1=1478755892

The attached patch removes the extra braces.
This patch is successfully tested on mips, mipsel and i386.

Thanks,
Daniel
--- w1retap-1.4.4.orig/src/w1retap.c
+++ w1retap-1.4.4/src/w1retap.c
@@ -414,7 +414,7 @@ static void w1_show(w1_devlist_t *w1, in
 int main(int argc, char **argv)
 {
 struct timeval now = {0};
-struct sigaction act ={{0}};
+struct sigaction act ={0};
 gboolean immed = 0;
 gboolean showvers=0;
 gboolean once=0;


Bug#841166: ocaml-ctypes: FTBFS on mips64el: tests are failing

2016-10-18 Thread Daniel Knezevic
Package: ocaml-ctypes
Version: 0.7.0-1
Severity: important
Tags: sid + patch + fixed-upstream
Justification: FTBFS
User: debian-m...@lists.debian.org
Usertags: mips-patch
Forwarded: 
https://github.com/ocamllabs/ocaml-ctypes/issues/441

Hi,

Package ocaml-ctypes FTBFS for mips64el on testing with following error:
> =
> Error: Higher-order tests:1:test_higher_order_basic (stubs).
>
> File "/«PKGBUILDDIR»/_build/oUnit-Higher-order tests-mipsel-sil-01#00.log", 
> line 26, characters 1-1:
> Error: Higher-order tests:1:test_higher_order_basic (stubs) (in the log).
>
> (Program not linked with -g, cannot print stack backtrace)
>
> not equal
> --
> ==
> Error: Higher-order tests:0:test_higher_order_basic (foreign).
>
> File "/«PKGBUILDDIR»/_build/oUnit-Higher-order tests-mipsel-sil-01#00.log", 
> line 20, characters 1-1:
> Error: Higher-order tests:0:test_higher_order_basic (foreign) (in the log).
>
> (Program not linked with -g, cannot print stack backtrace)
>
> not equal
> --

Full log: 
https://buildd.debian.org/status/fetch.php?pkg=ocaml-ctypes=mips64el=0.7.0-1=1470056946

This bug was reported and fixed upstream: 
https://github.com/ocamllabs/ocaml-ctypes/issues/441

The tests are failing because there is a problem with integers smaller than 
word-size. They was always zero-extended, never sign-extended.

The attached patch is a back-ported pull request 
(https://github.com/ocamllabs/ocaml-ctypes/pull/456) created by Andreas 
Hauptmann (fdopen) for this bug.
With this patch I was able to build ocaml-ctype successfully for mips64el.

Thanks,
Daniel
--- ocaml-ctypes-0.7.0.orig/src/ctypes-foreign-base/ffi_call_stubs.c
+++ ocaml-ctypes-0.7.0/src/ctypes-foreign-base/ffi_call_stubs.c
@@ -256,9 +256,11 @@ value ctypes_add_argument(value callspec
   CAMLreturn(Val_int(offset));
 }
 
-static int ffi_return_type_promotes(ffi_type *f)
+static int ffi_return_type_adjustment(ffi_type *f)
 {
-  /* libffi promotes integer return types that are smaller than a word */
+#ifdef ARCH_BIG_ENDIAN
+  /* An adjustment is needed (on bigendian systems) for integer types
+ less than the size of a word */
   if (f->size < sizeof(ffi_arg)) {
 switch (f->type) {
 case FFI_TYPE_INT:
@@ -270,21 +272,10 @@ static int ffi_return_type_promotes(ffi_
 case FFI_TYPE_SINT32:
 case FFI_TYPE_UINT64:
 case FFI_TYPE_SINT64:
-  return 1;
+  return sizeof(ffi_arg) - f->size;
 default: break;
 }
   }
-  return 0;
-}
-
-static int ffi_return_type_adjustment(ffi_type *f)
-{
-#ifdef ARCH_BIG_ENDIAN
-  /* An adjustment is needed (on bigendian systems) for integer types
- less than the size of a word */
-  if (ffi_return_type_promotes(f)) {
-return sizeof(ffi_arg) - f->size;
-  }
 #endif
   return 0;
 }
@@ -471,13 +462,51 @@ static void callback_handler_with_lock(f
   /* now store the return value */
   assert (Tag_val(boxedfn) == Done);
 
-  if (ffi_return_type_promotes(cif->rtype)) {
-*(ffi_arg *)ret = 0; 
-  }
-
-  argptr = CTYPES_FROM_PTR(ret + ffi_return_type_adjustment(cif->rtype));
+  argptr = CTYPES_FROM_PTR(ret);
   caml_callback(Field(boxedfn, 0), argptr);
 
+  /* workaround for libffi api: small integers must be promoted to
+   * full word size (sign/zero extended) */
+  if (cif->rtype->size < sizeof(ffi_arg)) {
+int do_nothing = 0;
+ffi_arg x;
+switch (cif->rtype->type) {
+case FFI_TYPE_INT:
+  x = *(int*)ret;
+  break;
+case FFI_TYPE_UINT8:
+  x = *(uint8_t*)ret;
+  break;
+case FFI_TYPE_SINT8:
+  x = *(int8_t*)ret;
+  break;
+case FFI_TYPE_UINT16:
+  x = *(uint16_t*)ret;
+  break;
+case FFI_TYPE_SINT16:
+  x = *(int16_t*)ret;
+  break;
+case FFI_TYPE_UINT32:
+  x = *(uint32_t*)ret;
+  break;
+case FFI_TYPE_SINT32:
+  x = *(int32_t*)ret;
+  break;
+case FFI_TYPE_UINT64:
+  x = *(uint64_t*)ret;
+  break;
+case FFI_TYPE_SINT64:
+  x = *(int64_t*)ret;
+  break;
+default:
+  do_nothing = 1;
+  break;
+}
+if ( do_nothing == 0 ) {
+  *(ffi_arg*)ret = x;
+}
+  }
+
   CAMLreturn0;
 }
 


Bug#842032: leveldb: FTBFS on mips*: 'ReadMemoryBarrier' and 'WriteMemoryBarrier' was not declared in this scope

2016-10-25 Thread Daniel Knezevic
Package: leveldb
Version: 1.19-1
Severity: serious
Tags: sid + patch
Justification: FTBFS
User: debian-m...@lists.debian.org
Usertags: mips-patch

Hi,

Package leveldb FTBFS on mips* with following error:
> g++ -g -O2 -fdebug-prefix-map=/«PKGBUILDDIR»=. -fstack-protector-strong 
> -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I. 
> -I./include -std=c++0x -fno-builtin-memcmp -pthread -DOS_LINUX 
> -DLEVELDB_PLATFORM_POSIX -DLEVELDB_ATOMIC_PRESENT -DSNAPPY -O2 -g -DNDEBUG 
> -fPIC -c db/builder.cc -o out-shared/db/builder.o
> In file included from ./port/port_posix.h:47:0,
>  from ./port/port.h:14,
>  from ./db/filename.h:14,
>  from db/builder.cc:7:
> ./port/atomic_pointer.h: In member function 'void* 
> leveldb::port::AtomicPointer::Acquire_Load() const':
> ./port/atomic_pointer.h:248:23: error: 'ReadMemoryBarrier' was not declared 
> in this scope
>  ReadMemoryBarrier();
>^
> ./port/atomic_pointer.h: In member function 'void 
> leveldb::port::AtomicPointer::Release_Store(void*)':
> ./port/atomic_pointer.h:252:24: error: 'WriteMemoryBarrier' was not declared 
> in this scope
>  WriteMemoryBarrier();
> ^
> In file included from ./port/port_posix.h:47:0,
>  from ./port/port.h:14,
>  from ./util/coding.h:17,
>  from ./db/dbformat.h:14,
>  from ./db/db_impl.h:10,
>  from db/db_bench.cc:8:
> ./port/atomic_pointer.h: In member function 'void* 
> leveldb::port::AtomicPointer::Acquire_Load() const':
> ./port/atomic_pointer.h:248:23: error: 'ReadMemoryBarrier' was not declared 
> in this scope
>  ReadMemoryBarrier();
>^
> ./port/atomic_pointer.h: In member function 'void 
> leveldb::port::AtomicPointer::Release_Store(void*)':
> ./port/atomic_pointer.h:252:24: error: 'WriteMemoryBarrier' was not declared 
> in this scope
>  WriteMemoryBarrier();
> ^
> Makefile:429: recipe for target 'out-shared/db/builder.o' failed
> make[1]: *** [out-shared/db/builder.o] Error 1

build logs:
https://buildd.debian.org/status/fetch.php?pkg=leveldb=mips=1.19-1=1472467702
https://buildd.debian.org/status/fetch.php?pkg=leveldb=mips64el=1.19-1=1472468168
https://buildd.debian.org/status/fetch.php?pkg=leveldb=mipsel=1.19-1=1472467519

The attached patch adds the missing ReadMemoryBarrier and WriteMemoryBarrier 
functions for mips*.
With this patch I was able to build leveldb successfully on mips, mipsel and 
mips64el.

Regards,
Daniel
--- leveldb-1.19.orig/port/atomic_pointer.h
+++ leveldb-1.19/port/atomic_pointer.h
@@ -226,7 +226,10 @@ inline void WriteMemoryBarrier() {
 
 // MIPS
 #elif defined(ARCH_CPU_MIPS_FAMILY) && defined(__GNUC__)
-inline void MemoryBarrier() {
+inline void ReadMemoryBarrier() {
+  __asm__ __volatile__("sync" : : : "memory");
+}
+inline void WriteMemoryBarrier() {
   __asm__ __volatile__("sync" : : : "memory");
 }
 #define LEVELDB_HAVE_MEMORY_BARRIER
@@ -353,6 +356,7 @@ class AtomicPointer {
 #undef ARCH_CPU_SPARC_FAMILY
 #undef ARCH_CPU_SH_FAMILY
 #undef ARCH_CPU_PARISC_FAMILY
+#undef ARCH_CPU_MIPS_FAMILY
 
 }  // namespace port
 }  // namespace leveldb


Bug#843155: stringencoders: FTBFS on mips (endianness issue)

2016-11-04 Thread Daniel Knezevic
Package: stringencoders
Version: 3.10.3+git20160118-1
Severity: important
Tags: sid + patch
Justification: FTBFS
User: debian-m...@lists.debian.org
Usertags: mips-patch
Forwarded: https://github.com/client9/stringencoders/pull/47

Hi,

After removing -Werror from configure.ac this package still FTBFS on mips
(big-endian) with following error:
> FAIL: modp_numtoa_test
> ==
>
> modp_numtoa_test.c ASSERTION FAILED: modp_numtoa_test.c:494 
> 1000 != 0001
> FAIL modp_numtoa_test (exit status: 1)

modp_uitoa16 function is converting a number into string by right shifting the 
input value.
On big-endian the result was reversed because of wrong shifting.
There is no need to separate the code for big and little endian. The bitwise
operators abstract away the endianness.

With attached patch I was able to build stringencoders successfully on mips.

Thanks,
Daniel
--- stringencoders-3.10.3+git20160118.orig/src/modp_numtoa.c
+++ stringencoders-3.10.3+git20160118/src/modp_numtoa.c
@@ -302,15 +302,6 @@ size_t modp_dtoa2(double value, char* st
 return (size_t)(wstr - str);
 }
 
-
-#include "config.h"
-
-/* You can get rid of the include, but adding... */
-/* if on motoral, sun, ibm; uncomment this */
-/* #define WORDS_BIGENDIAN 1 */
-/* else for Intel, Amd; uncomment this */
-/* #undef WORDS_BIGENDIAN */
-
 char* modp_uitoa16(uint32_t value, char* str, int isfinal)
 {
 static const char* hexchars = "0123456789ABCDEF";
@@ -321,8 +312,6 @@ char* modp_uitoa16(uint32_t value, char*
  *  Each line is independent than the previous, so
  *even dumb compilers can pipeline without loop unrolling
  */
-#ifndef WORDS_BIGENDIAN
-/* x86 */
 str[0] = hexchars[(value >> 28) & 0x000F];
 str[1] = hexchars[(value >> 24) & 0x000F];
 str[2] = hexchars[(value >> 20) & 0x000F];
@@ -331,17 +320,6 @@ char* modp_uitoa16(uint32_t value, char*
 str[5] = hexchars[(value >>  8) & 0x000F];
 str[6] = hexchars[(value >>  4) & 0x000F];
 str[7] = hexchars[(value ) & 0x000F];
-#else
-/* sun, motorola, ibm */
-str[0] = hexchars[(value ) & 0x000F];
-str[1] = hexchars[(value >>  4) & 0x000F];
-str[2] = hexchars[(value >>  8) & 0x000F];
-str[3] = hexchars[(value >> 12) & 0x000F];
-str[4] = hexchars[(value >> 16) & 0x000F];
-str[5] = hexchars[(value >> 20) & 0x000F];
-str[6] = hexchars[(value >> 24) & 0x000F];
-str[7] = hexchars[(value >> 28) & 0x000F];
-#endif
 
 if (isfinal) {
 str[8] = '\0';


Bug#843154: stringencoders: FTBFS on several platforms (warnings treated as errors)

2016-11-04 Thread Daniel Knezevic
Package: stringencoders
Version: 3.10.3+git20160118-1
Severity: important
Tags: sid + patch
Justification: FTBFS
User: debian-m...@lists.debian.org
Usertags: mips-patch

Hi,

Package stringencoders FTBFS on several platforms (mips, powerpc, 
kfreebsd-amd64, ...)
because warnings are treated as errors.
This patch was included in the earlier version (3.10.3-2).
Could you please include this patch into the latest version?

Thanks,
Daniel
--- stringencoders-3.10.3+git20160118.orig/configure.ac
+++ stringencoders-3.10.3+git20160118/configure.ac
@@ -19,7 +19,7 @@ B64WCHARS="-_."
 AC_ARG_WITH([b64wchars], AC_HELP_STRING([--with-b64wchars=3CHARS],[change b64 web extra chars, default is '-_.']),
   [B64WCHARS=$withval], [])
 
-EXTRACFLAGS="-Isrc -Wall -Wextra -Werror -Wshadow -Wpointer-arith -Wcast-qual -Wconversion"
+EXTRACFLAGS="-Isrc -Wall -Wextra -Wshadow -Wpointer-arith -Wcast-qual -Wconversion"
 # -Wstrict-prototypes
 # -Wmissing-prototypes
 


Bug#847574: abyss: FTBFS on mips and other big-endian architectures

2016-12-09 Thread Daniel Knezevic
Package: abyss
Version: 2.0.2-1
Severity: important
Tags: sid + patch
Justification: FTBFS
User: debian-m...@lists.debian.org
Usertags: mips-patch
Forwarded: https://github.com/bcgsc/abyss/pull/139

Hi,

Package abyss FTBFS on mips and other big-endian architectures with followind 
error:
> Kmer.cpp: In function 'Seq load(const uint8_t*)':
> Kmer.cpp:193:14: error: 'SEQ_WORDS' was not declared in this scope
>   copy(s, s + SEQ_WORDS, reverse_iterator(d));
>   ^
> Kmer.cpp: In function 'void storeReverse(uint8_t*, Seq)':
> Kmer.cpp:239:14: error: 'SEQ_WORDS' was not declared in this scope
>   copy(s, s + SEQ_WORDS,
  ^

build log: 
https://buildd.debian.org/status/fetch.php?pkg=abyss=mips=2.0.2-1=1478005755

After adding the missing SEQ_WORDS define for big-endian the build passed,
but the following tests failed:
> FAIL: common_kmer
> FAIL: BloomFilter
> FAIL: Konnector_DBGBloomAlgorithms
> FAIL: Konnector_konnector
> FAIL: PairedDBG_LoadAlgorithm
> FAIL: PairedDBG_KmerPair

Comparison of values returned by load and storeReverse methods between mipsel
and mips showed that the data contained in variable seq (type of std::bitset) is
in wrong byte order.

Conversion of arrays bigger than architecture's word size into bitset is working
by going sequentially through memory and converting the values into binary word
by word. It does not care about endianness.
So, on 32bit big-endian architectures the conversion must be done in 32bit
chunks and every chunk must be copied in reverse byte order.

The existing code in load and storeReverse methods was suitable for 64bit
big-endian architectures, it copies 64bit chunks of the array in reverse order.

The attached patch fixes the conversion of array to bitset (and vice versa) by
changing the uint64_t type to size_t in load and storeReverse methods.
This enables to use the same code on 32 and 64 bit architectures.

With this patch I was able to build abyss successfully on mips. This patch was
successfully tested on 64bit big-endian mips too.

Thanks,
Daniel
--- abyss-2.0.2.orig/Common/Kmer.cpp
+++ abyss-2.0.2/Common/Kmer.cpp
@@ -188,9 +188,9 @@ static Seq load(const uint8_t *src)
 	Seq seq;
 #if MAX_KMER > 96
 # if WORDS_BIGENDIAN
-	const uint64_t *s = reinterpret_cast(src);
-	uint64_t *d = reinterpret_cast( + 1);
-	copy(s, s + SEQ_WORDS, reverse_iterator(d));
+	const size_t *s = reinterpret_cast(src);
+	size_t *d = reinterpret_cast( + 1);
+	copy(s, s + Kmer::NUM_BYTES/sizeof(size_t), reverse_iterator(d));
 # else
 	uint8_t *d = reinterpret_cast();
 	memcpy(d, src, sizeof seq);
@@ -234,10 +234,10 @@ static void storeReverse(uint8_t *dest,
 {
 #if MAX_KMER > 96
 # if WORDS_BIGENDIAN
-	const uint64_t *s = reinterpret_cast();
-	uint64_t *d = reinterpret_cast(dest);
-	copy(s, s + SEQ_WORDS,
-			reverse_iterator(d + SEQ_WORDS));
+	const size_t *s = reinterpret_cast();
+	size_t *d = reinterpret_cast(dest);
+	copy(s, s + Kmer::NUM_BYTES/sizeof(size_t),
+			reverse_iterator(d +  Kmer::NUM_BYTES/sizeof(size_t)));
 	reverse(dest, dest + Kmer::NUM_BYTES);
 # else
 	memcpy(dest, , Kmer::NUM_BYTES);


Bug#847757: testdisk FTBFS on mips: common.h:128:2: error: initializer element is not constant

2016-12-13 Thread Daniel Knezevic
I tried Christophe's patch. It does not fix the build.
Package still FTBFS with "initializer element is not constant" error.

Currently gcc-6 is used as default compiler, by changing the compiler to gcc-5
testdisk builds successfully.


Bug#850142: mariadb_config garbage output

2017-01-05 Thread Daniel Knezevic

Hi

The problem is that the mariadb-connector-c package adds symbol 
versioning to

the mariadb_config binary. By doing so it fails to correctly export the
_IO_stdin_used symbol added by the GNU libc.

The attached patch fixes the problem on mips64el.
This solution was used to fix lua5.2 package with similar bug.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=816059

Daniel
--- mariadb-connector-c-2.3.1.orig/libmariadb/CMakeLists.txt
+++ mariadb-connector-c-2.3.1/libmariadb/CMakeLists.txt
@@ -218,7 +218,8 @@ SET(EXPORT_SYMBOLS
  mysql_thread_init
  mysql_thread_safe
  mysql_use_result
- mysql_warning_count)
+ mysql_warning_count
+ _IO_stdin_used)
 
 IF(WITH_OPENSSL)
   SET(EXPORT_SYMBOLS ${EXPORT_SYMBOLS} mariadb_deinitialize_ssl)


Bug#847757: testdisk FTBFS on mips: common.h:128:2: error: initializer element is not constant

2017-01-09 Thread Daniel Knezevic
Hi Christophe,

I have tested your patch, the package builds successfully for mips.


Bug#847757: testdisk FTBFS on mips: common.h:128:2: error: initializer element is not constant

2016-12-19 Thread Daniel Knezevic
Forwarded: https://github.com/cgsecurity/testdisk/pull/15

The problem was in bitwise with signed values in le32 macro.

With attached patch I was able to build testdisk successfully on mips.
--- testdisk-7.0.orig/src/common.h
+++ testdisk-7.0/src/common.h
@@ -466,10 +466,10 @@ time_t td_ntfs2utc (int64_t ntfstime);
 #define le24(x) x) & 0x00ffUL) << 16) | \
 ((x) & 0xff00UL)| \
 (((x) & 0x00ffUL) >> 16))
-#define le32(x)  x)&0xff00L)>>24)| \
-(((x)&0x00ffL)>>8)  | \
-(((x)&0xff00L)<<8)  | \
-(((x)&0x00ffL)<<24))
+#define le32(x)  x)&0xff00UL)>>24)| \
+(((x)&0x00ffUL)>>8)  | \
+(((x)&0xff00UL)<<8)  | \
+(((x)&0x00ffUL)<<24))
 #define be32(x)  (x)
 #define le64(x)  x)&0xff00LL)>>56)   | \
 (((x)&0x00ffLL)>>40)| \