Package: libldm
Version: 0.2.3-4
Severity: minor
Tags: patch
User: [email protected]
Usertags: origin-ubuntu yakkety ubuntu-patch
Hi Hilko,
libldm version 0.2.3-4 failed to build in Ubuntu on the ppc64el
architecture, with an uninitialized variable error:
libtool: link: ( cd ".libs" && rm -f "libldm-1.0.la" && ln -s
"../libldm-1.0.la" "libldm-1.0.la" )
gcc -DHAVE_CONFIG_H -I. -I.. -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -Werror
-Wshadow -Wextra -Wno-unused-local-typedefs -Wno-unused-parameter
-I/usr/include/glib-2.0 -I/usr/lib/powerpc64le-linux-gnu/glib-2.0/include
-pthread -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0
-I/usr/lib/powerpc64le-linux-gnu/glib-2.0/include -pthread
-I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0
-I/usr/lib/powerpc64le-linux-gnu/glib-2.0/include -g -O3
-fstack-protector-strong -Wformat -Werror=format-security -c -o
ldmtool-ldmtool.o `test -f 'ldmtool.c' || echo './'`ldmtool.c
ldmtool.c: In function ‘shell’:
ldmtool.c:642:12: error: ‘result’ may be used uninitialized in this function
[-Werror=maybe-uninitialized]
if (result) json_builder_reset(jb);
^
cc1: all warnings being treated as errors
make[3]: *** [ldmtool-ldmtool.o] Error 1
(https://launchpadlibrarian.net/257939759/buildlog_ubuntu-yakkety-ppc64el.libldm_0.2.3-4_BUILDING.txt.gz)
The attached patch has been applied in Ubuntu to fix this build failure.
Please consider applying it in Debian as well (and/or forwarding it
upstream); it doesn't directly impact Debian builds, but is still "correct"
and improves compatibility if anyone does want to build the Debian package
with -O3.
Cheers,
--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer http://www.debian.org/
[email protected] [email protected]
diff -Nru libldm-0.2.3/debian/patches/series libldm-0.2.3/debian/patches/series
--- libldm-0.2.3/debian/patches/series 2014-06-13 14:04:15.000000000 -0700
+++ libldm-0.2.3/debian/patches/series 2016-07-01 09:41:41.000000000 -0700
@@ -4,3 +4,4 @@
0004-Don-t-call-g_type_init-when-compiling-with-newer-gli.patch
0005-Cast-result-of-be64toh-to-uint64_t.patch
0006-Avoid-shadowing-error-on-mips.patch
+uninitialized_variables.patch
diff -Nru libldm-0.2.3/debian/patches/uninitialized_variables.patch libldm-0.2.3/debian/patches/uninitialized_variables.patch
--- libldm-0.2.3/debian/patches/uninitialized_variables.patch 1969-12-31 16:00:00.000000000 -0800
+++ libldm-0.2.3/debian/patches/uninitialized_variables.patch 2016-07-01 09:52:09.000000000 -0700
@@ -0,0 +1,19 @@
+Author: Steve Langasek <[email protected]>
+Description: Fix build failure due to possible uninitialized variable
+ When building with -O3, as we do on ppc64el in Ubuntu, gcc is more
+ aggressive about detecting uninitialized variables. Set a default value
+ for this (presumed) false-positive.
+
+Index: libldm-0.2.3/src/ldmtool.c
+===================================================================
+--- libldm-0.2.3.orig/src/ldmtool.c
++++ libldm-0.2.3/src/ldmtool.c
+@@ -624,7 +624,7 @@
+ history_len++;
+ free(line);
+
+- gboolean result;
++ gboolean result = FALSE;
+ if (!do_command(ldm, argc, argv, &result, out, jg, jb)) {
+ if (g_strcmp0("quit", argv[0]) == 0 ||
+ g_strcmp0("exit", argv[0]) == 0)