Is it possible to compile angelscript by android toolchain
I've added your changes to the SVN (revision 475). I'd appreciate it if you could give it a try to see if it works.
Regards,
Andreas
Regards,
Andreas
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
On the Iphone the as_callfunc_armasm.s does not work. I had to make those changes to get it working on the iphone. I had to remove all the .global at the top and also in the label name i had to remove the @ sign.Once i made those changes everything works. I am able to register function with asCALL_CDECL but cannot register function using asCALL_THISCALL. Well at least that is better than nothing. I just narrow down the problem it looks like even with that file in there. Angelscript is still returning AS_MAX_PORTABILITY back
[Edited by - BornToCode on September 5, 2009 1:53:36 AM]
[Edited by - BornToCode on September 5, 2009 1:53:36 AM]
I was going through the code and i notice that when the code is set up to run on the iphone you are forcing the scripting engine to use MAX_PORTABILITY in the as_config.h
The only problem i am having right now is that. When i include the .s file into my project. If i compile the assembly file it works fine.Once i include the assembly file as part of the as_callfunc_arm.cpp then all hell breaks loose. I am getting function definition does not declare parameters. mov does not have a name type and stray# in program. I am not sure if there is a flag i need to set so it compiles assembly files or not.
Hi WitchLord,
I am darktemplar's friend, sorry for this late reply, for we've got a little busy recently. I am not sure which precompiler flag can be used to detect the Android platform. But I can show the result below by the command you gave me above:
jo@sliao:~/open_src/android$ arm-eabi-cpp -dD fun.c
# 1 "fun.c"
# 1 "<built-in>"
#define __STDC__ 1
#define __STDC_HOSTED__ 1
#define __GNUC__ 4
#define __GNUC_MINOR__ 2
#define __GNUC_PATCHLEVEL__ 1
#define __SIZE_TYPE__ unsigned int
#define __PTRDIFF_TYPE__ int
#define __WCHAR_TYPE__ unsigned int
#define __WINT_TYPE__ unsigned int
#define __INTMAX_TYPE__ long long int
#define __UINTMAX_TYPE__ long long unsigned int
#define __GXX_ABI_VERSION 1002
#define __SCHAR_MAX__ 127
#define __SHRT_MAX__ 32767
#define __INT_MAX__ 2147483647
#define __LONG_MAX__ 2147483647L
#define __LONG_LONG_MAX__ 9223372036854775807LL
#define __WCHAR_MAX__ 4294967295U
#define __CHAR_BIT__ 8
#define __INTMAX_MAX__ 9223372036854775807LL
#define __FLT_EVAL_METHOD__ 0
#define __DEC_EVAL_METHOD__ 2
#define __FLT_RADIX__ 2
#define __FLT_MANT_DIG__ 24
#define __FLT_DIG__ 6
#define __FLT_MIN_EXP__ (-125)
#define __FLT_MIN_10_EXP__ (-37)
#define __FLT_MAX_EXP__ 128
#define __FLT_MAX_10_EXP__ 38
#define __FLT_MAX__ 3.40282347e+38F
#define __FLT_MIN__ 1.17549435e-38F
#define __FLT_EPSILON__ 1.19209290e-7F
#define __FLT_DENORM_MIN__ 1.40129846e-45F
#define __FLT_HAS_DENORM__ 1
#define __FLT_HAS_INFINITY__ 1
#define __FLT_HAS_QUIET_NAN__ 1
#define __DBL_MANT_DIG__ 53
#define __DBL_DIG__ 15
#define __DBL_MIN_EXP__ (-1021)
#define __DBL_MIN_10_EXP__ (-307)
#define __DBL_MAX_EXP__ 1024
#define __DBL_MAX_10_EXP__ 308
#define __DBL_MAX__ 1.7976931348623157e+308
#define __DBL_MIN__ 2.2250738585072014e-308
#define __DBL_EPSILON__ 2.2204460492503131e-16
#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
#define __DBL_HAS_DENORM__ 1
#define __DBL_HAS_INFINITY__ 1
#define __DBL_HAS_QUIET_NAN__ 1
#define __LDBL_MANT_DIG__ 53
#define __LDBL_DIG__ 15
#define __LDBL_MIN_EXP__ (-1021)
#define __LDBL_MIN_10_EXP__ (-307)
#define __LDBL_MAX_EXP__ 1024
#define __LDBL_MAX_10_EXP__ 308
#define __DECIMAL_DIG__ 17
#define __LDBL_MAX__ 1.7976931348623157e+308L
#define __LDBL_MIN__ 2.2250738585072014e-308L
#define __LDBL_EPSILON__ 2.2204460492503131e-16L
#define __LDBL_DENORM_MIN__ 4.9406564584124654e-324L
#define __LDBL_HAS_DENORM__ 1
#define __LDBL_HAS_INFINITY__ 1
#define __LDBL_HAS_QUIET_NAN__ 1
#define __DEC32_MANT_DIG__ 7
#define __DEC32_MIN_EXP__ (-95)
#define __DEC32_MAX_EXP__ 96
#define __DEC32_MIN__ 1E-95DF
#define __DEC32_MAX__ 9.999999E96DF
#define __DEC32_EPSILON__ 1E-6DF
#define __DEC32_DEN__ 0.000001E-95DF
#define __DEC64_MANT_DIG__ 16
#define __DEC64_MIN_EXP__ (-383)
#define __DEC64_MAX_EXP__ 384
#define __DEC64_MIN__ 1E-383DD
#define __DEC64_MAX__ 9.999999999999999E384DD
#define __DEC64_EPSILON__ 1E-15DD
#define __DEC64_DEN__ 0.000000000000001E-383DD
#define __DEC128_MANT_DIG__ 34
#define __DEC128_MIN_EXP__ (-6143)
#define __DEC128_MAX_EXP__ 6144
#define __DEC128_MIN__ 1E-6143DL
#define __DEC128_MAX__ 9.999999999999999999999999999999999E6144DL
#define __DEC128_EPSILON__ 1E-33DL
#define __DEC128_DEN__ 0.000000000000000000000000000000001E-6143DL
#define __REGISTER_PREFIX__
#define __USER_LABEL_PREFIX__
#define __VERSION__ "4.2.1"
#define __GNUC_GNU_INLINE__ 1
#define __NO_INLINE__ 1
#define __FINITE_MATH_ONLY__ 0
#define __CHAR_UNSIGNED__ 1
#define __arm__ 1
#define __APCS_32__ 1
#define __ARMEL__ 1
#define __SOFTFP__ 1
#define __VFP_FP__ 1
#define __THUMB_INTERWORK__ 1
#define __ARM_ARCH_5TE__ 1
#define __ARM_EABI__ 1
#define __GXX_MERGED_TYPEINFO_NAMES 0
#define __ELF__ 1
# 1 "<command-line>"
#define __USES_INITFINI__ 1
# 1 "fun.c"
And the file Android.mk below, which must be put into the directory " ~/open_src/android/external/angelscript/projects/android"
------------------Android.mk------------------
commonSources:= as_callfunc_armasm.S as_arrayobject.cpp as_atomic.cpp as_builder.cpp as_bytecode.cpp as_callfunc.cpp as_callfunc_arm.cpp as_callfunc_mips.cpp as_callfunc_ppc.cpp as_callfunc_ppc_64.cpp as_callfunc_sh4.cpp as_callfunc_x86.cpp as_callfunc_x64_gcc.cpp as_compiler.cpp as_context.cpp as_configgroup.cpp as_datatype.cpp as_generic.cpp as_gc.cpp as_memory.cpp as_module.cpp as_objecttype.cpp as_outputbuffer.cpp as_parser.cpp as_restore.cpp as_scriptcode.cpp as_scriptengine.cpp as_scriptfunction.cpp as_scriptnode.cpp as_scriptobject.cpp as_string.cpp as_string_util.cpp as_thread.cpp as_tokenizer.cpp as_typeinfo.cpp as_variablescope.cpp
LOCAL_PATH:= $(call my-dir)/../../source
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= $(commonSources)
LOCAL_MODULE:= libangelscript
include $(BUILD_STATIC_LIBRARY)
------------------Android.mk------------------
NOTE: The file is "as_callfunc_armasm.S", not "as_callfunc_armasm.s".
I think, you just need to modify the file "as_config.h" to make sure the source file "as_callfunc_arm.cpp" will be compiled and linked, and "as_callfunc_x64_gcc.cpp" must be not.
At last, I just compile the library in Android's way, which just run the command "make libangelscript" under the Android Source's Root directory in Ubuntu. And android's makefile(Android.mk) is easy and intelligent. It would find the Android.mk to compile correctly, as long as the Angelscript source directory is under the Android Source's Root directory.
Do not use the "Android NDK" way to compile angelscript, which seems will just ignore the file "as_callfunc_armasm.S". And I don't know why this would happen.
Best regards.
I am darktemplar's friend, sorry for this late reply, for we've got a little busy recently. I am not sure which precompiler flag can be used to detect the Android platform. But I can show the result below by the command you gave me above:
jo@sliao:~/open_src/android$ arm-eabi-cpp -dD fun.c
# 1 "fun.c"
# 1 "<built-in>"
#define __STDC__ 1
#define __STDC_HOSTED__ 1
#define __GNUC__ 4
#define __GNUC_MINOR__ 2
#define __GNUC_PATCHLEVEL__ 1
#define __SIZE_TYPE__ unsigned int
#define __PTRDIFF_TYPE__ int
#define __WCHAR_TYPE__ unsigned int
#define __WINT_TYPE__ unsigned int
#define __INTMAX_TYPE__ long long int
#define __UINTMAX_TYPE__ long long unsigned int
#define __GXX_ABI_VERSION 1002
#define __SCHAR_MAX__ 127
#define __SHRT_MAX__ 32767
#define __INT_MAX__ 2147483647
#define __LONG_MAX__ 2147483647L
#define __LONG_LONG_MAX__ 9223372036854775807LL
#define __WCHAR_MAX__ 4294967295U
#define __CHAR_BIT__ 8
#define __INTMAX_MAX__ 9223372036854775807LL
#define __FLT_EVAL_METHOD__ 0
#define __DEC_EVAL_METHOD__ 2
#define __FLT_RADIX__ 2
#define __FLT_MANT_DIG__ 24
#define __FLT_DIG__ 6
#define __FLT_MIN_EXP__ (-125)
#define __FLT_MIN_10_EXP__ (-37)
#define __FLT_MAX_EXP__ 128
#define __FLT_MAX_10_EXP__ 38
#define __FLT_MAX__ 3.40282347e+38F
#define __FLT_MIN__ 1.17549435e-38F
#define __FLT_EPSILON__ 1.19209290e-7F
#define __FLT_DENORM_MIN__ 1.40129846e-45F
#define __FLT_HAS_DENORM__ 1
#define __FLT_HAS_INFINITY__ 1
#define __FLT_HAS_QUIET_NAN__ 1
#define __DBL_MANT_DIG__ 53
#define __DBL_DIG__ 15
#define __DBL_MIN_EXP__ (-1021)
#define __DBL_MIN_10_EXP__ (-307)
#define __DBL_MAX_EXP__ 1024
#define __DBL_MAX_10_EXP__ 308
#define __DBL_MAX__ 1.7976931348623157e+308
#define __DBL_MIN__ 2.2250738585072014e-308
#define __DBL_EPSILON__ 2.2204460492503131e-16
#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
#define __DBL_HAS_DENORM__ 1
#define __DBL_HAS_INFINITY__ 1
#define __DBL_HAS_QUIET_NAN__ 1
#define __LDBL_MANT_DIG__ 53
#define __LDBL_DIG__ 15
#define __LDBL_MIN_EXP__ (-1021)
#define __LDBL_MIN_10_EXP__ (-307)
#define __LDBL_MAX_EXP__ 1024
#define __LDBL_MAX_10_EXP__ 308
#define __DECIMAL_DIG__ 17
#define __LDBL_MAX__ 1.7976931348623157e+308L
#define __LDBL_MIN__ 2.2250738585072014e-308L
#define __LDBL_EPSILON__ 2.2204460492503131e-16L
#define __LDBL_DENORM_MIN__ 4.9406564584124654e-324L
#define __LDBL_HAS_DENORM__ 1
#define __LDBL_HAS_INFINITY__ 1
#define __LDBL_HAS_QUIET_NAN__ 1
#define __DEC32_MANT_DIG__ 7
#define __DEC32_MIN_EXP__ (-95)
#define __DEC32_MAX_EXP__ 96
#define __DEC32_MIN__ 1E-95DF
#define __DEC32_MAX__ 9.999999E96DF
#define __DEC32_EPSILON__ 1E-6DF
#define __DEC32_DEN__ 0.000001E-95DF
#define __DEC64_MANT_DIG__ 16
#define __DEC64_MIN_EXP__ (-383)
#define __DEC64_MAX_EXP__ 384
#define __DEC64_MIN__ 1E-383DD
#define __DEC64_MAX__ 9.999999999999999E384DD
#define __DEC64_EPSILON__ 1E-15DD
#define __DEC64_DEN__ 0.000000000000001E-383DD
#define __DEC128_MANT_DIG__ 34
#define __DEC128_MIN_EXP__ (-6143)
#define __DEC128_MAX_EXP__ 6144
#define __DEC128_MIN__ 1E-6143DL
#define __DEC128_MAX__ 9.999999999999999999999999999999999E6144DL
#define __DEC128_EPSILON__ 1E-33DL
#define __DEC128_DEN__ 0.000000000000000000000000000000001E-6143DL
#define __REGISTER_PREFIX__
#define __USER_LABEL_PREFIX__
#define __VERSION__ "4.2.1"
#define __GNUC_GNU_INLINE__ 1
#define __NO_INLINE__ 1
#define __FINITE_MATH_ONLY__ 0
#define __CHAR_UNSIGNED__ 1
#define __arm__ 1
#define __APCS_32__ 1
#define __ARMEL__ 1
#define __SOFTFP__ 1
#define __VFP_FP__ 1
#define __THUMB_INTERWORK__ 1
#define __ARM_ARCH_5TE__ 1
#define __ARM_EABI__ 1
#define __GXX_MERGED_TYPEINFO_NAMES 0
#define __ELF__ 1
# 1 "<command-line>"
#define __USES_INITFINI__ 1
# 1 "fun.c"
And the file Android.mk below, which must be put into the directory " ~/open_src/android/external/angelscript/projects/android"
------------------Android.mk------------------
commonSources:= as_callfunc_armasm.S as_arrayobject.cpp as_atomic.cpp as_builder.cpp as_bytecode.cpp as_callfunc.cpp as_callfunc_arm.cpp as_callfunc_mips.cpp as_callfunc_ppc.cpp as_callfunc_ppc_64.cpp as_callfunc_sh4.cpp as_callfunc_x86.cpp as_callfunc_x64_gcc.cpp as_compiler.cpp as_context.cpp as_configgroup.cpp as_datatype.cpp as_generic.cpp as_gc.cpp as_memory.cpp as_module.cpp as_objecttype.cpp as_outputbuffer.cpp as_parser.cpp as_restore.cpp as_scriptcode.cpp as_scriptengine.cpp as_scriptfunction.cpp as_scriptnode.cpp as_scriptobject.cpp as_string.cpp as_string_util.cpp as_thread.cpp as_tokenizer.cpp as_typeinfo.cpp as_variablescope.cpp
LOCAL_PATH:= $(call my-dir)/../../source
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= $(commonSources)
LOCAL_MODULE:= libangelscript
include $(BUILD_STATIC_LIBRARY)
------------------Android.mk------------------
NOTE: The file is "as_callfunc_armasm.S", not "as_callfunc_armasm.s".
I think, you just need to modify the file "as_config.h" to make sure the source file "as_callfunc_arm.cpp" will be compiled and linked, and "as_callfunc_x64_gcc.cpp" must be not.
At last, I just compile the library in Android's way, which just run the command "make libangelscript" under the Android Source's Root directory in Ubuntu. And android's makefile(Android.mk) is easy and intelligent. It would find the Android.mk to compile correctly, as long as the Angelscript source directory is under the Android Source's Root directory.
Do not use the "Android NDK" way to compile angelscript, which seems will just ignore the file "as_callfunc_armasm.S". And I don't know why this would happen.
Best regards.
Quote:
Original post by BornToCode
I was going through the code and i notice that when the code is set up to run on the iphone you are forcing the scripting engine to use MAX_PORTABILITY in the as_config.h
Yes, I do this so that the library will compile without any errors. Once it is confirmed that it will compile properly with the support for native calling conventions then I'll update the as_config.h.
Apparently there are still some adjustments necessary to get the native calling conventions working on the iPhone, so for now I'll leave it as it is. Thanks for giving it a try though.
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
Quote:
Original post by sliao
I am darktemplar's friend, sorry for this late reply, for we've got a little busy recently. I am not sure which precompiler flag can be used to detect the Android platform.
Hi, sliao!
There is nothing that I can use in the list of pre-defines that you showed me, but I did a search on google and it seems the define 'ANDROID' can be used, so that is what I did in as_config.h.
Quote:
Original post by sliao
And the file Android.mk below, which must be put into the directory " ~/open_src/android/external/angelscript/projects/android"
------------------Android.mk------------------
commonSources:= as_callfunc_armasm.S as_arrayobject.cpp as_atomic.cpp as_builder.cpp as_bytecode.cpp as_callfunc.cpp as_callfunc_arm.cpp as_callfunc_mips.cpp as_callfunc_ppc.cpp as_callfunc_ppc_64.cpp as_callfunc_sh4.cpp as_callfunc_x86.cpp as_callfunc_x64_gcc.cpp as_compiler.cpp as_context.cpp as_configgroup.cpp as_datatype.cpp as_generic.cpp as_gc.cpp as_memory.cpp as_module.cpp as_objecttype.cpp as_outputbuffer.cpp as_parser.cpp as_restore.cpp as_scriptcode.cpp as_scriptengine.cpp as_scriptfunction.cpp as_scriptnode.cpp as_scriptobject.cpp as_string.cpp as_string_util.cpp as_thread.cpp as_tokenizer.cpp as_typeinfo.cpp as_variablescope.cpp
LOCAL_PATH:= $(call my-dir)/../../source
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= $(commonSources)
LOCAL_MODULE:= libangelscript
include $(BUILD_STATIC_LIBRARY)
------------------Android.mk------------------
NOTE: The file is "as_callfunc_armasm.S", not "as_callfunc_armasm.s".
As far I know it shouldn't matter if you use .S or .s. You just need to make sure it is the same in the makefile and the actual file name.
Thanks for the information.
Regards,
Andreas
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
Hi, WitchLord,
I have done some test for what you said above. And I've got some result follow:
1. The macro "ANDROID" can be used to detect the Android platform.
2. It dose matter whether you use .S or .s. When I changed the file name from "as_callfunc_armasm.S" to "as_callfunc_armasm.s", some errors came up as follow, and I do not know why these errors would happen.
jo@sliao:~/open_src/android$ make libangelscript
build/core/product_config.mk:211: WARNING: adding test OTA key
============================================
TARGET_PRODUCT=generic
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=
============================================
build/core/main.mk:180: implicitly installing apns-conf_sdk.xml
build/core/copy_headers.mk:15: warning: overriding commands for target `out/target/product/generic/obj/include/libpv/getactualaacconfig.h'
build/core/copy_headers.mk:15: warning: ignoring old commands for target `out/target/product/generic/obj/include/libpv/getactualaacconfig.h'
target asm: libangelscript <= external/angelscript/source/as_callfunc_armasm.s
external/angelscript/source/as_callfunc_armasm.s: Assembler messages:
external/angelscript/source/as_callfunc_armasm.s:39: Error: junk at end of line, first unrecognized character is `/'
external/angelscript/source/as_callfunc_armasm.s:40: Error: junk at end of line, first unrecognized character is `/'
external/angelscript/source/as_callfunc_armasm.s:41: Error: junk at end of line, first unrecognized character is `/'
external/angelscript/source/as_callfunc_armasm.s:42: Error: junk at end of line, first unrecognized character is `/'
external/angelscript/source/as_callfunc_armasm.s:43: Error: junk at end of line, first unrecognized character is `/'
external/angelscript/source/as_callfunc_armasm.s:44: Error: junk at end of line, first unrecognized character is `/'
external/angelscript/source/as_callfunc_armasm.s:53: Error: junk at end of line, first unrecognized character is `/'
external/angelscript/source/as_callfunc_armasm.s:57: Error: garbage following instruction -- `mov r6,r0////'
external/angelscript/source/as_callfunc_armasm.s:57: Error: bad instruction `arg table'
external/angelscript/source/as_callfunc_armasm.s:58: Error: garbage following instruction -- `movs r7,r1////'
Best regards.
I have done some test for what you said above. And I've got some result follow:
1. The macro "ANDROID" can be used to detect the Android platform.
2. It dose matter whether you use .S or .s. When I changed the file name from "as_callfunc_armasm.S" to "as_callfunc_armasm.s", some errors came up as follow, and I do not know why these errors would happen.
jo@sliao:~/open_src/android$ make libangelscript
build/core/product_config.mk:211: WARNING: adding test OTA key
============================================
TARGET_PRODUCT=generic
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=
============================================
build/core/main.mk:180: implicitly installing apns-conf_sdk.xml
build/core/copy_headers.mk:15: warning: overriding commands for target `out/target/product/generic/obj/include/libpv/getactualaacconfig.h'
build/core/copy_headers.mk:15: warning: ignoring old commands for target `out/target/product/generic/obj/include/libpv/getactualaacconfig.h'
target asm: libangelscript <= external/angelscript/source/as_callfunc_armasm.s
external/angelscript/source/as_callfunc_armasm.s: Assembler messages:
external/angelscript/source/as_callfunc_armasm.s:39: Error: junk at end of line, first unrecognized character is `/'
external/angelscript/source/as_callfunc_armasm.s:40: Error: junk at end of line, first unrecognized character is `/'
external/angelscript/source/as_callfunc_armasm.s:41: Error: junk at end of line, first unrecognized character is `/'
external/angelscript/source/as_callfunc_armasm.s:42: Error: junk at end of line, first unrecognized character is `/'
external/angelscript/source/as_callfunc_armasm.s:43: Error: junk at end of line, first unrecognized character is `/'
external/angelscript/source/as_callfunc_armasm.s:44: Error: junk at end of line, first unrecognized character is `/'
external/angelscript/source/as_callfunc_armasm.s:53: Error: junk at end of line, first unrecognized character is `/'
external/angelscript/source/as_callfunc_armasm.s:57: Error: garbage following instruction -- `mov r6,r0////'
external/angelscript/source/as_callfunc_armasm.s:57: Error: bad instruction `arg table'
external/angelscript/source/as_callfunc_armasm.s:58: Error: garbage following instruction -- `movs r7,r1////'
Best regards.
OK. Thanks for showing me the path. I'll fix the name to use .S.
Also thanks for confirming that ANDROID can be used. I'll also add android to the list of platform with support for native calling conventions. :)
Regards,
Andreas
Also thanks for confirming that ANDROID can be used. I'll also add android to the list of platform with support for native calling conventions. :)
Regards,
Andreas
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement