[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: blender FTBFS problems on mips{,el}: please help



Hi Florian,

On Wed, Oct 04, 2006 at 08:56:47AM +0200, Florian Ernst wrote:
> [ Please CC me on replies as I'm not subscribed. ]
> 
> I'm afraid I need help here as I don't know how to proceed.

I'm happy to help and to have a real good reason to install Debian on
my mipsel Dreambox. 

> The blender package fails to build on mips{,el} ever since release
> 2.40. When using g++-4.1 it hits an ICE[0], when using g++-3.x the
> linking fails[1]. With the architectures being out of sync this
> prevents migration to testing, so at the moment a year-old version of
> blender is in etch which isn't quite desireable for release. :(
> 
> If anyone could possibly get blender to compile on mips and/or mipsel
> please tell me how to do it.

I was able to compile it with gcc-4.1 4.1.1-13 from etch. I hope this is
used on the autobuilder as well or do they ran unstable?
(http://www.debian.org/devel/buildd/setting-up has the code names hard
coded and may be out of date.)

I could not test it on my SGI Octane mips box because I failed to boostrap
gcc (various versions) using the SGI IRIX compiler.

> [0] ICE when using g++-4.1:
> | source/blender/src/interface.c: In function 'uiBlockPickerButtons':
> | source/blender/src/interface.c:3207: error: unable to find a register to spill in class 'FP_REGS'
> | source/blender/src/interface.c:3207: error: this is the insn:
> | (insn 171 175 172 1 (parallel [
> |             (set (subreg:SI (reg:HI 278) 0)
> |                 (fix:SI (reg:DF 32 $f0 [277])))
> |             (clobber (scratch:DF))
> |         ]) 169 {fix_truncdfsi2_macro} (insn_list:REG_DEP_TRUE 169 (nil))
> |     (expr_list:REG_DEAD (reg:DF 32 $f0 [277])
> |         (expr_list:REG_UNUSED (scratch:DF)
> |             (nil))))
> | source/blender/src/interface.c:3207: confused by earlier errors, bailing out
> | scons: *** [build/linux2/source/blender/src/interface.o] Error 1
> | scons: building terminated because of errors.
> Reported as bug#354439, supposedly fixed in g++-4.2.

There are many solutions:
 * Avoid the -O2 compiler flag, -O0, -O1, -O3, -Os all work.
   Maybe you want to test the effect of changing the optimisation level
   on a i386 box? You could also try to change -O2 for interface.c only.
 * Split the affected function into two parts so that it even compiles
   with -O2. See my attached patch. (Because I'm not familar with the code
   (I miss const specifiers) I provided all parameters via
   call-by-reference, that's why the many dereferences via "*".
   call-by-value parameters would reduce the patch size to only a few
   lines ...)

With the patch:
jens@dm7025:~/blender-2.42a/source/blender/src$ gcc -c -I ../../../intern/guardedalloc/ \
 -I ../../../source/blender/blenlib/ -I ../../../intern/bmfont \
 -I ../../../source/blender/include -I ../../../source/blender/makesdna \
 -I ../../../source/blender/blenkernel/ -I ../../../source/blender/python \
 -O2 interface.c
interface.c: In function 'ui_block_flush_overdraw':
interface.c:341: warning: comparison is always true due to limited range of data type

I suggest you select your prefered solution and send me a patch, so that
I can try it again. (I stopped the build after compiling interfaces.c).
Please note that the build needs many hours (approximately 7 on my fast
300MHz box). Using -Os seems to increase this time even more.

> [1] Linking fails when using g++-3.x:
> | Linking program ==> 'blender'
> | `.gnu.linkonce.t._ZNK8BoxShape16GetPlaneEquationER11SimdVector4i' referenced in section `.rodata' of build/linux2/lib/libextern_bullet.a(CylinderShape.o): defined in discarded section `.gnu.linkonce.t._ZNK8BoxShape16GetPlaneEquationER11SimdVector4i' of build/linux2/lib/libextern_bullet.a(CylinderShape.o)
> | `.gnu.linkonce.t._ZNK8BoxShape7GetEdgeEiR11SimdVector3S1_' referenced in section `.rodata' of build/linux2/lib/libextern_bullet.a(CylinderShape.o): defined in discarded section `.gnu.linkonce.t._ZNK8BoxShape7GetEdgeEiR11SimdVector3S1_' of build/linux2/lib/libextern_bullet.a(CylinderShape.o)
> | collect2: ld returned 1 exit status
> | scons: *** [build/linux2/bin/blender] Error 1
> | scons: building terminated because of errors.

According to google it is often sufficient to remove "inline" statements.
Nevertheless this isn't the case here. I also moved the affected inline
functions to the code where they are used - without effect.
There is also a warning about a possible conflict of libstdc++.so.6 with
libstdc++.so.5 so you should prefer gcc-4.1.

Jens



Reply to: