When building librep with gcc4.1 on PPC64, the rep program fails with the following message: ** error: --with-stack-direction is incorrect; it should be 1 This is however not true (the stack does grow downwards on PPC, as the configure script correctly determined), it is in fact the sanity check in check_configuration() which is incorrect. The reason for the erroneous conclusion is that check_configuration() gets inlined, which places stack_high and the variable pointed to by stack_low (dummy) in the same stack frame, making address comparisons between them moot. To fix this, check_configuration() should be made non inlinable. The gcc attribute "noinline" can be used for this purpose, as in this patch: --- librep-0.17.orig/src/main.c +++ librep-0.17/src/main.c @@ -157,6 +157,7 @@ return rep_TRUE; } +static void check_configuration (int *stack_low) __attribute__((noinline)); static void check_configuration (int *stack_low) { Applying this patch makes librep build fine for me. Note however that the noinline attribute is new to gcc 4, so if older compilers should be supported some kind of #if would be in order. I also found this in the ebuild file: use ppc && myconf="${myconf} --with-stack-direction=1" which I believe to be an (incorrect) workaround for the same problem on ppc. Afterwards there is also a similar one for IA64. Since the comment for the IA64 one claims that the problem does not occur with gcc 3, maybe the best solution would be to apply my patch iff (gcc-major-version) -ge 4 . The bogus --with-stack-direction arguments should be removed.
Created attachment 114483 [details, diff] Patch to declare check_configuration() as not inlineabale. This patch requires GCC 4.
Thanks. This has been in librep CVS for a long time, but it's never had a release after 0.17. I'll update to a current snapshot.
Fixed, thanks again for the report.
Thanks. 0.17_p20070101 works fine on my system. Any chance of this package (and x11-libs/rep-gtk and x11-wm/sawfish) getting unmasked for ppc64 now?
I don't have access to any ppc64 system, so I cannot add the keyword myself. Could you open a new bug for that, so that the ppc64 team will get a look at it, please?
Sure. Should I open one bug per package, or a single one for all three?
In this case, a single bug would be fine.