Bug#728150: grass: diff for NMU version 6.4.3-2.1
Paul Gevers
elbrus at debian.org
Sat Dec 14 13:54:44 UTC 2013
tags 672719 + patch
tags 672719 + pending
tags 728150 + patch
tags 728150 + pending
thanks
Dear maintainer,
I've prepared an NMU for grass (versioned as 6.4.3-2.1) and
uploaded it to DELAYED/3. Please feel free to tell me if I
should delay it longer.
Regards.
diff -Nru grass-6.4.3/debian/changelog grass-6.4.3/debian/changelog
--- grass-6.4.3/debian/changelog 2013-09-26 11:21:23.000000000 +0200
+++ grass-6.4.3/debian/changelog 2013-12-14 12:35:21.000000000 +0100
@@ -1,3 +1,13 @@
+grass (6.4.3-2.1) unstable; urgency=low
+
+ * Non-maintainer upload.
+ * On ia64 build with $(HARDENING_DISABLE_PIE_CFLAGS_FILTER) filtered for
+ now (closes: #728150)
+ * Add patch fix_big-endian_issues which allows grass to build on s390x
+ and ppc64 (closes: #672719)
+
+ -- Paul Gevers <elbrus at debian.org> Sat, 14 Dec 2013 12:17:17 +0100
+
grass (6.4.3-2) unstable; urgency=low
[ M. Hamish Bowman ]
diff -Nru grass-6.4.3/debian/patches/fix_big-endian_issues grass-6.4.3/debian/patches/fix_big-endian_issues
--- grass-6.4.3/debian/patches/fix_big-endian_issues 1970-01-01 01:00:00.000000000 +0100
+++ grass-6.4.3/debian/patches/fix_big-endian_issues 2013-12-14 12:28:48.000000000 +0100
@@ -0,0 +1,151 @@
+Description: Fix big endian behavior
+Origin: https://trac.osgeo.org/grass/changeset/57855
+Bug: https://trac.osgeo.org/grass/ticket/1430
+Bug-Debian: http://bugs.debian.org/672719
+
+--- a/lib/vector/diglib/portable.c
++++ b/lib/vector/diglib/portable.c
+@@ -155,21 +155,19 @@
+ memset(buf, 0, cnt * sizeof(long));
+ /* read from buffer in changed order */
+ c1 = (unsigned char *)buffer;
+- if (lng_order == ENDIAN_LITTLE)
+- c2 = (unsigned char *)buf;
+- else
+- c2 = (unsigned char *)buf + nat_lng - PORT_LONG;
++ c2 = (unsigned char *)buf;
+ for (i = 0; i < cnt; i++) {
+ /* set to FF if the value is negative */
+ if (lng_order == ENDIAN_LITTLE) {
+ if (c1[PORT_LONG - 1] & 0x80)
+ memset(c2, 0xff, sizeof(long));
++ memcpy(c2, c1, PORT_LONG);
+ }
+ else {
+ if (c1[0] & 0x80)
+ memset(c2, 0xff, sizeof(long));
++ memcpy(c2 + nat_lng - PORT_LONG, c1, PORT_LONG);
+ }
+- memcpy(c2, c1, PORT_LONG);
+ c1 += PORT_LONG;
+ c2 += sizeof(long);
+ }
+@@ -227,21 +225,19 @@
+ memset(buf, 0, cnt * sizeof(int));
+ /* read from buffer in changed order */
+ c1 = (unsigned char *)buffer;
+- if (int_order == ENDIAN_LITTLE)
+- c2 = (unsigned char *)buf;
+- else
+- c2 = (unsigned char *)buf + nat_int - PORT_INT;
++ c2 = (unsigned char *)buf;
+ for (i = 0; i < cnt; i++) {
+ /* set to FF if the value is negative */
+ if (int_order == ENDIAN_LITTLE) {
+ if (c1[PORT_INT - 1] & 0x80)
+ memset(c2, 0xff, sizeof(int));
++ memcpy(c2, c1, PORT_INT);
+ }
+ else {
+ if (c1[0] & 0x80)
+ memset(c2, 0xff, sizeof(int));
++ memcpy(c2 + nat_int - PORT_INT, c1, PORT_INT);
+ }
+- memcpy(c2, c1, PORT_INT);
+ c1 += PORT_INT;
+ c2 += sizeof(int);
+ }
+@@ -299,21 +295,19 @@
+ memset(buf, 0, cnt * sizeof(short));
+ /* read from buffer in changed order */
+ c1 = (unsigned char *)buffer;
+- if (shrt_order == ENDIAN_LITTLE)
+- c2 = (unsigned char *)buf;
+- else
+- c2 = (unsigned char *)buf + nat_shrt - PORT_SHORT;
++ c2 = (unsigned char *)buf;
+ for (i = 0; i < cnt; i++) {
+ /* set to FF if the value is negative */
+ if (shrt_order == ENDIAN_LITTLE) {
+ if (c1[PORT_SHORT - 1] & 0x80)
+ memset(c2, 0xff, sizeof(short));
++ memcpy(c2, c1, PORT_SHORT);
+ }
+ else {
+ if (c1[0] & 0x80)
+ memset(c2, 0xff, sizeof(short));
++ memcpy(c2 + nat_shrt - PORT_SHORT, c1, PORT_SHORT);
+ }
+- memcpy(c2, c1, PORT_SHORT);
+ c1 += PORT_SHORT;
+ c2 += sizeof(short);
+ }
+@@ -438,15 +432,15 @@
+ }
+ else {
+ buf_alloc(cnt * PORT_LONG);
+- if (lng_order == ENDIAN_LITTLE)
+- c1 = (unsigned char *)buf;
+- else
+- c1 = (unsigned char *)buf + nat_lng - PORT_LONG;
++ c1 = (unsigned char *)buf;
+ c2 = (unsigned char *)buffer;
+ for (i = 0; i < cnt; i++) {
+- memcpy(c2, c1, PORT_LONG);
+- c1 += PORT_LONG;
+- c2 += sizeof(long);
++ if (lng_order == ENDIAN_LITTLE)
++ memcpy(c2, c1, PORT_LONG);
++ else
++ memcpy(c2, c1 + nat_lng - PORT_LONG, PORT_LONG);
++ c1 += sizeof(long);
++ c2 += PORT_LONG;
+ }
+ if (dig_fwrite(buffer, PORT_LONG, cnt, fp) == cnt)
+ return 1;
+@@ -481,15 +475,15 @@
+ }
+ else {
+ buf_alloc(cnt * PORT_INT);
+- if (int_order == ENDIAN_LITTLE)
+- c1 = (unsigned char *)buf;
+- else
+- c1 = (unsigned char *)buf + nat_int - PORT_INT;
++ c1 = (unsigned char *)buf;
+ c2 = (unsigned char *)buffer;
+ for (i = 0; i < cnt; i++) {
+- memcpy(c2, c1, PORT_INT);
+- c1 += PORT_INT;
+- c2 += sizeof(int);
++ if (int_order == ENDIAN_LITTLE)
++ memcpy(c2, c1, PORT_INT);
++ else
++ memcpy(c2, c1 + nat_int - PORT_INT, PORT_INT);
++ c1 += sizeof(int);
++ c2 += PORT_INT;
+ }
+ if (dig_fwrite(buffer, PORT_INT, cnt, fp) == cnt)
+ return 1;
+@@ -524,15 +518,15 @@
+ }
+ else {
+ buf_alloc(cnt * PORT_SHORT);
+- if (shrt_order == ENDIAN_LITTLE)
+- c1 = (unsigned char *)buf;
+- else
+- c1 = (unsigned char *)buf + nat_shrt - PORT_SHORT;
++ c1 = (unsigned char *)buf;
+ c2 = (unsigned char *)buffer;
+ for (i = 0; i < cnt; i++) {
+- memcpy(c2, c1, PORT_SHORT);
+- c1 += PORT_SHORT;
+- c2 += sizeof(short);
++ if (shrt_order == ENDIAN_LITTLE)
++ memcpy(c2, c1, PORT_SHORT);
++ else
++ memcpy(c2, c1 + nat_shrt - PORT_SHORT, PORT_SHORT);
++ c1 += sizeof(short);
++ c2 += PORT_SHORT;
+ }
+ if (dig_fwrite(buffer, PORT_SHORT, cnt, fp) == cnt)
+ return 1;
diff -Nru grass-6.4.3/debian/patches/series grass-6.4.3/debian/patches/series
--- grass-6.4.3/debian/patches/series 2013-09-26 11:21:23.000000000 +0200
+++ grass-6.4.3/debian/patches/series 2013-12-14 12:31:35.000000000 +0100
@@ -6,3 +6,4 @@
check4dev
barscale_ui
svn-any-version
+fix_big-endian_issues
diff -Nru grass-6.4.3/debian/rules grass-6.4.3/debian/rules
--- grass-6.4.3/debian/rules 2013-09-26 11:21:23.000000000 +0200
+++ grass-6.4.3/debian/rules 2013-12-14 12:16:21.000000000 +0100
@@ -17,12 +17,17 @@
include /usr/share/hardening-includes/hardening.make
CFLAGS=$(shell dpkg-buildflags --get CFLAGS)
LDFLAGS=$(shell dpkg-buildflags --get LDFLAGS)
-# in Wheezy -fPIE conflicts with -fPIC. See example in the hardening.make file.
-#CFLAGS += $(HARDENING_CFLAGS_PIC) \
-# $(filter-out $(HARDENING_DISABLE_PIE_CFLAGS_FILTER),$(HARDENING_CFLAGS))
-# in Jessie & Sid the problem seems fixed so we can proceed normally.
-CFLAGS+=$(HARDENING_CFLAGS)
-LDFLAGS+=$(HARDENING_LDFLAGS)
+# in Wheezy (and Jessie ia64) -fPIE conflicts with -fPIC. See example in
+# the hardening.make file.
+ifeq ($(shell dpkg-architecture -qDEB_HOST_ARCH_CPU),ia64)
+ CFLAGS += $(HARDENING_CFLAGS_PIC) \
+ $(filter-out $(HARDENING_DISABLE_PIE_CFLAGS_FILTER),$(HARDENING_CFLAGS))
+ LDFLAGS+=$(HARDENING_LDFLAGS)
+else
+ # in Jessie & Sid the problem seems fixed so we can proceed normally
+ CFLAGS+=$(HARDENING_CFLAGS)
+ LDFLAGS+=$(HARDENING_LDFLAGS)
+endif
# TODO: fix these
CFLAGS+=-Wno-error=format-security
More information about the Pkg-grass-devel
mailing list