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 co

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 th

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 u

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 m

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 caller or cal

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 gt

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 + > schrieb "Timo Sintonen" : > >> I have been looking at object f

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 segment there is

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