[Apt-Rpm] apt-rpm bug fixes

Panu Matilainen pmatilai at laiskiainen.org
Thu Jan 10 22:12:23 PST 2008


On Thu, 10 Jan 2008, Ryan Burns wrote:

> Hi Panu,
>
> Don't worry about the late response, it took me a quite a while get around
> to submitting those patches :) Thanks for applying them.

Heh. Well, thanks for getting around to submitting them :)

> On the arm alignment issues, I corrected the md5 patch to follow what was
> done in sha1.h and verified that it still fixes the issue.

Ok, good - applied. Not that I particularly like having gcc-specifics in 
apt either but at least this is no worse than what we've had so far.

> And for the bool alignment, I completely agree with you that having to align a
> bool seems very wrong, but it is indeed required in this case. The general
> problem is that gcc4+ no longer handles alignment for the programer. IIRC, the
> community's reasoning is that the C standard specifies that alignment is up to
> the programmer, and therefore it is unnecessary for the compiler to help with
> this. (Sorry, I can find the link I was given to the section of the standard
> that talks about it). I guess in previous versions of gcc, they were just "kind
> enough" to handle the most common cases for us. Long story short is that the
> bool is not aligned and unlike x86, arm doesn't allow for unaligned access.

What bothers me here is that apt is full of bools, what exactly is it 
about HideZeroEpoch that makes it require alignment? Hum... one 
possibility:

In rpmhandler.cc it's declared as "bool HideZeroEpoch" but in rpmsystem.h 
it's "extern int HideZeroEpoch". That's just a stupid mistake by me. Can 
you check if the need for alignment goes away if you fix the 
type-mismatch:

--- a/apt-pkg/rpm/rpmsystem.h
+++ b/apt-pkg/rpm/rpmsystem.h
@@ -60,6 +60,6 @@ class rpmSystem : public pkgSystem
  };

  extern rpmSystem rpmSys;
-extern int HideZeroEpoch;
+extern bool HideZeroEpoch;

  #endif

 	- Panu -



More information about the Apt-Rpm mailing list