Source: ogre-1.9
Tags: patch

Using __sync_fetch_and_add_8 on architectures without native support requires the libatomic library (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56300), which is part of GCC 4.8+.

The attached patch links against this library and forces compilation with gcc/g++ 4.8. It also disables --as-needed on ia64 to work around bug #718047.

This should fix everything except armhf (crashing make, which is a bug there not here), but has not been tested.
$ diff -up rules_orig rules
--- rules_orig	2013-10-01 20:30:06.846713326 +0100
+++ rules	2013-10-01 20:52:56.234672865 +0100
@@ -15,8 +15,13 @@ export DEB_BUILD_MAINT_OPTIONS   := hard
 dpkg_buildflags = DEB_BUILD_MAINT_OPTIONS=$(DEB_BUILD_MAINT_OPTIONS) dpkg-buildflags
 export DEB_CFLAGS_MAINT_APPEND   := -pipe -Wall $(shell $(dpkg_buildflags) --get CPPFLAGS)
 export DEB_CXXFLAGS_MAINT_APPEND := -pipe -Wall $(shell $(dpkg_buildflags) --get CPPFLAGS)
-export DEB_LDFLAGS_MAINT_APPEND  := -Wl,-z,defs -Wl,--as-needed
-
+# -latomic for __sync_fetch_and_add_8
+# disable -Wl,--as-needed on ia64 due to bug #718047
+ifeq($(DEB_HOST_ARCH),ia64)
+export DEB_LDFLAGS_MAINT_APPEND  := -Wl,-z,defs -latomic
+else
+export DEB_LDFLAGS_MAINT_APPEND  := -Wl,-z,defs -Wl,--as-needed -latomic
+endif
 
 DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
 
@@ -47,7 +52,8 @@ override_dh_auto_configure:
 		-DOGRE_INSTALL_DOCS:BOOL=TRUE \
 		-DOGRE_BUILD_SAMPLES:BOOL=FALSE \
 		-DOGRE_INSTALL_SAMPLES:BOOL=FALSE \
-		-DOGRE_INSTALL_SAMPLES_SOURCE:BOOL=FALSE
+		-DOGRE_INSTALL_SAMPLES_SOURCE:BOOL=FALSE \
+		-DCMAKE_C_COMPILER=gcc-4.8 -DCMAKE_CXX_COMPILER=g++-4.8
 
 override_dh_install:
         # Copy files from template for this particular version
$ diff -up control_orig control
--- control_orig	2013-10-01 21:00:50.306658858 +0100
+++ control	2013-10-01 21:02:02.410656727 +0100
@@ -28,7 +28,8 @@ Build-Depends: debhelper (>= 9~),
                libxaw7-dev,
                libxt-dev,
                libois-dev [linux-any],
-               chrpath
+               chrpath,
+               g++-4.8
 
 Package: libogre-1.9-dev
 Section: libdevel

Reply via email to