--- Log opened Fri Jul 26 00:00:00 2013 | ||
-!- munaafghumran [~mg0950@eduroam-wireless-pat4.nomadic.bris.ac.uk] has joined #mageec | 09:55 | |
-!- jamespallister [~jamespall@it000477.users.bris.ac.uk] has quit [Ping timeout: 245 seconds] | 10:19 | |
-!- munaafghumran [~mg0950@eduroam-wireless-pat4.nomadic.bris.ac.uk] has quit [Ping timeout: 264 seconds] | 10:22 | |
-!- munaafghumran [~mg0950@eduroam-wireless-pat4.nomadic.bris.ac.uk] has joined #mageec | 10:38 | |
-!- munaafghumran [~mg0950@eduroam-wireless-pat4.nomadic.bris.ac.uk] has quit [Ping timeout: 276 seconds] | 12:10 | |
-!- munaafghumran [~mg0950@eduroam-wireless-pat4.nomadic.bris.ac.uk] has joined #mageec | 13:03 | |
-!- jamespallister [~jamespall@it000477.users.bris.ac.uk] has joined #mageec | 13:18 | |
-!- jeremybennett [~jeremy@cust64-dsl91-135-5.idnet.net] has quit [Quit: Leaving] | 13:27 | |
-!- jeremybennett [~jeremy@cust64-dsl91-135-5.idnet.net] has joined #mageec | 13:37 | |
-!- mode/#mageec [+o jeremybennett] by ChanServ | 13:37 | |
AWhetter | amylaar_: I'm having a cross compiler problem and I was wondering if you could help me out? | 13:41 |
---|---|---|
@simoncook | What's the issue? | 13:43 |
AWhetter | The issue is that I have some benchmarks programs that are self verifying. They work on x86 so I know what output the benchmarks should be giving, but on ARM they aren't. It's because various aspects of the program aren't being initialised properly (like arrays and static variables). So If I initialise an array with 'int array[3] = {1,2,3,4};', the values in the array aren't set. Similarly with static variables; 'static int var1 = 10;' is being initialised t | 13:44 |
AWhetter | I've tried with a couple of different ARM compilers and they give different results, but still have the same issue. | 13:45 |
@simoncook | If you have just a file that contains int array[3] = {1,2,3}; does that contain the array | 13:48 |
amylaar_ | If it's initialized data, there might be issues with the linker script or loader/simulator that prevent it from being actually initialized. | 13:55 |
amylaar_ | If the initialization is supposed to happen via constructors, you might not be using the right startup files to get the constructors called. | 13:56 |
amylaar_ | or maybe you are missing a collect2 stage. | 13:56 |
AWhetter | What is a collect2 stage? | 14:02 |
AWhetter | I doubt it's the linker script because jamespallister has used it before | 14:05 |
jamespallister | It may be the linker script - I have had similar issues before | 14:07 |
jamespallister | Although the linker script I used mostly worked | 14:07 |
@simoncook | what is the entry symbol in that linker script | 14:07 |
AWhetter | https://github.com/jpallister/lowpower-framework/blob/master/platformcode/stm32vl_flash.ld | 14:09 |
AWhetter | If I have just 'int array[3] = {1,2,3};' in a program then it works. | 14:13 |
@simoncook | ok so what small example causes it not to work | 14:13 |
AWhetter | For static variables, if I do just 'static int result = 1; int main() { return 0; }' then result is not set properly. | 14:20 |
AWhetter | I'm still testing for an array scenario | 14:20 |
AWhetter | Actually I think it's just statics. All the arrays I'm having problems with are static. | 14:23 |
AWhetter | yep. Doing 'static int results[3] = {1,2,3}; main() { return 0;} ' fails. But so does 'int results[3] = {1,2,3}; int main() { return 0; }' | 14:30 |
amylaar_ | Could it be just optimized away? In your example above, result is not used. | 14:36 |
AWhetter | I don't do any optimizations | 14:37 |
AWhetter | I'll try using it though | 14:37 |
@simoncook | when you say you dont use any optimisations, are you specifying -O0 | 14:38 |
AWhetter | no | 14:38 |
AWhetter | -O0 doesn't help with the 'int results[3] = {1,2,3}; int main() { return 0; }' example | 14:40 |
AWhetter | jamespallister: Could it be something to do with me having to flash everything twice? | 14:41 |
@simoncook | do you have an arm simulator you can run the program on to rule that out | 14:44 |
AWhetter | 'int results[3] = {1,2,3}; int main() { int result = sizeof(results) / results[0]; return result; }' does not work | 14:44 |
AWhetter | simoncook: No but i'll try and find one, and have a go | 14:45 |
AWhetter | simoncook: I can't find any really. There's only a couple from 2007 | 14:58 |
jamespallister | AWhetter - qemu works well as an arm simulator, and you should be able to connect gdb to it | 17:17 |
-!- munaafghumran [~mg0950@eduroam-wireless-pat4.nomadic.bris.ac.uk] has quit [Ping timeout: 268 seconds] | 17:27 | |
-!- munaafghumran [mg0950@cpc10-aztw24-2-0-cust177.aztw.cable.virginmedia.com] has joined #mageec | 17:52 | |
-!- munaafghumran [mg0950@cpc10-aztw24-2-0-cust177.aztw.cable.virginmedia.com] has quit [Client Quit] | 17:52 | |
--- Log closed Sat Jul 27 00:00:06 2013 |
Generated by irclog2html.py 2.12.1 by Marius Gedminas - find it at mg.pov.lt!