Package: src:mruby
Version: 1.1.0+20150807+git4fdf4922-1
Severity: normal
Tags: patch

Dear Maintainer,

While trying to build the package on ppc64el, the tests fail:

Total: 853
   OK: 852
   KO: 1
Crash: 0
 Time: 0.39 seconds
rake aborted!
Command Failed: ["build/host/test/mrbtest" -v]
Rakefile:122:in `block (2 levels) in <top (required)>'
make[1]: *** [test] Error 1
dh_auto_test: make -j1 test returned exit code 2
make: *** [build-arch] Error 2
dpkg-buildpackage: error: debian/rules build-arch gave error exit status 2
Makefile:12: recipe for target 'test' failed
make[1]: Leaving directory '/«BUILDDIR»/mruby-1.1.0+20150807+git4fdf4922'

It seems coming from the options given to gcc, especially those ones:
-g3 -O0.
As said in documention: "GCC allows you to use -g with -O. The shortcuts
taken by optimized code may occasionally produce surprising results".
In this case, for ppc64el, it makes fail a test with large doubles and
prevents the packages to be built.

The attached patch removes the -O0 option when building the package for
ppc64el architecture.

Thanks for considering this patch.

Regards,
Erwan.

-- System Information:
Debian Release: jessie/sid
    APT prefers unstable
    APT policy: (500, 'unstable')
Architecture: ppc64el (ppc64le)

Kernel: Linux 3.16.0-4-powerpc64le
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

diff -Naur a/debian/patches/ppc64el.patch b/debian/patches/ppc64el.patch
--- a/debian/patches/ppc64el.patch      1970-01-01 01:00:00.000000000 +0100
+++ b/debian/patches/ppc64el.patch      2015-08-13 13:00:26.273811806 +0200
@@ -0,0 +1,13 @@
+diff -Naur a/tasks/mruby_build.rake b/tasks/mruby_build.rake
+--- a/tasks/mruby_build.rake   2015-08-13 12:55:56.705826133 +0200
++++ b/tasks/mruby_build.rake   2015-08-13 12:59:50.785813692 +0200
+@@ -100,7 +100,8 @@
+       compilers.each do |c|
+         c.defines += %w(MRB_DEBUG)
+         if toolchains.any? { |toolchain| toolchain == "gcc" }
+-          c.flags += %w(-g3 -O0)
++          c.flags += %w(-g3)
++          c.flags += %w(-O0) if ENV['DEB_TARGET_ARCH'] != 'ppc64el'
+         end
+       end
+       @mrbc.compile_options += ' -g'
diff -Naur a/debian/patches/series b/debian/patches/series
--- a/debian/patches/series     2015-08-13 12:55:56.725826132 +0200
+++ b/debian/patches/series     2015-08-13 13:02:44.593804455 +0200
@@ -1 +1,2 @@
 enable_verbose_build.patch
+ppc64el.patch

Reply via email to