On Wed, Mar 09, 2011 at 07:27:10PM +0200, Peter Pentchev wrote:
> On Wed, Mar 09, 2011 at 10:28:56AM +0530, Tarun Kumar Mall wrote:
> > Package: alex4
> > Version: 1.1-3
> > Severity: normal
> > Tags: patch
> > User: [email protected]
> > Usertags: origin-ubuntu natty ubuntu-patch
> > 
> > Package failed to build from source.
> > Here is the error log.
> > 
> > Binary package hint: alex4
> > 
> > cc `allegro-config --libs` -laldmb -ldumb -o alex4 actor.o edit.o map.o 
> > player.o shooter.o unix.o bullet.o hisc.o options.o script.o timer.o 
> > control.o main.o particle.o scroller.o token.o
> [snip lots of linker errors because of badly ordered linker command line]
> > collect2: ld returned 1 exit status
> > make[1]: *** [alex4] Error 1
> > make[1]: Leaving directory `/home/tarun/source/alex4/alex4-1.1/src'
> > make: *** [build-arch-stamp] Error 2
> > dpkg-buildpackage: error: debian/rules build gave error exit status 2
> > debuild: fatal error at line 1335:
> > dpkg-buildpackage -rfakeroot -D -us -uc failed
> > 
> > *** /tmp/tmpdOEglw
> > In Ubuntu, we've applied the attached patch to achieve the following:
> > 
> >   * debian/patches/fix_ftbfs_binutils-gold.patch: changed the order of
> >     libraries in order to fix FTBFS. (LP: #730653) 
> > 
> > We thought you might be interested in doing the same. 
> 
> Tarun, thanka (again - after the same discussion about dma ;) for the bug
> report and the proposed patch!
> 
> Peter, what do you think about the attached series of patches that:
> 
> 1. in the very first patch, fixes this problem (although it does not
>    cause an FTBFS in Debian, it's still a good idea to clean up
>    the code - after all, the Unix linker has been documented to work
>    this way for ages, even though, apparently, GNU ld is a bit lenient)
> 
> 2. in all the rest of the patches, refreshes the alex4 Debian packaging
>    a whole lot - 3.0 (quilt), debhelper 8, Policy 3.9.1,
>    dpkg-buildflags, etc.
> 
> If you have no objections, I could commit those patches to the Debian
> Games Subversion repository; of course, as the principal maintainer of
> alex4, it's your call to like or not like some or all of them :)
> 
> Thanks to both of you for trying to make the world a better place by
> working on Debian and Ubuntu :)

And here's another patch that makes alex4 *not* FTBFS on unstable with
all the warning options that I've turned on and the -Werror that I always
test with :)

G'luck,
Peter

-- 
Peter Pentchev  [email protected] [email protected] [email protected]
PGP key:        http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
What would this sentence be like if it weren't self-referential?
From e7a11784e9a0fbb82fd628d2363c6eaa4bcec1bd Mon Sep 17 00:00:00 2001
From: Peter Pentchev <[email protected]>
Date: Wed, 9 Mar 2011 19:50:56 +0200
Subject: [PATCH 16/16] Fix an undefined order of operations problem.

---
 debian/patches/hardening.patch |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/debian/patches/hardening.patch b/debian/patches/hardening.patch
index eb8fb9c..a392eaa 100644
--- a/debian/patches/hardening.patch
+++ b/debian/patches/hardening.patch
@@ -1,6 +1,7 @@
 Description: Harden the build.
  - check the fread() and fwrite() return values
  - swap a return and an fclose()
+ - fix an undefined order of operations problem
 Forwarded: no
 Author: Peter Pentchev <[email protected]>
 Last-Update: 2011-03-07
@@ -152,3 +153,15 @@ Last-Update: 2011-03-07
  
  	// close file
  	fclose(fp);
+--- a/src/shooter.c
++++ b/src/shooter.c
+@@ -903,7 +903,8 @@
+ 									s_var.score += 1000000;
+ 								}
+ 								else {  // increase power
+-									s_var.power_level = MIN(s_var.power_level ++, 7);
++									if (++s_var.power_level > 7)
++										s_var.power_level = 7;
+ 								}
+ 								play_sound_id(SMPL_HEART);	
+ 
-- 
1.7.2.3

Attachment: signature.asc
Description: Digital signature

Reply via email to