#mageec Log for 2013-07-26

--- Log opened Fri Jul 26 00:00:00 2013
-!- munaafghumran [~mg0950@eduroam-wireless-pat4.nomadic.bris.ac.uk] has joined #mageec09: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 #mageec10: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 #mageec13:03
-!- jamespallister [~jamespall@it000477.users.bris.ac.uk] has joined #mageec13: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 #mageec13:37
-!- mode/#mageec [+o jeremybennett] by ChanServ13:37
AWhetteramylaar_: I'm having a cross compiler problem and I was wondering if you could help me out?13:41
@simoncookWhat's the issue?13:43
AWhetterThe 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 t13:44
AWhetterI've tried with a couple of different ARM compilers and they give different results, but still have the same issue.13:45
@simoncookIf you have just a file that contains int array[3] = {1,2,3}; does that contain the array13: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
AWhetterWhat is a collect2 stage?14:02
AWhetterI doubt it's the linker script because jamespallister has used it before14:05
jamespallisterIt may be the linker script - I have had similar issues before14:07
jamespallisterAlthough the linker script I used mostly worked14:07
@simoncookwhat is the entry symbol in that linker script14:07
AWhetterhttps://github.com/jpallister/lowpower-framework/blob/master/platformcode/stm32vl_flash.ld14:09
AWhetterIf I have just 'int array[3] = {1,2,3};' in a program then it works.14:13
@simoncookok so what small example causes it not to work14:13
AWhetterFor static variables, if I do just 'static int result = 1; int main() { return 0; }' then result is not set properly.14:20
AWhetterI'm still testing for an array scenario14:20
AWhetterActually I think it's just statics. All the arrays I'm having problems with are static.14:23
AWhetteryep. 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
AWhetterI don't do any optimizations14:37
AWhetterI'll try using it though14:37
@simoncookwhen you say you dont use any optimisations, are you specifying -O014:38
AWhetterno14:38
AWhetter-O0 doesn't help with the 'int results[3] = {1,2,3}; int main() { return 0; }' example14:40
AWhetterjamespallister: Could it be something to do with me having to flash everything twice?14:41
@simoncookdo you have an arm simulator you can run the program on to rule that out14:44
AWhetter'int results[3] = {1,2,3}; int main() { int result = sizeof(results) / results[0]; return result; }' does not work14:44
AWhettersimoncook: No but i'll try and find one, and have a go14:45
AWhettersimoncook: I can't find any really. There's only a couple from 200714:58
jamespallisterAWhetter - qemu works well as an arm simulator, and you should be able to connect gdb to it17: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 #mageec17: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!