[hxcpp] Problem when throwing exceptions on Blackberry

77 views
Skip to first unread message

Daniel Uranga

unread,
Jun 26, 2015, 1:17:27 PM6/26/15
to haxe...@googlegroups.com
A simple Openfl project with a main with just this code:

try {
throw "test";
} catch (e : Dynamic) {
trace("catched: " + e);
}

Works ok on the Blackberry Dev Alpha C, but on the blackberry
simulator it crashes printing: "terminate called after throwing an
instance of 'Dynamic'". What could be happening?

Daniel Uranga

unread,
Jun 26, 2015, 3:52:48 PM6/26/15
to haxe...@googlegroups.com
Would like to test on NME if possible, but NME has no Blackberry support afaik.

Hugh

unread,
Jun 29, 2015, 12:29:03 AM6/29/15
to haxe...@googlegroups.com
I have not done any backberry compiling myself, but this looks like the compiler might be missing some kind of "enable exceptions" flag.
I know some targets disable exceptions be default because there are possible performance implications, so the toonchain .xml file might need some tweaks.

Hugh

Daniel Uranga

unread,
Jun 29, 2015, 2:23:53 PM6/29/15
to haxe...@googlegroups.com
Where is "hx::Throw" defined? Maybe implementing some of this:
http://developer.blackberry.com/playbook/native/reference/com.qnx.doc.dinkum/topic/cpp/lib_cpp.html#Exceptions
would help.
> --
> To post to this group haxe...@googlegroups.com
> http://groups.google.com/group/haxelang?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Haxe" group.
> For more options, visit https://groups.google.com/d/optout.

Daniel Uranga

unread,
Jun 29, 2015, 4:31:27 PM6/29/15
to haxe...@googlegroups.com
Trying to use g++ 4.8.3 instead of 4.6.3 I get:

"Error: dyld: Library not loaded:
/usr/darwin/x86_64-apple-darwin/x86_64-apple-darwin/lib/libmpc.2.dylib

Referenced from:
/Applications/Momentics.app/host_10_3_1_12/darwin/x86/usr/bin/../lib/gcc/i486-pc-nto-qnx8.0.0/4.8.3/cc1plus

Reason: image not found

ntox86-g++-4.8.3: internal compiler error: Trace/BPT trap: 5 (program cc1plus)

no stack trace because unwind library not available

Please submit a full bug report,

with preprocessed source if appropriate.

See <http://www.qnx.com> for instructions."

Not sure if that helps.

Daniel Uranga

unread,
Jun 30, 2015, 2:25:33 PM6/30/15
to haxe...@googlegroups.com
I think we need to compile using QCC instead "${EXEPREFIX}-g++", I
have it compiling but cant link.

In blackberry toolchain xml:

<set name="QCC_TARGET" value="gcc_ntox86" />
OR
<set name="QCC_TARGET" value="gcc_ntoarmle" />

...

<compiler id="blackberry" exe="QCC" if="blackberry">
<flag value="-V${QCC_TARGET}" />

...

<linker id="exe" exe="QCC" if="blackberry">
<flag value="-V${QCC_TARGET}" />

But the linker complains:

QCC -oApplicationMain -Vgcc_ntox86 -O2 -s
-L/Applications/Momentics.app//target_10_3_1_995/qnx6/x86/lib
@./obj/blackberry-x86/all_objs -lcpp

/Applications/Momentics.app//host_10_3_1_12/darwin/x86/usr/bin/ntox86-ld:
cannot find
<list of all .o files>
: File name too long
cc: /Applications/Momentics.app//host_10_3_1_12/darwin/x86/usr/bin/ntox86-ld
error 1

Error: error running QCC -oApplicationMain -Vgcc_ntox86 -O2 -s
-L/Applications/Momentics.app//target_10_3_1_995/qnx6/x86/lib
@./obj/blackberry-x86/all_objs

Hugh

unread,
Jul 1, 2015, 12:27:17 AM7/1/15
to haxe...@googlegroups.com
Do you get the same error if you try to compile a small program (ie, not openfl)?
HXCPP can optionally provide the list of obj files in a separate file.  This is controlled via the "fromfile" attribute, which can be set like:
 <fromfile value="-filelist " />

and you can disable it with
 <fromfile value="" />

this is usually disabled by setting GCC_OLD in the xml file.

So you could try one of these lines in your "linker" sections and see if that helps.

Hugh

Daniel Uranga

unread,
Jul 1, 2015, 5:44:14 PM7/1/15
to haxe...@googlegroups.com
Thanks A LOT Hugh. Got our Blackberry Openfl-legacy games compiling
and working ok on Blackberry 10.3

Only last issue is haxe.sys.io.File.getBytes not working properly,
crashes when a file is not found instead of throwing an exception.
Easily worked-around using FileSystem.exists.

The PR: https://github.com/HaxeFoundation/hxcpp/pull/248
Reply all
Reply to author
Forward
0 new messages