* [Buildroot] [PATCH v1 1/2] assimp: fix bfin compile
@ 2016-01-14 21:44 Peter Seiderer
2016-01-14 21:44 ` [Buildroot] [PATCH v1 2/2] assimp: fix compile for big endian target Peter Seiderer
2016-01-16 13:07 ` [Buildroot] [PATCH v1 1/2] assimp: fix bfin compile Thomas Petazzoni
0 siblings, 2 replies; 3+ messages in thread
From: Peter Seiderer @ 2016-01-14 21:44 UTC (permalink / raw)
To: buildroot
Use proper 64-bit constant for CONVERT_FBX_TIME(time) conversion.
Fixes ([1]):
code/FBXConverter.cpp:2025: error: integer constant is too large for 'long' type
code/FBXConverter.cpp:2026: error: integer constant is too large for 'long' type
code/FBXConverter.cpp:2794: error: integer constant is too large for 'long' type
code/FBXConverter.cpp:2868: error: integer constant is too large for 'long' type
code/FBXConverter.cpp:2878: error: integer constant is too large for 'long' type
code/FBXConverter.cpp:2888: error: integer constant is too large for 'long' type
[1] http://autobuild.buildroot.net/results/885/8853b192d16ca7ef769c5352a2df0540a7a2a4fd
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
...x-FBXConverter-use-proper-64-bit-constant.patch | 35 ++++++++++++++++++++++
1 file changed, 35 insertions(+)
create mode 100644 package/assimp/0001-Fix-FBXConverter-use-proper-64-bit-constant.patch
diff --git a/package/assimp/0001-Fix-FBXConverter-use-proper-64-bit-constant.patch b/package/assimp/0001-Fix-FBXConverter-use-proper-64-bit-constant.patch
new file mode 100644
index 0000000..bfcbeb5
--- /dev/null
+++ b/package/assimp/0001-Fix-FBXConverter-use-proper-64-bit-constant.patch
@@ -0,0 +1,35 @@
+From 30a2ecc7939449f235282eb6de42e367fc5b1867 Mon Sep 17 00:00:00 2001
+From: Peter Seiderer <ps.report@gmx.net>
+Date: Thu, 14 Jan 2016 22:13:15 +0100
+Subject: [PATCH] Fix FBXConverter: use proper 64-bit constant
+
+Use proper 64-bit constant for CONVERT_FBX_TIME(time) conversion, fixes:
+
+ code/FBXConverter.cpp:2025: error: integer constant is too large for 'long' type
+ code/FBXConverter.cpp:2026: error: integer constant is too large for 'long' type
+ code/FBXConverter.cpp:2794: error: integer constant is too large for 'long' type
+ code/FBXConverter.cpp:2868: error: integer constant is too large for 'long' type
+ code/FBXConverter.cpp:2878: error: integer constant is too large for 'long' type
+ code/FBXConverter.cpp:2888: error: integer constant is too large for 'long' type
+
+Signed-off-by: Peter Seiderer <ps.report@gmx.net>
+---
+ code/FBXConverter.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/code/FBXConverter.cpp b/code/FBXConverter.cpp
+index e0c6b9c..b1e9a71 100644
+--- a/code/FBXConverter.cpp
++++ b/code/FBXConverter.cpp
+@@ -67,7 +67,7 @@ namespace FBX {
+
+ #define MAGIC_NODE_TAG "_$AssimpFbx$"
+
+-#define CONVERT_FBX_TIME(time) static_cast<double>(time) / 46186158000L
++#define CONVERT_FBX_TIME(time) static_cast<double>(time) / 46186158000LL
+
+ // XXX vc9's debugger won't step into anonymous namespaces
+ //namespace {
+--
+2.1.4
+
--
2.1.4
^ permalink raw reply related [flat|nested] 3+ messages in thread* [Buildroot] [PATCH v1 2/2] assimp: fix compile for big endian target
2016-01-14 21:44 [Buildroot] [PATCH v1 1/2] assimp: fix bfin compile Peter Seiderer
@ 2016-01-14 21:44 ` Peter Seiderer
2016-01-16 13:07 ` [Buildroot] [PATCH v1 1/2] assimp: fix bfin compile Thomas Petazzoni
1 sibling, 0 replies; 3+ messages in thread
From: Peter Seiderer @ 2016-01-14 21:44 UTC (permalink / raw)
To: buildroot
Patch taken from upstream [1].
Fixes ([2]):
code/Bitmap.cpp: In function 'std::size_t Assimp::Copy(uint8_t*, T&) [with T = short unsigned int, std::size_t = unsigned int, uint8_t = unsigned char]':
code/Bitmap.cpp:95:50: instantiated from here
code/Bitmap.cpp:87:9: error: lvalue required as unary '&' operand
[1] https://github.com/assimp/assimp/commit/756cfd4f74b866e3183caede69daa8c105b73bab.patch
[2] http://autobuild.buildroot.net/results/7aa/7aafdc2633bad96a2a17f4e8664e09aae78a3bbd
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
.../assimp/0002-fix-compilation-on-BigEndian.patch | 40 ++++++++++++++++++++++
1 file changed, 40 insertions(+)
create mode 100644 package/assimp/0002-fix-compilation-on-BigEndian.patch
diff --git a/package/assimp/0002-fix-compilation-on-BigEndian.patch b/package/assimp/0002-fix-compilation-on-BigEndian.patch
new file mode 100644
index 0000000..93cba5d
--- /dev/null
+++ b/package/assimp/0002-fix-compilation-on-BigEndian.patch
@@ -0,0 +1,40 @@
+From 8457f3eff89dae35d43f679a66842ceedfd08808 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?=
+ <zmoelnig@umlautQ.umlaeute.mur.at>
+Date: Fri, 13 Nov 2015 22:33:20 +0100
+Subject: [PATCH] fix compilation on BigEndian
+
+cannot pass a function by reference where an lvalue is expected
+(only applies to bigendian, where a macro expands to a byteswap function)
+
+Closes https://github.com/assimp/assimp/issues/613
+
+Taken from [1] for buildroot assimp package compile fix.
+
+[1] https://github.com/assimp/assimp/commit/756cfd4f74b866e3183caede69daa8c105b73bab.patch
+
+Signed-off-by: Peter Seiderer <ps.report@gmx.net>
+---
+ code/Bitmap.cpp | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/code/Bitmap.cpp b/code/Bitmap.cpp
+index 13ec372..829fd02 100644
+--- a/code/Bitmap.cpp
++++ b/code/Bitmap.cpp
+@@ -84,7 +84,12 @@ namespace Assimp {
+
+ template<typename T>
+ inline std::size_t Copy(uint8_t* data, T& field) {
++#ifdef AI_BUILD_BIG_ENDIAN
++ T field_swapped=AI_BE(field);
++ std::memcpy(data, &field_swapped, sizeof(field)); return sizeof(field);
++#else
+ std::memcpy(data, &AI_BE(field), sizeof(field)); return sizeof(field);
++#endif
+ }
+
+ void Bitmap::WriteHeader(Header& header, IOStream* file) {
+--
+2.1.4
+
--
2.1.4
^ permalink raw reply related [flat|nested] 3+ messages in thread* [Buildroot] [PATCH v1 1/2] assimp: fix bfin compile
2016-01-14 21:44 [Buildroot] [PATCH v1 1/2] assimp: fix bfin compile Peter Seiderer
2016-01-14 21:44 ` [Buildroot] [PATCH v1 2/2] assimp: fix compile for big endian target Peter Seiderer
@ 2016-01-16 13:07 ` Thomas Petazzoni
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2016-01-16 13:07 UTC (permalink / raw)
To: buildroot
Dear Peter Seiderer,
On Thu, 14 Jan 2016 22:44:20 +0100, Peter Seiderer wrote:
> Use proper 64-bit constant for CONVERT_FBX_TIME(time) conversion.
>
> Fixes ([1]):
>
> code/FBXConverter.cpp:2025: error: integer constant is too large for 'long' type
> code/FBXConverter.cpp:2026: error: integer constant is too large for 'long' type
> code/FBXConverter.cpp:2794: error: integer constant is too large for 'long' type
> code/FBXConverter.cpp:2868: error: integer constant is too large for 'long' type
> code/FBXConverter.cpp:2878: error: integer constant is too large for 'long' type
> code/FBXConverter.cpp:2888: error: integer constant is too large for 'long' type
>
> [1] http://autobuild.buildroot.net/results/885/8853b192d16ca7ef769c5352a2df0540a7a2a4fd
>
> Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> ---
> ...x-FBXConverter-use-proper-64-bit-constant.patch | 35 ++++++++++++++++++++++
> 1 file changed, 35 insertions(+)
> create mode 100644 package/assimp/0001-Fix-FBXConverter-use-proper-64-bit-constant.patch
Both patches applied, thanks! For the first patch, please make sure to
submit it upstream.
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-01-16 13:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-14 21:44 [Buildroot] [PATCH v1 1/2] assimp: fix bfin compile Peter Seiderer
2016-01-14 21:44 ` [Buildroot] [PATCH v1 2/2] assimp: fix compile for big endian target Peter Seiderer
2016-01-16 13:07 ` [Buildroot] [PATCH v1 1/2] assimp: fix bfin compile Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox