On Tue, Oct 19, 2010 at 11:27:09PM +0200, Sven Hartge wrote:
> I revived my SunFire v240, installed an up-to-date Sid on it and tried
> to reproduce this bug. But I am no longer able to get the mentioned
> error with the current gcc-4.4 from Sid.
> 
> haveged compiles, links and runs in both 32bit and 64bit (-m64) mode.
> A quick check with the included crypto tests also shows no apparent
> error in the resulting binaries.
> 
> I believe this bug will vanish if the dependency on gcc-4.3 is removed.
> On i386/amd64 haveged will have to get compiled using "-O0", because of
> the segfault still occurring on these archs.

For another option, I have found in polarssl assembly code to retrieve
the hardclock on older Sparc architectures.  With the attached patch
applied, haveged did build and test fine on smetana.d.o.

Cheers,
-- 
Jérémy Bobbio                        .''`. 
lu...@debian.org                    : :Ⓐ  :  # apt-get install anarchism
                                    `. `'` 
                                      `-   
--- haveged-0.9.orig/src/havegedef.h
+++ haveged-0.9/src/havegedef.h
@@ -57,8 +57,13 @@
 #endif

 #ifdef HAVE_ISA_SPARC
-#define ARCH "sparc"
-#define HARDCLOCK(x) ASM("rd %%tick, %0":"=r"(x):"r"(x))
+# define ARCH "sparc"
+# if defined(__GNUC__) && defined(__sparc__)
+#  define HARDCLOCK(x) ASM(".byte 0x83, 0x41, 0x00, 0x00");\
+                       ASM("mov   %%g1, %0" : "=r"(x))
+# else
+#  define HARDCLOCK(x) ASM("rd %%tick, %0":"=r"(x):"r"(x))
+# endif
 #endif

 #ifdef HAVE_ISA_PPC

Attachment: signature.asc
Description: Digital signature

Reply via email to