Bug 1396814 - angelscript: FTBFS on PPC64 / PPC64LE
Summary: angelscript: FTBFS on PPC64 / PPC64LE
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: angelscript
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Igor Gnatenko
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Keywords:
Depends On:
Blocks: PPCTracker
TreeView+ depends on / blocked
 
Reported: 2016-11-20 13:19 UTC by Igor Gnatenko
Modified: 2016-11-25 09:26 UTC (History)
2 users (show)

(edit)
Clone Of:
(edit)
Last Closed: 2016-11-25 09:26:21 UTC


Attachments (Terms of Use)

Description Igor Gnatenko 2016-11-20 13:19:45 UTC
../sdk/angelscript/source/as_callfunc_ppc_64.cpp: In function 'asQWORD CallCDeclFunction(const asDWORD*, const asBYTE*, int, asDWORD, void*)':
../sdk/angelscript/source/as_callfunc_ppc_64.cpp:453:29: error: cast from 'void*' to 'asDWORD {aka unsigned int}' loses precision [-fpermissive]
   ppcArgs[0]     = (asDWORD)retInMemory;
                             ^~~~~~~~~~~
../sdk/angelscript/source/as_callfunc_ppc_64.cpp: In function 'asQWORD CallThisCallFunction(const void*, const asDWORD*, const asBYTE*, int, asDWORD, void*)':
../sdk/angelscript/source/as_callfunc_ppc_64.cpp:485:29: error: cast from 'void*' to 'asDWORD {aka unsigned int}' loses precision [-fpermissive]
   ppcArgs[0]     = (asDWORD)retInMemory;
                             ^~~~~~~~~~~
../sdk/angelscript/source/as_callfunc_ppc_64.cpp:492:41: error: cast from 'const void*' to 'asDWORD {aka unsigned int}' loses precision [-fpermissive]
  ppcArgs[baseArgCount]       = (asDWORD)obj;
                                         ^~~
../sdk/angelscript/source/as_callfunc_ppc_64.cpp: In function 'asQWORD CallThisCallFunction_objLast(const void*, const asDWORD*, const asBYTE*, int, asDWORD, void*)':
../sdk/angelscript/source/as_callfunc_ppc_64.cpp:519:29: error: cast from 'void*' to 'asDWORD {aka unsigned int}' loses precision [-fpermissive]
   ppcArgs[0]     = (asDWORD)retInMemory;
                             ^~~~~~~~~~~
../sdk/angelscript/source/as_callfunc_ppc_64.cpp:535:42: error: cast from 'const void*' to 'asDWORD {aka unsigned int}' loses precision [-fpermissive]
   ppcArgs[argPos]             = (asDWORD)obj;
                                          ^~~
../sdk/angelscript/source/as_callfunc_ppc_64.cpp: In function 'asQWORD CallSystemFunctionNative(asCContext*, asCScriptFunction*, void*, asDWORD*, void*, asQWORD&, void*)':
../sdk/angelscript/source/as_callfunc_ppc_64.cpp:723:66: error: cast from 'void*' to 'asDWORD {aka unsigned int}' loses precision [-fpermissive]
   retQW = CallCDeclFunction( args, argsType, paramSize, (asDWORD)func, retPointer );
                                                                  ^~~~
../sdk/angelscript/source/as_callfunc_ppc_64.cpp:727:73: error: cast from 'void*' to 'asDWORD {aka unsigned int}' loses precision [-fpermissive]
   retQW = CallThisCallFunction(obj, args, argsType, paramSize, (asDWORD)func, retPointer );
                                                                         ^~~~
../sdk/angelscript/source/as_callfunc_ppc_64.cpp:733:85: error: cast from 'void*' to 'asDWORD {aka unsigned int}' loses precision [-fpermissive]
   retQW = CallThisCallFunction( obj, args, argsType, paramSize, vftable[asDWORD(func)>>2], retPointer );
                                                                                     ^
../sdk/angelscript/source/as_callfunc_ppc_64.cpp:737:82: error: cast from 'void*' to 'asDWORD {aka unsigned int}' loses precision [-fpermissive]
   retQW = CallThisCallFunction_objLast( obj, args, argsType, paramSize, (asDWORD)func, retPointer );
                                                                                  ^~~~
../sdk/angelscript/source/as_callfunc_ppc_64.cpp:741:74: error: cast from 'void*' to 'asDWORD {aka unsigned int}' loses precision [-fpermissive]
   retQW = CallThisCallFunction( obj, args, argsType, paramSize, (asDWORD)func, retPointer );
                                                                          ^~~~

Unfortunately I don't know what should be the fix due to my limited knowledge about ppc.

Comment 1 Rafael Fonseca 2016-11-20 13:32:49 UTC
(In reply to Igor Gnatenko from comment #0)
> Unfortunately I don't know what should be the fix due to my limited
> knowledge about ppc.

Angelscript's native ppc calling was written for Playstation PPC 32 bits. It won't work for ppc64. The function calling part needs to be rewritten since it's not even thread safe.

I worked with upstream to make ppc64 work on portability mode. The following change should make angelscript build for that arch:

Index: sdk/angelscript/source/as_config.h
===================================================================
--- sdk/angelscript/source/as_config.h	(revision 2360)
+++ sdk/angelscript/source/as_config.h	(working copy)
@@ -931,6 +931,7 @@
 			#define STDCALL_RETURN_SIMPLE_IN_MEMORY
 			#undef STDCALL
 			#define STDCALL
+			#define AS_MAX_PORTABILITY
 		#else
 			#define AS_MAX_PORTABILITY
 		#endif

Comment 2 Igor Gnatenko 2016-11-20 13:34:45 UTC
(In reply to Rafael Fonseca from comment #1)
> (In reply to Igor Gnatenko from comment #0)
> > Unfortunately I don't know what should be the fix due to my limited
> > knowledge about ppc.
> 
> Angelscript's native ppc calling was written for Playstation PPC 32 bits. It
> won't work for ppc64. The function calling part needs to be rewritten since
> it's not even thread safe.
I thought there is for PPC 32 bits and for 64 bits:
* ../sdk/angelscript/source/as_callfunc_ppc.cpp
* ../sdk/angelscript/source/as_callfunc_ppc_64.cpp
> 
> I worked with upstream to make ppc64 work on portability mode. The following
> change should make angelscript build for that arch:
> 
> Index: sdk/angelscript/source/as_config.h
> ===================================================================
> --- sdk/angelscript/source/as_config.h	(revision 2360)
> +++ sdk/angelscript/source/as_config.h	(working copy)
> @@ -931,6 +931,7 @@
>  			#define STDCALL_RETURN_SIMPLE_IN_MEMORY
>  			#undef STDCALL
>  			#define STDCALL
> +			#define AS_MAX_PORTABILITY
>  		#else
>  			#define AS_MAX_PORTABILITY
>  		#endif
Will try, thanks!


Note You need to log in before you can comment on or make changes to this bug.