I will try to fix de-serialization problems on big endian.

For now i have tried to build package with your patches 
1) 
https://github.com/jlblancoc/mrpt/commit/9a878c0950edd8ca7de6f4584f920c4e0db05ecc
2) 
https://github.com/jlblancoc/mrpt/commit/289498fc34703c2fcf6b61e72c3311144e5fb570
and ifdef workaround
3) 
https://github.com/jlblancoc/mrpt/commit/c06ed1c384ba2e719c52f65a1a49bddcf7d261e5
and the patch
4) mips-patch.diff (attached in this mail)

With these changes I was able to build package on mips*

For strict alignment, as far as I know, there is no macro that could be used 
for detecting if a strict alignment is necessary.
I think that sparc also has alignment rules. 
(maybe the best way to be sure about this is to ask porters for other 
architectures to help with this issue).

Regards,
Jurica

________________________________________
From: Jose Luis Blanco [joseluisblan...@gmail.com]
Sent: 21 August 2014 19:11
To: Jurica Stanojkovic
Cc: 758...@bugs.debian.org
Subject: Re: Bug#758725: package mrpt_1:1.2.1-1 FTBFS on i386, amd64, mips*

So, the #ifdef "workaround" was incorrectly placed, to start with!

This patch will "solve" it:
https://github.com/jlblancoc/mrpt/commit/c06ed1c384ba2e719c52f65a1a49bddcf7d261e5

But obviously, that's not the ideal solution because that's resigning
trying to fix de-serialization problems!

I didn't know that issue about "#pragma pack", it will be a problem.
Let me check it more in depth, but I'm sure the struct pack'ing is
taken for granted in some parts of the code. Actually, there's even
one unit test checking it...

Please, let me know whatever other unit tests don't pass in MIPS while
I think what to do with the pragmas.

BTW: Is there any macro to detect architectures with strict alignment rules?

JL
diff -upNr mrpt-1.2.1-old/libs/base/include/mrpt/math/lightweight_geom_data.h mrpt-1.2.1/libs/base/include/mrpt/math/lightweight_geom_data.h
--- mrpt-1.2.1-old/libs/base/include/mrpt/math/lightweight_geom_data.h	2014-07-10 16:18:40.000000000 +0000
+++ mrpt-1.2.1/libs/base/include/mrpt/math/lightweight_geom_data.h	2014-08-01 17:40:08.000000000 +0000
@@ -25,7 +25,9 @@ namespace math	{
 	  * @{ */
 
 	//Pragma defined to ensure no structure packing
+#ifndef __mips__
 #pragma pack(push,1)
+#endif
 	//Set of typedefs for lightweight geometric items.
 	/**
 	  * Lightweight 2D point. Allows coordinate access using [] operator.
@@ -238,7 +240,9 @@ namespace math	{
 		 static size_t size() { return 3; }
 	};
 
+#ifndef __mips__
 #pragma pack(pop) // NOTE: Don't force TPoint3Df to be mem aligned (may break CPU mem access alignment in ARM)
+#endif
 
 	/** Lightweight 3D point (float version).
 	  * \sa mrpt::poses::CPoint3D, mrpt::math::TPoint3D
@@ -261,7 +265,9 @@ namespace math	{
 
 	};
 
+#ifndef __mips__
 #pragma pack(push,1)  //Pragma defined to ensure no structure packing
+#endif
 	/**
 	  * Lightweight 3D point. Allows coordinate access using [] operator.
 	  * \sa mrpt::poses::CPoint3D, mrpt::math::TPoint3Df
@@ -550,7 +556,9 @@ namespace math	{
 		 void fromString(const std::string &s);
 		 static size_t size() { return 7; }
 	};
+#ifndef __mips__
 #pragma pack(pop)
+#endif
 
 	// Text streaming functions:
 	std::ostream BASE_IMPEXP & operator << (std::ostream& o, const TPoint2D & p);
@@ -621,7 +629,9 @@ namespace math	{
 	struct BASE_IMPEXP TObject3D;
 
 	//Pragma defined to ensure no structure packing
+#ifndef __mips__
 #pragma pack(push,1)
+#endif
 	/**
 	  * 2D segment, consisting of two points.
 	  * \sa TSegment3D,TLine2D,TPolygon2D,TPoint2D
@@ -761,7 +771,9 @@ namespace math	{
 
 		bool operator<(const TSegment3D &s) const;
 	};
+#ifndef __mips__
 #pragma pack(pop)
+#endif
 
 	inline bool operator==(const TSegment2D &s1,const TSegment2D &s2)	{
 		return (s1.point1==s2.point1)&&(s1.point2==s2.point2);

Reply via email to