IRC logs for #openrisc Sunday, 2014-01-12

--- Log opened Sun Jan 12 00:00:50 2014
blueCmd_stekern or anybody with or1ksim code knowledge. I would like a code review on a feature: http://5d7278c70c6626d7.paste.se/00:42
blueCmd_jeremybennett: So apparently gcc has added some basic parallelism in their tests, https://github.com/bluecmd/or1k-gcc/blob/master/gcc/Makefile.in#L51102:07
blueCmd_it seems to work quite nicely with small modifications. I stole some inspiration from the older scripts, and it seems to be chugging along in a nice speed now02:08
jeremybennettblueCmd_: Yup - that's the part of the GCC make I was referring to. To increase the parallelism you need to go for finer splitting up of check_gcc_parallelize.07:44
olofk_franck_: Nope. Can't run it using main() either07:49
olofkWhere does libelf come from? Wondering if I have a strange version of that07:50
olofkaha... I don't _have_ libelf installed :)07:50
olofkshouldn't -lelf complain in that case?07:50
olofkhmm.. I do how elfutils however07:51
olofkAnd that has installed a libelf.a07:51
olofkCould that be an incompatible version of libelf perhaps07:52
_franck_olofk: that might be that08:45
_franck_[franck@centos ~]$ /sbin/ldconfig -p | grep libelf libelf.so.1 (libc6) => /usr/lib/libelf.so.1 libelf.so (libc6) => /usr/lib/libelf.so08:48
_franck_which Linux distrib do you have ?08:49
olofk_franck_: gentoo09:06
olofkBut it looks like elfutils should be a drop-in replacement for libelf09:07
olofkI wonder if it's a 32/64-bit problem09:07
olofkI'm looking for error codes from elf_getdata_rawchunk to see if I can find any more clues09:08
_franck_raise RunTimeError("Error: Command " + self.cmd + " not found. Make sure it is in $PATH")09:13
_franck_NameError: global name 'RunTimeError' is not defined09:13
_franck_olofk: is that your new thing ?09:13
olofkAh crap09:14
olofkThat should be RuntimeError09:14
olofkThought I had fixed that09:16
_franck_now: AttributeError: 'exceptions.RuntimeError' object has no attribute 'value'09:16
olofkWhat the hell..?09:16
olofkWhich line?09:16
_franck_/home/franck/openrisc/orpsoc/orpsoc/provider/opencores.py", line 58, in _checkout print(e.value)09:16
_franck_I didn't have subversion installed :)09:21
_franck_now it works in ubuntu09:22
_franck_/usr/lib/i386-linux-gnu/libelf-0.157.so09:22
_franck_0.157 here, I had /usr/lib/libelf-0.152.so on my centos09:23
blueCmd_jeremybennett: ah, I see09:25
olofk_franck_: It was good that you didn't have subversion. You uncovered a bug :)09:29
olofk_franck_: Pushed a fix now09:31
olofkI got elfutils 0.149. Don't know how that corresponds to libelf itself09:32
olofk_franck_: Does you code work without modifications on both centos (0.157) and ubuntu (0.152)?09:34
_franck_yes09:34
olofkI could try updating my libelf then and see if that helps09:34
olofkOr is it possible to get more info on what fails? My C skills aren't as good as they should be :/09:34
_franck_we could print the error code where it fails like you told some lines before09:35
olofkBut where can I find the error codes? Tried man and google09:36
_franck_in the source code of course :)09:36
_franck_that's the openrisc development philosophy, you should know it :)09:37
olofkhaha09:37
blueCmd_code never lies09:39
olofkblueCmd_: Tell that to the IOCCC guys :)09:39
_franck_olofk: printf("error = %d\n", errno); after the failling call09:39
blueCmd_olofk: hah09:40
_franck_the lib set errno: __libelf_seterrno (ELF_E_NOMEM);09:40
blueCmd_if it's a system errno you can use perror, but maybe it's an internal libelf thing09:41
olofkerrno undeclared... I guess I'm missing something obvious09:41
_franck_#include <errno.h>09:41
olofkerror = 009:42
_franck_well, I thin k I'll install elfutils 0.149 :) or you can upgrade and we can tell autoconf to check for libelf > 0.152 :)09:44
olofkI'll upgrade09:46
olofkBut what the hell is error code 0? I guess it means no error at all, right?09:47
_franck_ELF_E_NOERROR = 009:48
olofkworks fine with 0.15210:07
olofkThe problem now would be how to require a certain version of a lib10:08
olofkI'm already planning on using gentoo-style dependencies (like >=libelf-0.152), but it will take some time to get that implemented10:09
olofkPerhaps it's best just to put it in a README for now10:09
olofkAnother way would be to abort the simulation if we detect that the ELF doesn't load correctly and print out a message that tells the user to make sure to check that libelf is >=0.15210:12
olofkFow now, I'm applying your patch together with a short README and changing phdr/shdr to size_t. Does that sound ok?10:17
_franck_olofk: ok10:22
olofkand thanks for doing this. We no longer need to have the or1k toolchain installed to run efl simulations. That's huge improvement10:27
blueCmd_stekern: I listened to your presentation about the toolchain from back in oct. I was very thrilled to hear that it should be possible to build native gcc10:47
blueCmd_http://f72ac5a04b3ee835.paste.se/ - and it actually works!10:47
-!- Netsplit *.net <-> *.split quits: stekern, poel, jeremybennett, vxe11:08
blueCmd_jeremybennett: I'm having a bit of a problem running the testsuite for or1ksim since or1k-asm.h and spr-defs.h are not included since I'm not running newlib14:00
jeremybennettblueCmd_: It's a long time since I ran the regression test suite. Most of it involves compiling programs and then checking they run OK on Or1ksim.14:03
jeremybennettSo you'll need a compiler that has libc support.14:03
jeremybennettBut the two headers you mention I don't think are to do with that. spr-defs.h is used to test that the various SPRs are accessible.14:04
jeremybennettI can't recall what or1k-asm.h is used for. IIRC neither is included by default in a C compilation, so somewhere there must be a flag asking for them to be included.14:05
jeremybennettHTH14:05
blueCmd_jeremybennett: well, both of those files are in or1k-src/newlib and also in or1k-src/sim. or1ksim/cpu/or1k has spr-defs.h, but the testsuite does not look for them there14:56
blueCmd_I have glibc as the toolchain, and I don't think it makes much senes to ship spr-defs.h and or1k-asm.h with glibc14:57
stekernblueCmd_: but doesn't the or1ksim testsuite depend on newlib?15:14
blueCmd_stekern: hmm.. that would sort of make sense now when you say it15:14
stekernI mean, it runs baremetal programs iirc15:15
blueCmd_yeah15:15
blueCmd_quite a lot of pain in setting up a build environment for a gcc-newlibc for that, meh.15:26
blueCmd__franck_: are you able to execute "make check" in or1ksim ?15:27
jeremybennettblueCmd_: sorry for the delay15:58
jeremybennettI 'm not an expert on glibc, but somewhere it must have a board support package - the equivalent of libgloss in newlib. That will need to know SPR values.15:59
jeremybennettSo there should be an equivalent of spr-defs15:59
jeremybennettas stekern points out the regression tests are of bare metal programs, so you need something.16:01
jeremybennettI don't know how much more work has been done recently, but the basic newlib implementation is pretty trivial. It only supports output to stdout, which is all you need for testing.16:02
jeremybennettIIRC I did the baseline implementation in an afternoon.16:02
jeremybennettSo should be pretty easy to get up and running.16:02
stekernjeremybennett: since glibc isn't really targetted for baremetal, i don't think there are bsp support in it16:12
jeremybennettAh - OK. I did wonder why glibc rather than eglibc.16:13
stekernbesides, there are other problems with trying to use the linux toolchain to compile baremetal16:14
stekernlibgcc is compiled with -fPIC16:14
stekernjeremybennett: from what i understood, since eglibc is derived from glibc, it's better to do the port directly in glibc and then pull the stuff from there to eglibc16:15
stekernthat's paraphrasing blueCmd_ though, he knows better16:16
jeremybennettstekern: I agree - I wasn't suggesting using the Linux toolchain. Just being muddle headed in thinking someone had done a bare metal version of glibc/eglibc16:19
blueCmd_yes sorry about that. I was not thinking straight16:38
blueCmd_anyway yes, eglibc has glibc as upstream and they want to keep the diff between them and glibc as small as possible, which is understandable16:39
olofkI think I've asked this before, but would it makes sense to have something like a or1k-headers repo to break up circular dependencies between toolchain/gcc/gdb/or1ksim?18:39
_franck_blueCmd_: it runs for some time then exit with Error 121:00
_franck_olofk: did you try to run orpsoc or1200-generic --sim verilator --or1k-elf-load=... lately ?21:04
_franck_%Error: Unknown warning specified: -Wno-fatal21:04
_franck_if I remove this flag, I get ....bench/verilog/uart16550_model.v:20: Cannot find include file: wb_bfm_params.v21:05
_franck_then I let down for tonight :)21:05
blueCmd_jeremybennett: would you consider merging the patch without tests for it, or is that a blocker?21:23
jeremybennettblueCmd_: Well it's not an absolute blocker, but it is something we try to avoid. I realize some things are quite hard to test.21:48
jeremybennettWhen I took over Or1ksim it had not tests and was somewhat "unreliable". Most of what I did was to write tests, so it became much more credible as a golden reference for the architecture.21:48
jeremybennettUltimately the idea is that the same set of tests should run on OpenRISC implementations as well.21:49
jeremybennettWhat causes difficulty writing the tests?21:49
olofk_franck_: Yeah, I messed up a bit when I added the uartmodel. It's not possible to run it with verilator22:01
olofkTwo possible solutions:22:02
olofk1. Quick'n'dirty: Add `ifdef VERILATOR in all the wb_bfm modules that can't be synthesized22:03
olofk2. The right way: Extend the dependency handling so that wb_bfm is only pulled in when icarus or modelsim is used22:03
blueCmd_jeremybennett: writing them are fine, but I can't manage to get it to run without creating a new build environment suited for newlib22:09
jeremybennettblueCmd_: But you won't be able to run any Or1ksim tests in that case. And even if you don't test your own patch, you need to make sure you haven't broken anything else.22:14
jeremybennettWhat is the problem with creating the newlib toolchain?22:14
blueCmd_jeremybennett: yeah, I know that deep in - I guess I'm just trying to take the easy way out :)22:15
blueCmd_jeremybennett: well, my environment and build scripts are not set up for newlib, and I have never built a newlib toolchain before22:15
jeremybennettWell I haven't done it for a while, but running bld-all.sh with default arguments pretty much does it (IIRC there is even a flag to stop it buing the uClibc toolchain).22:22
blueCmd_hm, I wouldn't even know where that script is. I have my very own scripts (glibc is different :P)22:23
blueCmd_oh well, I'll get around to build it sometime I guess22:23
stekernblueCmd_: that's for the or32- toolchain22:23
blueCmd_stekern: the old svn repo thing?22:24
stekernyes22:24
jeremybennettblueCmd_: stekern is right - the scripts are for the or32 tool chain. I don't know what people do for the or1k tool chain.22:24
stekernfollow the instructions here: http://opencores.org/or1k/OpenRISC_GNU_tool_chain#Newlib_toolchain_.28or1k-elf.2922:25
jeremybennettBut the approach is generic - link all your sources into a unified tree, configure with --with-newlib and then make the components you need (probably make all-build all-binutils all-gas all-ld all-gcc all-target-libgcc)22:25
jeremybennettOr as stekern has pointed out there are instructions.22:26
stekernblueCmd_: someone posted this script that does what the instruction says: http://pastie.org/862762622:26
jeremybennettBTW stekern why the two pass build. The whole thing with newlib is you configure with -newlib and do a single pass.22:26
blueCmd_stekern: thanks, I'll look at it in the week22:26
jeremybennettsorry --with-newlib22:26
stekernjeremybennett: the instruction came from my "recipe" that I gave to juliusb_ and he (kindly) put it on the wiki, no-one revised them22:27
stekernthat said - how does gcc pick up where newlib is?22:29
jeremybennettIt's in the unified tree.22:31
stekernah, ok, but that just seems messy to setup with how we have things now22:32
jeremybennettThe GNU build system is all built around the assumption that it is in one humungous tree.22:32
stekernsince we have the unified tree, sans gcc22:32
jeremybennettSomething for the future.22:32
jeremybennettYes - the unified tree as we have it (which I know was my idea) is now looking rather awkward given the merger of binutils & gdb in git.22:33
stekernbut gcc is not in the sourceware tree, so it doesn't really fit in to that picture22:33
jeremybennettJust an accident of history. That's why the tree linker script is in the GCC utils directory.22:33
jeremybennettOne day, we will finally get it all put together in one coherent repo. Until then every GCC developer on the planet has to build their own unified tree from the separate repos.22:34
stekern... or just build it in two steps, it's not a huge big of deal22:35
stekernkeeps my feet warm here in the basement ;)22:35
blueCmd_I'm just happy we don't have the 3-stage build you usually have22:37
blueCmd_3 pass*22:37
stekernjeremybennett: but you have a point with the awkwardness, I guess it wouldn't be too hard to rebase our commits ontop of the official git repos though22:39
stekernsomething for a rainy day22:41
jeremybennettstekern: No - I suppose if I complain I ought to make the fix myself22:41
jeremybennettblueCmd_: 3 pass - I thought CrossToolNG had just gone up to 4 passes?22:41
blueCmd_jeremybennett: maybe, but I can build glibc + gcc AFAIK with just 2 passes over gcc22:42
jeremybennettI thought glibc had the same integration as newlib, so you can build in just 1. The only issue would be if you needed to pick up Linux headers.22:47
jeremybennettIt's a known problem with GCC - circular library dependencies.22:47
--- Log closed Mon Jan 13 00:00:51 2014

Generated by irclog2html.py 2.15.2 by Marius Gedminas - find it at mg.pov.lt!