Re: GDC 9 and ARM Cortex-M

2019-07-07 Thread Timo Sintonen via D.gnu
On Sunday, 7 July 2019 at 09:57:33 UTC, Iain Buclaw wrote: On Sun, 7 Jul 2019 at 08:25, Timo Sintonen via D.gnu wrote: My little test program is nearly working now. Some funny things I have found: - When not using -O2 4 extra bytes appear in front of tdata init values. With -O2 they

Re: GDC 9 and ARM Cortex-M

2019-07-06 Thread Timo Sintonen via D.gnu
My little test program is nearly working now. Some funny things I have found: - When not using -O2 4 extra bytes appear in front of tdata init values. With -O2 they disappear. - I have my own calloc where I first allocate a block with malloc and then use memset to zero it. GCC can see this and

Re: GDC 9 and ARM Cortex-M

2019-06-08 Thread Timo Sintonen via D.gnu
On Thursday, 23 May 2019 at 07:19:23 UTC, Iain Buclaw wrote: Given the nature of the segfault your getting, I would expect that you'd get the same problem even if the sources were in D. It is _not_ normal for a module->importedFrom to be NULL or an invalid pointer. Something must have gone

Re: GDC 9 and ARM Cortex-M

2019-05-22 Thread Timo Sintonen via D.gnu
On Monday, 20 May 2019 at 19:12:54 UTC, Iain Buclaw wrote: On Mon, 20 May 2019 at 20:05, Timo Sintonen via D.gnu wrote: On Sunday, 19 May 2019 at 18:58:09 UTC, Iain Buclaw wrote: > > What's the system compiler version you are using? I've > tested with both gcc-9.1 and g

Re: GDC 9 and ARM Cortex-M

2019-05-20 Thread Timo Sintonen via D.gnu
On Sunday, 19 May 2019 at 18:58:09 UTC, Iain Buclaw wrote: What's the system compiler version you are using? I've tested with both gcc-9.1 and gcc-8.3, not able to reproduce. It is in the dump above (even two times ;) GNU D (GCC) version 9.1.0 (arm-eabi) compiled by GNU C version

Re: GDC 9 and ARM Cortex-M

2019-05-19 Thread Timo Sintonen via D.gnu
On Sunday, 19 May 2019 at 14:17:05 UTC, Iain Buclaw wrote: I don't really expect any part of druntime to build on bare metal. Too much depends on libc being available. I have done this several times so I mostly know what I am doing and I do understand that this may also be something in my lo

Re: GDC 9 and ARM Cortex-M

2019-05-19 Thread Timo Sintonen via D.gnu
On Sunday, 19 May 2019 at 10:49:51 UTC, Mike Franklin wrote: On Sunday, 19 May 2019 at 06:54:14 UTC, Timo Sintonen wrote: I am updating my toolset and libraries to GCC/GDC 9.1 release. First impression is that druntime needs more work than with previous versions. Many places to change and even

Re: GDC 9 and ARM Cortex-M

2019-05-19 Thread Timo Sintonen via D.gnu
On Sunday, 19 May 2019 at 09:34:55 UTC, Johannes Pfau wrote: Am Sun, 19 May 2019 06:54:14 + schrieb Timo Sintonen: I am updating my toolset and libraries to GCC/GDC 9.1 release. First impression is that druntime needs more work than with previous versions. Many places to change and even

GDC 9 and ARM Cortex-M

2019-05-18 Thread Timo Sintonen via D.gnu
I am updating my toolset and libraries to GCC/GDC 9.1 release. First impression is that druntime needs more work than with previous versions. Many places to change and even compiler crashes when compiling some files. Before I look further I want to ask if there has been any testing with this

Re: ARM Cortex-M Broken Binaries with -O2 and -O3 (-fschedule-insns)

2017-07-22 Thread Timo Sintonen via D.gnu
On Saturday, 22 July 2017 at 01:11:02 UTC, Mike wrote: On Friday, 21 July 2017 at 23:44:53 UTC, Mike wrote: I'm getting broken binaries with -O2 and -O3. I've nailed the culprit down to -fschedule-insns (i.e. if I add -fno-schedule-insns to -O2 or -O3, the binary works fine). I disassembled

Re: Accessing peripheral registers - the next version

2016-08-31 Thread Timo Sintonen via D.gnu
On Wednesday, 31 August 2016 at 10:12:21 UTC, Johannes Pfau wrote: There was @disable this(this) This prevents to use a location as argument to a function, like: print(timer.count). Is there any reason to have this line or not? I guess timer is a (enum) pointer to a struct and count is a Vo

Re: Accessing peripheral registers - the next version

2016-08-31 Thread Timo Sintonen via D.gnu
On Wednesday, 31 August 2016 at 10:12:21 UTC, Johannes Pfau wrote: Am Wed, 31 Aug 2016 09:07:49 + schrieb Timo Sintonen : The original functions had force_inline attribute. The compiler said it can not inline because the body is not available. Is this because they are templates or is

Re: Accessing peripheral registers - the next version

2016-08-31 Thread Timo Sintonen via D.gnu
Some thing that I have noticed in the original struct definition struct Volatile(T) { T raw; nothrow: @disable this(this); A opAssign(A)(A a) { volatileStore(&raw, a); return a; } T load() @property { return volatileLoad(&raw); } alias load this; void opOpAssi

Re: Accessing peripheral registers - the next version

2016-08-31 Thread Timo Sintonen via D.gnu
On Sunday, 28 August 2016 at 13:26:37 UTC, Johannes Pfau wrote: Am Sun, 28 Aug 2016 09:28:24 + schrieb Timo Sintonen : I just translated my sample program and everything seems to work in my limited tests. Here is a simplified example of an uart: alias uarttype = uartreg*; enum uarttype

Re: Accessing peripheral registers - the next version

2016-08-28 Thread Timo Sintonen via D.gnu
On Sunday, 28 August 2016 at 08:34:15 UTC, Johannes Pfau wrote: Am Sat, 27 Aug 2016 08:05:08 + schrieb Timo Sintonen : The Volatile!T code you posted does not show how to map such a Volatile!T instance to a certain address. The code in 2) could be placed into a @property, but some stuff

Accessing peripheral registers - the next version

2016-08-27 Thread Timo Sintonen via D.gnu
I updated my system to gdc master. As expected, my program that uses shared variables to accress hardware registers did not work any more. I took the old Volatile datatype we made some years ago and the modified version is something like this: struct Volatile(T) { T raw; nothrow:

Re: How to say there is a struct of this type at this memory location?

2016-03-07 Thread Timo Sintonen via D.gnu
On Monday, 7 March 2016 at 21:12:02 UTC, Taylor Hillegeist wrote: I'm working on getting my FRDM-kl25z board up and running with d. whatever works at this point. The issue is when i try to specify hey this struct is over here! using: __gshared SIM_MemMap * SIMY = cast(SIM_MemMap *) 0

Re: versions for thumb and thumb-2 instruction sets

2016-02-07 Thread Timo Sintonen via D.gnu
On Saturday, 6 February 2016 at 21:58:17 UTC, Dan Olson wrote: Hi Iain, Johannes. I'm asking here because I don't expect anybody else is playing with thumb instructions. Both GDC and LDC have version ARM_Thumb defined for original thumb (call it thumb-1) and thumb-2. But there is no way to

Re: (Probably trivial) arm-none-eabi-gdc building problem

2015-05-30 Thread Timo Sintonen via D.gnu
On Saturday, 30 May 2015 at 16:55:14 UTC, denizzzka wrote: Hi! I am tried to use step-by-step instructions from wiki (http://wiki.dlang.org/Bare_Metal_ARM_Cortex-M_GDC_Cross_Compiler) to build toolchain on Debian GNU/Linux 8 and got this error after execute "make -j4 all-target-libgcc": I

Build script for a cross compiler

2015-04-27 Thread Timo Sintonen via D.gnu
People have been asking a build script Here is one I have written. This was originally ment to build gdc in a virtual machine but I did not get this to work in a vm. There were always missing something or some issues like 32/64 bit mismatch. This script gets the current head of gdc, loads the req

Re: Embedded D, top down?

2015-02-21 Thread Timo Sintonen via D.gnu
On Friday, 20 February 2015 at 19:51:16 UTC, Henri Sundelin wrote: Hi Timo, Thanks for the info! I looked the minlibd, the biggest question for me is whether it targets too small devices, taking out the most of phobos functionality in the process? What are your ultimate goals? While my pers

Re: Using static immutable Exceptions (or other way for NON-GC exceptions)

2015-02-18 Thread Timo Sintonen via D.gnu
On Wednesday, 18 February 2015 at 13:07:12 UTC, Iain Buclaw wrote: On 18 February 2015 at 12:34, Timo Sintonen via D.gnu wrote: On Wednesday, 18 February 2015 at 12:12:04 UTC, Iain Buclaw wrote: You can't throw without a GC allocation currently. I'm open to suggestions a

Re: Using static immutable Exceptions (or other way for NON-GC exceptions)

2015-02-18 Thread Timo Sintonen via D.gnu
On Wednesday, 18 February 2015 at 12:12:04 UTC, Iain Buclaw wrote: You can't throw without a GC allocation currently. I'm open to suggestions and patches welcome. See here: https://github.com/D-Programming-GDC/GDC/blob/master/libphobos/libdruntime/gcc/deh.d#L152 Iain. I was just goimg

Re: Embedded D, top down?

2015-02-18 Thread Timo Sintonen via D.gnu
On Tuesday, 17 February 2015 at 22:07:38 UTC, Henri Sundelin wrote: Hello folks, I'm trying to evaluate a possibility to use D for an embedded case. We want to use the same application base from the high end to the low end. In this case high end means full Linux server, and low end must be a

compiling multilib for arm cortex

2015-01-18 Thread Timo Sintonen via D.gnu
I have been trying to compile multilib for cortex-m0/m3/m4 I added this to gcc/config/arm/t-arm-elf: MULTILIB_OPTIONS += mcpu=cortex-m0/mcpu=cortex-m3/mcpu=cortex-m4 mfloat-abi=hard mfpu=fpv4-sp-d16 MULTILIB_DIRNAMES += cortex-m0 cortex-m3 cortex-m4 MULTILIB_REQUIRED += mcpu=cortex-m0 MULTIL

Can I disable c++ when compiling gdc?

2015-01-16 Thread Timo Sintonen via D.gnu
This came to my mind while reading the other list. Compiling gdc automatically enables compiling c++. This is natural because gdc is made with c++. When making a cross compiler only host c++ is needed, not the target one. C++ for the target is still built and it also requires target libc (or ne

Re: Object file questions

2014-08-18 Thread Timo Sintonen via D.gnu
On Sunday, 17 August 2014 at 14:47:57 UTC, Johannes Pfau wrote: Am Sun, 17 Aug 2014 14:36:53 + schrieb "Timo Sintonen" : But the register corruption is still an issue. My tls function clearly uses r3 and does not save it. Johannes, do you know the arm calling system? Is it

Re: Object file questions

2014-08-17 Thread Timo Sintonen via D.gnu
On Sunday, 17 August 2014 at 14:47:57 UTC, Johannes Pfau wrote: Am Sun, 17 Aug 2014 14:36:53 + schrieb "Timo Sintonen" : On Sunday, 17 August 2014 at 13:59:03 UTC, Artur Skawina via D.gnu wrote: > On 08/17/14 15:44, Timo Sintonen via D.gnu wrote: > >> I am compiling

Re: Object file questions

2014-08-17 Thread Timo Sintonen via D.gnu
On Sunday, 17 August 2014 at 13:59:03 UTC, Artur Skawina via D.gnu wrote: On 08/17/14 15:44, Timo Sintonen via D.gnu wrote: I am compiling for arm and I am sorry I misinterpreted the optimized code. Actually the code is correct but it still does not work. The problem is that the call to get

Re: Object file questions

2014-08-17 Thread Timo Sintonen via D.gnu
On Sunday, 17 August 2014 at 11:35:33 UTC, Artur Skawina via D.gnu wrote: It works for me: import volat; // module w/ the last Volatile(T) implementation. struct uartreg { Volatile!int sr; Volatile!int dr; Volatile!int brr; Volatile!int cr1; Volatile

Re: Object file questions

2014-08-17 Thread Timo Sintonen via D.gnu
On Sunday, 17 August 2014 at 07:57:15 UTC, Timo Sintonen wrote: This seems to work. This does not work with member functions struct uartreg { Volatile!int sr; Volatile!int dr; Volatile!int brr; Volatile!int cr1; Volatile!int cr2; Volatile!int cr3; Volatile!int

Re: Object file questions

2014-08-17 Thread Timo Sintonen via D.gnu
On Saturday, 16 August 2014 at 20:01:06 UTC, Artur Skawina via D.gnu wrote: On 08/16/14 20:40, Artur Skawina wrote: How can I use this with struct members ? One possibility would be to declare all members as `Volatile!...`, or I did not like that required dereference in the previous versio

Re: Object file questions

2014-08-16 Thread Timo Sintonen via D.gnu
On Saturday, 16 August 2014 at 09:59:03 UTC, Artur Skawina via D.gnu wrote: On 08/16/14 09:33, Johannes Pfau via D.gnu wrote: https://github.com/D-Programming-GDC/GDC/pull/82 [Only noticed this accidentally; using a mailing list instead of some web forum would increase visibility...] enum va

Re: Object file questions

2014-08-16 Thread Timo Sintonen via D.gnu
On Saturday, 16 August 2014 at 07:36:07 UTC, Johannes Pfau wrote: Iain recently pushed a commit to put zero initializers into bss, so that's intentional: http://bugzilla.gdcproject.org/show_bug.cgi?id=139 But I understand your point that it should be in rodata instead, you'll have to discuss

Re: Object file questions

2014-08-16 Thread Timo Sintonen via D.gnu
On Thursday, 14 August 2014 at 19:05:46 UTC, Johannes Pfau wrote: Am Thu, 14 Aug 2014 17:53:32 + schrieb "Timo Sintonen" : On Thursday, 14 August 2014 at 17:13:23 UTC, Johannes Pfau wrote: > Am Thu, 14 Aug 2014 10:07:04 +0000 > schrieb "Timo Sintonen" : > >

Re: Object file questions

2014-08-14 Thread Timo Sintonen via D.gnu
On Thursday, 14 August 2014 at 17:13:23 UTC, Johannes Pfau wrote: Am Thu, 14 Aug 2014 10:07:04 + schrieb "Timo Sintonen" : I have been looking at object files to see if I can reduce the memory usage for minimum systems. There are two things I have noticed: 1. In the data seg

Object file questions

2014-08-14 Thread Timo Sintonen via D.gnu
I have been looking at object files to see if I can reduce the memory usage for minimum systems. There are two things I have noticed: 1. In the data segment there is some source code as ascii text from a template in gcc/atomics.d . This is in the actual data segment and not in debug info segm

Re: Porting gdc to a new target (Nios2) any guides out there?

2014-07-22 Thread Timo Sintonen via D.gnu
On Wednesday, 23 July 2014 at 05:41:53 UTC, Iain Buclaw via D.gnu wrote: On 23 Jul 2014 06:25, "Timo Sintonen via D.gnu" First forget D and try to build a C only toolset. If this works then build c++ I'd skip step one and just go straight to building C++ first. Given that g

Re: Porting gdc to a new target (Nios2) any guides out there?

2014-07-22 Thread Timo Sintonen via D.gnu
On Tuesday, 22 July 2014 at 22:13:15 UTC, John Carter wrote: So for various reasons I see potential to use a gdc on an Altera FPGA with a nios2 softcore running embedded linux. Given gdc on linux exists, gdc arm port exists, gcc nios2 back end exists Leaves me wondering... how hard could

Re: [Bug 126] Add support for attribute to mark data as volatile.

2014-07-15 Thread Timo Sintonen via D.gnu
On Tuesday, 24 June 2014 at 14:14:18 UTC, Johannes Pfau wrote: I think we should at least try to bring this to the main newsgroup, I told you this is not going to work. The decision seems to be made even when the conversion is still going on. Lets just make this into gdc so we can continue t

Re: Building the arm-linux-gnueabi target

2014-07-13 Thread Timo Sintonen via D.gnu
On Sunday, 13 July 2014 at 11:17:29 UTC, Joseph Rushton Wakeling via D.gnu wrote: Yes, I'm interested principally in cross-compiling, both for linux-on-ARM and bare-metal ARM. You may also have a look at my minlibd: https://bitbucket.org/timosi/minlibd There is a minimun libdruntime suitab

Re: DFLAGS and gdc

2014-07-10 Thread Timo Sintonen via D.gnu
On Thursday, 10 July 2014 at 23:54:08 UTC, Joseph Rushton Wakeling via D.gnu wrote: On 08/07/14 17:58, Iain Buclaw via D.gnu wrote: My stance at the moment is that DFLAGS should be recognised by the build tool, not the compiler. I wonder if John's specific concern may be to do with how dmd u

Re: Build problem

2014-06-29 Thread Timo Sintonen via D.gnu
On Sunday, 29 June 2014 at 08:21:34 UTC, Iain Buclaw via D.gnu wrote: On 29 June 2014 08:16, Timo Sintonen via D.gnu wrote: I tried to build my cross compiler from current head. I got "lvalue required as left operand of assignment" in d-objfile.cc lines 1717 and 2107. Hi Timo,

Build problem

2014-06-29 Thread Timo Sintonen via D.gnu
I tried to build my cross compiler from current head. I got "lvalue required as left operand of assignment" in d-objfile.cc lines 1717 and 2107.

Re: [Bug 126] Add support for attribute to mark data as volatile.

2014-06-24 Thread Timo Sintonen via D.gnu
To keep this thread going, I had a quick look at the reference material of the dip and picked some thoughts. In some languages volatile has a stronger meaning, like guaranteeing an atomic access. In some languages it may not guarantee anything. In this proposal volatile is only for optimizat

Re: [Bug 126] Add support for attribute to mark data as volatile.

2014-06-01 Thread Timo Sintonen via D.gnu
I did not yet read the dip but here are some of my thoughts: At the old days peripherals were simple. An uart might have a control register, a status register and a data register, 8 bit each. It just did not matter how they were accessed. Now a peripheral like usb or ethernet may have tens of

Re: Exceptions in ARM

2014-03-09 Thread Timo Sintonen
Now I got the exceptions to work. I have not been able to find how to control the libgcc build process. The configure script seems not to know that I give different defaults for the compiler in --with switches. Configure still assumes the compiler defaults arm mode although it is in thumb mod

Re: ICE due to unsupported target

2014-03-08 Thread Timo Sintonen
On Saturday, 8 March 2014 at 09:12:49 UTC, Mike wrote: On Saturday, 8 March 2014 at 08:09:29 UTC, Timo Sintonen wrote: Why do you need synchronized? Are you building some kind of multithreading library? I don't need it yet. I'm just exploring features of D and trying to le

Re: Exceptions in ARM

2014-03-08 Thread Timo Sintonen
On Friday, 7 March 2014 at 18:41:35 UTC, Johannes Pfau wrote: > To make sure that libgcc > is built correctly for Cortex-M4 you have to specify > "--with-arch=armv7e-m --with-cpu=cortex-m4 --with-mode=thumb > --with-tune=" when configuring gcc/gdc. > Gcc build fails with these. It will take time

Re: ICE due to unsupported target

2014-03-08 Thread Timo Sintonen
On Saturday, 8 March 2014 at 07:52:10 UTC, Mike wrote: I'm getting an ICE in d-target.cc/critsecsize when I create a synchronized block. Looking at the source code, it's pretty obvious why - my target (ARM Cortex-M bare metal) isn't any of the ones listed: if (global.params.isWindows) ...

Re: Exceptions in ARM

2014-03-02 Thread Timo Sintonen
On Sunday, 2 March 2014 at 15:36:01 UTC, Johannes Pfau wrote: To make sure that libgcc is built correctly for Cortex-M4 you have to specify "--with-arch=armv7e-m --with-cpu=cortex-m4 --with-mode=thumb --with-tune=" when configuring gcc/gdc. (And I don't see these flags mentioned in https://bitb

Re: Exceptions in ARM

2014-03-02 Thread Timo Sintonen
On Saturday, 1 March 2014 at 12:53:14 UTC, Johannes Pfau wrote: However, someone also had this problem on this german site: http://www.mikrocontroller.net/topic/312956 and the solution was that -mcpu alone was not good enough, he had to specify -march flags as well so please double-check your

Re: Exceptions in ARM

2014-03-01 Thread Timo Sintonen
On Saturday, 1 March 2014 at 10:49:57 UTC, Johannes Pfau wrote: On Saturday, 1 March 2014 at 09:24:40 UTC, Mike wrote: On Saturday, 1 March 2014 at 08:56:26 UTC, Timo Sintonen wrote: There is nothing interesting in the assembly, only this wrong call. This form of instruction is just missing in

Re: Exceptions in ARM

2014-03-01 Thread Timo Sintonen
On Saturday, 1 March 2014 at 07:53:45 UTC, Mike wrote: On Saturday, 1 March 2014 at 07:26:16 UTC, Timo Sintonen wrote: I investigated this a little. It seems that the processor gets a fault interrupt when calling _Unwind_RaiseException in _d_throw. The status bits indicate an invalid

Re: Exceptions in ARM

2014-02-28 Thread Timo Sintonen
On Saturday, 1 March 2014 at 02:59:37 UTC, Mike wrote: On Friday, 28 February 2014 at 21:18:05 UTC, Timo Sintonen wrote: On Wednesday, 8 January 2014 at 19:13:36 UTC, Timo Sintonen wrote: On Wednesday, 8 January 2014 at 15:52:25 UTC, Johannes Pfau wrote: Stupid question, but are C

Re: Exceptions in ARM

2014-02-28 Thread Timo Sintonen
On Wednesday, 8 January 2014 at 19:13:36 UTC, Timo Sintonen wrote: On Wednesday, 8 January 2014 at 15:52:25 UTC, Johannes Pfau wrote: Stupid question, but are C++ exceptions working for you? I think we don't change anything inthe compiler related to exception handling, so if C++ worke

Re: GDC Build Errors

2014-02-01 Thread Timo Sintonen
On Saturday, 1 February 2014 at 02:30:30 UTC, Mike wrote: I'm trying to build a GDC cross-compiler for arm-none-eabi. I get usable binaries, but my procedure always ends in the following: /usr/bin/install -c -m 644 unwind.h /home/mike/gdc-arm-none-eabi-test/lib/gcc/arm-none-eabi/4.8.2/include

Re: Exceptions in ARM

2014-01-08 Thread Timo Sintonen
On Wednesday, 8 January 2014 at 15:52:25 UTC, Johannes Pfau wrote: Stupid question, but are C++ exceptions working for you? I think we don't change anything inthe compiler related to exception handling, so if C++ worked and D didn't it could only be a problem with the runtime code? I have

Re: Exceptions in ARM

2014-01-08 Thread Timo Sintonen
On Sunday, 5 January 2014 at 10:21:36 UTC, Timo Sintonen wrote: On Sunday, 5 January 2014 at 10:06:48 UTC, Johannes Pfau wrote: I should really start pushing my local ARM changes upstream. Here's a fix for the EABI unwinder: https://github.com/jpf91/GDC/c

Re: Exceptions in ARM

2014-01-05 Thread Timo Sintonen
On Sunday, 5 January 2014 at 10:06:48 UTC, Johannes Pfau wrote: I should really start pushing my local ARM changes upstream. Here's a fix for the EABI unwinder: https://github.com/jpf91/GDC/commit/262e432e95cbe31a6764cd337f64022a56011eda IIRC I also thought the code in gcc/deh.d wasn't correct

Re: Exceptions in ARM

2014-01-05 Thread Timo Sintonen
On Thursday, 2 January 2014 at 06:54:18 UTC, Timo Sintonen wrote: I have fond one thing that confuses me. I have defined ARM_EABI_UNWINDER but gcc/deh.d has checks for GNU_ARM_EABI_Unwinder. Is this what I should have? When using this I get an error in line 116: static assert ( 8 == 4 ) is

Re: Compiler-generated implicit symbols and --gc-sections

2014-01-04 Thread Timo Sintonen
On Friday, 3 January 2014 at 18:14:58 UTC, Mike wrote: I ran into a problem recently that resulted in a segmentation fault in my program whenever I called a member function of one of my classes. Sometimes it occurred and sometimes it didn't depending on the order of certain things in my code.

Re: Exceptions in ARM

2014-01-01 Thread Timo Sintonen
I have fond one thing that confuses me. I have defined ARM_EABI_UNWINDER but gcc/deh.d has checks for GNU_ARM_EABI_Unwinder. Is this what I should have? When using this I get an error in line 116: static assert ( 8 == 4 ) is false.

Re: Exceptions in ARM

2014-01-01 Thread Timo Sintonen
On Wednesday, 1 January 2014 at 15:19:01 UTC, Iain Buclaw wrote: On 1 Jan 2014 14:05, "Timo Sintonen" wrote: I started to update minlibd with gdc head from last saturday. While testing if exceptions work, the program just stops and does not reach catch or abort. Before inv

Exceptions in ARM

2014-01-01 Thread Timo Sintonen
I started to update minlibd with gdc head from last saturday. While testing if exceptions work, the program just stops and does not reach catch or abort. Before investigating further, I want to ask the status of arm exceptions: are they known to work, known not to work or is the status just u

Re: __emutls_v & __emutls_t

2013-12-22 Thread Timo Sintonen
On Sunday, 22 December 2013 at 10:51:19 UTC, Mike wrote: On Sunday, 22 December 2013 at 10:00:28 UTC, Johannes Pfau wrote: If I declare global variables in D as... __gshared int GlobalDataVar = 2; __gshared int GlobalBssVar; ... these get put in .data and .bss respectively, and I know what to

Re: __emutls_v & __emutls_t

2013-12-22 Thread Timo Sintonen
On Sunday, 22 December 2013 at 02:01:15 UTC, Mike wrote: I need to make a startup procedure for my ARM Cortex-M platform. In C/C++ this includs copying the .data segment to RAM and initializing the .bss segment to 0. If I declare global variables in D as... __gshared int GlobalDataVar = 2; _

Re: ARM Cortex-M - Static array dyamically allocated

2013-12-21 Thread Timo Sintonen
On Saturday, 21 December 2013 at 09:35:33 UTC, Mike wrote: On Saturday, 21 December 2013 at 08:51:11 UTC, Johannes Pfau wrote: Am Sat, 21 Dec 2013 02:58:49 +0100 schrieb "Mike" : On Saturday, 21 December 2013 at 00:07:17 UTC, Mike wrote: I should probably add that if I remove my object.d file

Re: ARM Cortex-M - Static array dyamically allocated

2013-12-20 Thread Timo Sintonen
On Friday, 20 December 2013 at 19:14:43 UTC, Timo Sintonen wrote: On Friday, 20 December 2013 at 15:03:52 UTC, Mike wrote: Two questions: 1) These are defined in my object.d, so why is it saying only object.d can define these types? 2) Why is there exactly two instances of each error message

Re: ARM Cortex-M - Static array dyamically allocated

2013-12-20 Thread Timo Sintonen
On Friday, 20 December 2013 at 15:03:52 UTC, Mike wrote: Two questions: 1) These are defined in my object.d, so why is it saying only object.d can define these types? 2) Why is there exactly two instances of each error message? Again, here's my build line: arm-none-eabi-gdc -march=armv7e-m -m

Re: Build problem with latest git head

2013-11-10 Thread Timo Sintonen
On Sunday, 10 November 2013 at 09:20:11 UTC, Johannes Pfau wrote: In case you need a workaround right now: shared struct Register //Also working without shared here { size_t a; } shared(Register*) reg = cast(shared(Register*))0xFFDDCCAA; void main()

Re: Build problem with latest git head

2013-11-08 Thread Timo Sintonen
Now returning to my original problem. I tested various loops and it seems that write to a variable is not volatile even if the variable is marked shared. If I write to a variable several times in a loop, all but the last write are optimized out. The only write is put after the loop. Read work

Re: Build problem with latest git head

2013-11-04 Thread Timo Sintonen
On Monday, 4 November 2013 at 11:21:03 UTC, Iain Buclaw wrote: For the time being, use gcc-4.9-20131013.tar.bz2 snapshot - that is the last build I've done here (currently all my time is being used up on D 2.064). Feel free to send patches though (see this two line change here: http://gcc.g

Build problem with latest git head

2013-11-04 Thread Timo Sintonen
I tried to build gdc with the latest heads of gcc and gdc Lots of warnings along the build and the it stops here: ../../gcc/gcc/d/d-objfile.cc:2031:52: error: no matching function for call to 'symtab_node::symtab_node(cgraph_node*&)' symtab_add_to_same_comdat_group ((symtab_node) thunk_nod

Re: internal compiler error when compiling a class

2013-08-31 Thread Timo Sintonen
On Thursday, 22 August 2013 at 19:19:08 UTC, Timo Sintonen wrote: On Thursday, 22 August 2013 at 15:11:15 UTC, Johannes Pfau wrote: Am Tue, 20 Aug 2013 18:40:09 +0200 schrieb "Timo Sintonen" : I just updated my arm cross compiler to the latest head of gdc and gcc. Now I get this

Re: internal compiler error when compiling a class

2013-08-22 Thread Timo Sintonen
On Thursday, 22 August 2013 at 15:11:15 UTC, Johannes Pfau wrote: Am Tue, 20 Aug 2013 18:40:09 +0200 schrieb "Timo Sintonen" : I just updated my arm cross compiler to the latest head of gdc and gcc. Now I get this every time when I try to compile a file that has a class: interna

internal compiler error when compiling a class

2013-08-20 Thread Timo Sintonen
I just updated my arm cross compiler to the latest head of gdc and gcc. Now I get this every time when I try to compile a file that has a class: internal compiler error: Segmentation fault 0x99b39f crash_signal ../../gcc/gcc/toplev.c:335 0x8413ec tree_check ../../gcc/gcc/tree.h:

Re: How minimal I can go using D on GDC?

2013-05-13 Thread Timo Sintonen
On Monday, 13 May 2013 at 20:21:55 UTC, Mr. Anonymous wrote: Will this minimum runtime environment work on Windows, too? I'd like to try that out. I see no reason why this would not work. The only thing that is needed is a working cross compiler. I have not heard of gdc cross compilers for

Re: How minimal I can go using D on GDC?

2013-05-12 Thread Timo Sintonen
On Sunday, 12 May 2013 at 15:27:04 UTC, Iain Buclaw wrote: On 12 May 2013 15:41, Rel wrote: Benjamin Thaut, yes I know. but here is an example, if I add a class to the code like that: module main; extern (C) void* _Dmodule_ref = null; extern (C) void printf(const char*, ...); extern (C) v

Re: Bare metal D

2013-05-05 Thread Timo Sintonen
On Sunday, 5 May 2013 at 10:56:53 UTC, Iain Buclaw wrote: On May 4, 2013 6:40 PM, "teachop" wrote: Looking for help / advice getting D running in an embedded system. The compiler building for gdc and newlib went smoothly (mostly) thanks to this web page: http://gdcproject.org/wiki/Cross%2

gcc 4.9

2013-03-17 Thread Timo Sintonen
Gcc head has turned to version 4.9. This causes the setup-gcc script in gdc to fail. In addition, the version number string in gcc is no more in gcc/version.c but in gcc/BASE-VER. Setup-gcc still works when manually forced to version 4.8.

Re: Current GDC experience and questions

2013-03-08 Thread Timo Sintonen
On Friday, 8 March 2013 at 18:16:18 UTC, Iain Buclaw wrote: > > Yet not all attributes that GCC offers actually make sense > > to have > > in D. We certainly need to have a review of each one and > > discuss > > what is most important to have. Also defining our own > > unique > > attributes

Re: D for embedded system

2013-01-22 Thread Timo Sintonen
On Tuesday, 22 January 2013 at 17:02:58 UTC, Freddie Chopin wrote: Any chance for adding any example that could be used to verify that everything works correctly? It does not matter for which microcontroller it would be, just anything for a start (; I will add something when I have time. I ha

Re: D for embedded system

2013-01-22 Thread Timo Sintonen
By request I have put my minimum library work visible at bitbucket.org/timosi/minlibd. It contains now the library. I hope it will contain other things for program development too, like makefiles and linker scripts and of course, documentation.

Re: D for embedded system

2013-01-09 Thread Timo Sintonen
On Wednesday, 9 January 2013 at 08:31:01 UTC, Freddie Chopin wrote: but actually I was hoping I could "drop" GDC into a linaro distribution of ARM bare-metal toolchain - launchpad.net/gcc-arm-embedded - it's a 4.7.x version, I don't know how big problem that is... So I haven't yet tried com

Re: D for embedded system

2013-01-08 Thread Timo Sintonen
On Tuesday, 8 January 2013 at 20:42:07 UTC, Freddie Chopin wrote: You should definetely post that to github or somewhere (dropbox, ...)! I'd be really interested to see the files (and maybe some details about strange things you need to do to get whole toolchain compiled), but I cannot see your

Re: D for embedded system

2013-01-08 Thread Timo Sintonen
There are hundreds of ARM processors from several vendors from megahertz to gigahertz and from kilobytes to gigabytes. When we talk about ARMs it should be good to mention what kind of ARM we are using. My interest is stm32f4 but everything I have done should be useful in the whole cortex-m s

While optimization and gshared data

2012-12-06 Thread Timo Sintonen
I have some memory mapped hardware in my arm controller. I define struct regs to describe the registers and __gshared regs* p to point to the actual address. I have a loop like: while (p.status==0) {...} The body of the loop does not touch status and so gdc optimizer does not evaluate status a

Re: D for embedded system

2012-11-18 Thread Timo Sintonen
On Saturday, 17 November 2012 at 23:08:04 UTC, maarten van damme wrote: Why is so much built in to druntime? creating classes, AA's, Is it normal? does c++ do the same thing? Why wasn't opted for making opIndex overloadable with other objects so AA's could be moved out of druntime and in p

Re: iphone + D, getting closer!

2012-11-12 Thread Timo Sintonen
On Monday, 12 November 2012 at 08:31:32 UTC, Johannes Pfau wrote: Am Sun, 11 Nov 2012 17:38:08 -0800 schrieb Dan Olson : Even a simple D module with just a extern(C) function depends on something in druntime, so I have to get part of that to build first. _Dmodule_ref? You can just decla

Re: D for embedded system

2012-11-11 Thread Timo Sintonen
I have been able to make a minimum library, link it with my test program and run the program in my arm cortex-m4 controller board. Some features are disabled and many features are still untested. The library does not yet have threads and memory management is done with gcstub. My test program su

Re: GDC 4.7 build problems on Ubuntu 12.10

2012-11-05 Thread Timo Sintonen
On Monday, 5 November 2012 at 10:33:40 UTC, Joseph Rushton Wakeling wrote: This is configured with ../gcc-4.7-4.7.2/src/configure --enable-languages=d --disable-multilib --disable-libgomp --disable-libmudflap --disable-libquadmath --disable-libquadmath-support --disable-lto --disable-nls

Re: D for embedded system

2012-11-03 Thread Timo Sintonen
I have started to make a minimum libdruntime. First I compiled object and now I am adding files one by one when needed. The compiler generates lots of library calls. So far I have found these flags to get the code smaller and to reduce library calls: -fno-assert -fno-invariants and -fno-bouns-ch

Re: GDC 4.7 build problems on Ubuntu 12.10

2012-10-26 Thread Timo Sintonen
Making gcc with more than -j2 always fails for me at some random point. The process generates lots of config files and libraries that are needed later in a compilation. These files may not be in dependencies. Maybe that would be too complicated, the files should be in place anyway if the proces

Re: D for embedded system

2012-10-23 Thread Timo Sintonen
On Tuesday, 23 October 2012 at 16:37:11 UTC, Martin Nowak wrote: Are there any patches required to build a cross-gdc? Before compiling gcc-package there should be binutils and libc for the target installed. Binutils is the gnu binutils package and as libc I have used newlib, which is a light

Re: Need help building GDC on 64-bit Debian

2012-10-21 Thread Timo Sintonen
On Sunday, 21 October 2012 at 13:14:25 UTC, Iain Buclaw wrote: If you compiled gdc - it should have also include libphobos in the build... unless you did something strange and omitted it. :) The old update script did it wrong sometimes. When the sources were parallel, like /usr/local/src/gcc

Re: D for embedded system

2012-10-21 Thread Timo Sintonen
On Saturday, 20 October 2012 at 18:40:51 UTC, Johannes Pfau wrote: BTW: Here's the dmd commit which introduced betterc: https://github.com/D-Programming-Language/dmd/commit/707949edc30f245a68145bef619f6f02b85e39ab but right now it only disables moduleinfo generation, afaics. This is only in d

Re: D for embedded system

2012-10-20 Thread Timo Sintonen
On Saturday, 20 October 2012 at 14:35:44 UTC, Martin Nowak wrote: I recently did a project on the STM32F0-Discovery board. After having used a nice arm-none-eabi-*/openocd toolchain I wonder what is needed to build a cross-gdc. As these devices are really short on Flash and RAM I would've only

Re: D for embedded system

2012-10-20 Thread Timo Sintonen
On Saturday, 20 October 2012 at 09:40:28 UTC, Iain Buclaw wrote: Quick question, what is defined in your phobos-vers-syms file? (This will be located in the libphobos / libdruntime build directory). Regards NoSystem @DCFG_NEARBYINT@ @DCFG_TGAMMA@ @DCFG_NAN@ GNU_Need_exp2 GNU_Need_log2

Re: D for embedded system

2012-10-20 Thread Timo Sintonen
Nobody has used GDC/D/druntime on a system without OS afaik. So you have to pioneer ;-) So I have to try it on my own... * Create your own, simple runtime library. There's no real documentation on the minimum interface a runtime must implement (the compiler calls back into the runtime)

  1   2   >