Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 452694

Summary: media-gfx/blender-2.49b-r2 fails to build with gcc-4.6
Product: Gentoo Linux Reporter: Alexandre Borges Marcelo <alexandre.marcelo>
Component: Current packagesAssignee: Luca Barbato <lu_zero>
Status: RESOLVED FIXED    
Severity: normal CC: flameeyes, graphics+disabled
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://code.google.com/p/bullet/issues/detail?id=481
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 346809    
Attachments: Patch from Comment #0

Description Alexandre Borges Marcelo 2013-01-17 16:43:27 UTC
After upgrading to gcc-4.6.3 I tried to rebuild blender-2.49b-r2, which gave the error: 'ptrdiff_t' does not name a type. According to http://gcc.gnu.org/gcc-4.6/porting_to.html, all I needed was to add <cstddef>. Following that, tring to rebuild gave the error described in https://code.google.com/p/bullet/issues/detail?id=481 and, after aplying the mentioned patch, blender built with no issues.


Reproducible: Always




diff -urN blender-2.49b.orig/extern/bullet2/src/BulletSoftBody/btSoftBodyInternals.h blender-2.49b/extern/bullet2/src/BulletSoftBody/btSoftBodyInternals.h
--- blender-2.49b.orig/extern/bullet2/src/BulletSoftBody/btSoftBodyInternals.h  2009-09-01 12:23:19.000000000 -0300
+++ blender-2.49b/extern/bullet2/src/BulletSoftBody/btSoftBodyInternals.h       2013-01-17 14:31:13.370789951 -0200
@@ -18,6 +18,7 @@
 #define _BT_SOFT_BODY_INTERNALS_H

 #include "btSoftBody.h"
+#include <string.h>

 #include "LinearMath/btQuickprof.h"
 #include "BulletCollision/BroadphaseCollision/btBroadphaseInterface.h"
@@ -171,8 +172,7 @@
 template <typename T>
 static inline void                     ZeroInitialize(T& value)
 {
-       static const T  zerodummy;
-       value=zerodummy;
+       memset(&value,0,sizeof(T));
 }
 //
 template <typename T>
diff -urN blender-2.49b.orig/intern/memutil/MEM_Allocator.h blender-2.49b/intern/memutil/MEM_Allocator.h
--- blender-2.49b.orig/intern/memutil/MEM_Allocator.h   2009-09-01 12:20:41.000000000 -0300
+++ blender-2.49b/intern/memutil/MEM_Allocator.h        2013-01-17 13:52:22.577275420 -0200
@@ -24,6 +24,7 @@
 #ifndef __MEM_Allocator_h_included__
 #define __MEM_Allocator_h_included__ 1

+#include <cstddef>
 #include "guardedalloc/MEM_guardedalloc.h"
 #include "guardedalloc/BLO_sys_types.h"
Comment 1 Samuli Suominen (RETIRED) gentoo-dev 2013-01-17 16:46:46 UTC
Don't post to bugs like that, use attachements
Comment 2 Samuli Suominen (RETIRED) gentoo-dev 2013-01-17 16:49:19 UTC
Created attachment 335926 [details, diff]
Patch from Comment #0
Comment 3 Samuli Suominen (RETIRED) gentoo-dev 2013-01-17 16:52:12 UTC
+  17 Jan 2013; Samuli Suominen <ssuominen@gentoo.org> blender-2.49b-r2.ebuild,
+  +files/blender-2.49b-gcc46.patch:
+  Fix building with sys-devel/gcc >= 4.6.0 wrt #452694 by Alexandre Borges
+  Marcelo