Wednesday, 2020-09-16

*** tpb has joined #tomu00:00
xobstcal: thanks -- Docker changed when I upgraded Fedora and I didn't notice that server had broken.01:14
*** AnimaInvicta has left #tomu01:34
*** wrtlprnft has quit IRC04:18
*** wrtlprnft has joined #tomu04:19
*** wrtlprnft has quit IRC04:24
*** wrtlprnft has joined #tomu04:44
*** mupuf_ has quit IRC05:26
*** mupuf has joined #tomu05:26
*** gio_ has joined #tomu06:27
*** gio has quit IRC06:30
*** gio has joined #tomu06:34
*** gio_ has quit IRC06:36
*** S has joined #tomu07:53
*** S is now known as Guest2295707:54
*** Guest22957 has quit IRC07:55
*** awe001 has joined #tomu08:27
*** wrtlprnft has quit IRC09:52
*** wrtlprnft has joined #tomu09:52
*** kyl has quit IRC10:18
*** gio has quit IRC10:21
*** gio has joined #tomu10:23
*** kyl has joined #tomu10:24
*** flx has quit IRC11:21
*** flx has joined #tomu11:25
st-gourichon-fidHi! We make some progress on our design. On to software. Assume we want to add C++ code to `foboot/examples/riscv-blink`. It looks like existing makefile compiles main() with GCC, not C++, so I expect we lose static initializers. Also linking with gcc we lose C++ libraries (should be okay).  Any recommendations?13:46
st-gourichon-fidI guess we are okay with no static initializers. It's basic C++ code (porting from Arduino).13:46
st-gourichon-fidStill, if anyone knows caveat of some sort, feel free to comment about the use of C++ in fobot examples.  Makefile looks like C and C++ do not receive exact same treatment in Makefile.13:47
st-gourichon-fids/fobot/foboot/13:47
xobsI've not done much [anything] with C++ in Fomu.13:52
xobsHaving said that, I did do some stuff back in the day with Chibitronics.13:52
st-gourichon-fidThanks xobs for the information.13:52
xobsThis horrible mess of a function called C++ constructors from a C initializer: const_start13:52
xobshttps://github.com/chibitronics/ltc-os/blob/9825dd637b00e654318903c482b0c91c1ccb4966/orchard/esplanade_app.c#L115-L13113:52
tpbTitle: ltc-os/esplanade_app.c at 9825dd637b00e654318903c482b0c91c1ccb4966 · chibitronics/ltc-os · GitHub (at github.com)13:52
xobsThe actual program header is constructed at https://github.com/chibitronics/ltc-compiler-layer/blob/master/support/variant.cpp13:54
tpbTitle: ltc-compiler-layer/variant.cpp at master · chibitronics/ltc-compiler-layer · GitHub (at github.com)13:54
xobsWith the linker script available at https://github.com/chibitronics/ltc-compiler-layer/blob/master/support/KL02Z32-app.ld13:54
tpbTitle: ltc-compiler-layer/KL02Z32-app.ld at master · chibitronics/ltc-compiler-layer · GitHub (at github.com)13:54
st-gourichon-fidThanks xobs for those links. I see the function calling C++ constructors from a C array and the struct field .const_start . Not sure what is related to C++ in the linked script *-app.ld . Anyway, thanks.14:02
xobsC++ places its static constructors in a section called ".init_array". The linker script provides two symbols: __init_array_start and __init_array_end that allows C code to know where this list of constructors starts and ends. It can then just traverse the list and call each function.14:03
st-gourichon-fidxobs, interesting. I guess this is what provides per-class initializers... and thus allows to get static initializers while using regular C compiler for main and regular C linker.14:05
xobsNot necessarily a C compiler -- something needs to know how to construct the initializers. It just so happens that g++ does it by creating an array of function pointers. Maybe that's a C++ thing? I'm not too sure on the standards there.14:06
st-gourichon-fidxobs, right, we could be inviting c++ code from any environment, not necessarily C.14:14
st-gourichon-fidWe make some progress. We have some working code in `foboot/examples/myexample` that compiles and boots on the hardware. Cool!15:04
st-gourichon-fidWas SYSTEM_CLOCK_FREQUENCY renamed to CONFIG_CLOCK_FREQUENCY at some point in litex ?15:14
xobsYes, at some point they changed the prefix and redid all the accessors.15:14
st-gourichon-fidThanks for confirming.15:14
st-gourichon-fidWe are writing our code in foboot/example/myexample from foboot/master but with a newer litex (litex/master instead of the version pinned in .gitmodules), so other example codes are outdated.15:15
*** awe002 has joined #tomu16:12
*** awe001 has quit IRC16:13
*** awe002 has quit IRC16:46
*** js is now known as Guest5456016:55
*** gio_ has joined #tomu16:55
*** gio has quit IRC16:57
*** dwg has quit IRC17:16
*** wrtlprnft has quit IRC18:03
*** wrtlprnft has joined #tomu18:05
*** mifune has joined #tomu18:10
*** mifune has quit IRC18:48
*** mifune has joined #tomu18:48
*** dwg has joined #tomu20:01
*** js has joined #tomu21:51
*** CarlFK has quit IRC23:55

Generated by irclog2html.py 2.17.2 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!