IRC logs for #openrisc Wednesday, 2012-12-19

poke53281it's there but it is marked as "The symbol is undefined"00:02
ErantYeah, sounds like that's coming from somewhere else then.00:07
Erantpoke53281: What's your link line? As in, what are you passing to ld?00:08
Erant-lc -lgcc?00:08
ErantIt just sounds like libgcc isn't being linked in, basically.00:11
poke53281http://pastebin.com/SMxfCWxr00:21
poke53281after executing "or1k-linux-gcc -v test.c"00:22
poke53281sorry, wrong file00:24
poke53281 /opt/or1k/libexec/gcc/or1k-linux/4.8.0/collect2 --sysroot=/opt/or1k/or1k-linux/sys-root /opt/or1k/or1k-linux/sys-root/usr/lib/crt0.o /opt/or1k/lib/gcc/or1k-linux/4.8.0/crti.o /opt/or1k/lib/gcc/or1k-linux/4.8.0/crtbegin.o -L/opt/or1k/lib/gcc/or1k-linux/4.8.0 -L/opt/or1k/lib/gcc/or1k-linux/4.8.0/../../../../or1k-linux/lib -L/opt/or1k/or1k-linux/sys-root/lib -L/opt/or1k/or1k-linux/sys-root/usr/lib test.o -lgcc -lgcc_eh -lc -lgcc -lgcc_eh /opt/00:24
poke53281this is the linker command00:24
poke53281-lgcc -lc is included00:25
Erantherp. Hmm. Exported symbols from libgcc? That's weird.00:25
ErantThat symbol should be there somewhere. As a workaround, you could define them in your test.c, but it's hacky.00:25
Erant(As in, find an implementation online, plunk 'm in)00:25
poke53281Do you have the dev. toolchain installed to reproduce the error?01:07
poke53281If you can't reproduce the error I can reinstall the whole toolchain.01:08
ErantI'm not using that toolchain, rather the or32 one.01:12
ErantAt least, I'm assuming you're using a different toolchain01:12
ErantIn fact, I gotta build my toolchain again.01:13
poke53281http://pastie.org/503128401:15
poke53281This is manual to build the dev uClibc toolchain with shared libraries.01:15
ErantWhat exactly is the difference between the or1k and or32 toolchains?01:16
ErantAnd I'm not going to be building dynamic libraries, so.01:16
poke53281or32 is the stable (old) one.01:16
poke53281with support for static binaries.01:17
ErantAnd this is dev/experimental?01:17
poke53281Yes01:17
ErantWhy are you building the dev build?01:17
poke53281To use shared libraries. More compatible with all the other open source libraries out there. And it reduces space.01:18
ErantJust out of curiosity, what platform are you building for?01:18
ErantLinux?01:19
poke53281Yes01:19
ErantSo or32-linux? Fair enough. Anyway, reinstalling your toolchain won't help01:20
ErantThe problem is looking like it's with your libc01:20
poke53281the dev (new) one is called or1k-linux. But they are more or less the same.01:20
ErantDid you try rebuilding uClibc?01:22
poke53281Yes. I could find out the problem myself. It's just a matter of time. But here are the developers of these toolchain. So why not ask them. Maybe the problem is known and I don't have to spend hours and hours to find a solution.01:22
poke53281Yes, I tried.01:22
poke53281I tried reinstalling gcc too.01:23
ErantYeah, I'm not affiliated with openRISC, I came in here for the same reason. Stuff broke. :P01:23
ErantI just have some experience with bringing up a platform.01:23
poke53281http://simulationcorner.net/opencore/jor1k.html01:24
poke53281Take a look. My project01:25
ErantHmm. Run readelf -d on your libc?01:26
ErantThat should dump out the dynamic section01:26
poke53281Just for fun. Main goal was to learn Javascript.01:26
poke53281Dynamic section at offset 0x5da74 contains 17 entries:01:29
poke53281  Tag        Type                         Name/Value01:29
poke53281 0x00000001 (NEEDED)                     Shared library: [ld-uClibc.so.0]01:29
poke53281 0x0000000e (SONAME)                     Library soname: [libc.so.0]01:29
poke53281 0x0000000c (INIT)                       0x54c8001:29
poke53281 0x00000004 (HASH)                       0xf401:29
poke53281 0x00000005 (STRTAB)                     0x752c01:29
poke53281 0x00000006 (SYMTAB)                     0x251c01:29
poke53281 0x0000000a (STRSZ)                      12272 (bytes)01:29
poke53281 0x0000000b (SYMENT)                     16 (bytes)01:29
poke53281 0x00000003 (PLTGOT)                     0x5fe4801:29
poke53281 0x00000002 (PLTRELSZ)                   552 (bytes)01:29
poke53281 0x00000014 (PLTREL)                     RELA01:29
poke53281 0x00000017 (JMPREL)                     0xaf6001:29
poke53281The option is to wait for stekern.01:30
ErantYeah, well, your issue is just some missing symbols. That's more of a generic problem than anything OpenRISC related. Did you nm your libgcc?01:48
ErantTo see if it exports those symbols?01:48
poke53281it's in there with a great "T". "T" means:  "The symbol is in the text (code) section"01:52
ErantYeah, I know. Hmm.01:54
poke53281The problem is openrisc related as you have to support position independent code and shared libraries. This means a lot of changes in gcc and uClibc. And I am afraid to find the solution in some config file or .c file deep buried in the hundred throusands line of source code.01:55
poke53281But anyway let's wait and in a few hours I have some time to figure out if there is some export symbol missing.01:56
poke53281static compilations are working without problems.01:56
ErantShared libraries doesn't equate PIC.01:58
poke53281in principle you are right but I think it helps a lot if shared libraries are using PIC.02:02
stekernpoke53281: do you have a linux image laying around with your system?04:36
stekernso I could try to reproduce here04:36
stekernblueCmd: there is support for the atlys board in orpsoc as well, and I have added support for a couple of extra peripherals here (VGA, AC97 and PS2): http://git.openrisc.net/cgit.cgi/stefan/orpsoc/04:38
stekernErant: minsoc maintainer is Raul Fajardo (rfajardo@opencores.org), connect him about minsoc patches04:40
poke53281Yes04:49
poke53281One second04:51
Erantstekern: Eh, I tried getting orpsoc to work on the atlys, I wasn't that succesful.04:55
stekernErant: what was the problem?04:56
stekernand did you use my repo or svn?04:56
stekernboth _should_ work, but just so I know where to look05:02
Erantstekern: svn.05:04
ErantI couldn't really get it to do anything. Now, I didn't dive deep enough to actually figure out what was going on, I should've hooked up JTAG, etc.05:04
Erantorpmon didn't output anything, I tried modifying the bootrom to just splat out some stuff over UART, didn't do anything.05:05
poke53281@stekern: http://simulationcorner.net/cpu/05:06
poke53281ext2fsimage contains the current system i am chrooting in.05:06
poke53281vmlinux.bin contains more or less the current "jonas" kernel with some additional modules and the rootfs.05:07
poke53281You can directly start everything by open the jor1k.html05:08
poke53281"mount /dev/mtdblock0 /mnt"05:08
poke53281chroot /mnt05:08
stekernpoke53281: ok, thanks, I'll investigate05:11
poke53281./a.out is the shared library hello world example05:13
stekernok, let's see what that does in my "known to work" system (the one I've been running the regression tests against)05:14
stekern # ./a.out05:19
stekern./a.out05:19
stekernHello world!05:19
stekernso there it works05:20
poke53281ok, so a diff of nm libc, uClibc, libgcc would be nice05:20
poke53281So I did not everything wrong.  :)05:21
poke5328130 minutes away from keyboard.05:24
stekernit works in a from-scratch built environment too (done with my build instructions)05:42
stekernlet's see what happens if I copy in your libs into the ramfs05:43
stekernhmm, that works too05:50
poke53281re05:54
poke53281I am confused now05:56
stekernme too :/05:56
poke53281did you copy /lib and /usr/lib?05:57
stekernyes, double checking now06:01
stekernok, now I got the missing udivsi it, must have forgot something in /usr/lib06:02
poke53281Hmm, I reckonize that I link ld.so.1 to ../../ld-uClibc.so,006:10
poke53281I mean ../../lib/ld-uClibc.so.006:10
poke53281But there is another ld.uClibc.so.0 in /usr/lib06:11
poke53281Ahh, but it's not an executable. Forget it06:11
stekernI think you had some stuff in there that wasn't in my sys-root06:14
poke53281I have tried to install ncurses and directfb06:15
poke53281But this is non-working stuff right now.06:15
stekernhttp://oompa.chokladfabriken.org/tmp/or1k-linux-sysroot.tar.gz06:15
stekernthat's the sysroot I got from my clean install06:16
poke53281I have installed uClibc and gcc to be sure that the other libraries did not overwrite something06:16
poke53281Well, I activated the debugging of uClibc. Otherwise the main files should be identical.06:17
stekernand then i just copied that into the initramfs of a clean checkout from jonas linux repo at openrisc.net06:18
stekernthat's my 'known-to-work' system06:19
stekernsorry, gotta run, bbl06:20
poke53281Ok, thank you very much. I will take a look and compare06:20
poke53281stekern: I have reinstalled the whole toolchain and it works!07:24
poke53281Last timeI installed uClibc again with gcc stage 2. Could this be the problem?07:24
stekernpoke53281: shouldn't be09:25
stekernpoke53281: I made some progress, it's the extra libuClibc-0.9.34-git.so in /usr/lib that is causing problems10:08
stekernremoving that solves it10:09
MrTAToadHello14:50
MrTAToadCan RPCEmu handle bank switching ? Every time I try in my C program, one screen is corrupt and it manages to hang GCC until the next reset!14:53
stekernWhat is RPCEmu?15:08
MrTAToadThe Acorn RiscOS emulator15:09
stekernI see15:10
MrTAToad:)15:13
stekernWe are not always (most often not) strictly on-topic in this channel, but it's main topic is about the openrisc processor architecture, so chances are that you will not find an answer to your question here15:13
stekern... that said, you never know ;)15:14
MrTAToadfair enough15:14
MrTAToadtrue :)15:17
poke53281stekern: Thanks for figuring it out.20:26
poke53281One question: Is the or1k-gcc repository able to compile running on the or1k host?20:27
poke53281I tried but I am running in an assertion fail in bfd/elf32-or1k.c:89220:28
poke53281../libiberty/libiberty.a(argv.o): probably compiled without -fPIC20:29
poke53281no problem if not20:31
stekernpoke53281: theoretically it should be possible, but I bet you are the first to try ;)20:33
poke53281I had to copy libmpfr and libgmp into or1k-gcc. I am wondering why stage 1 and stage 2 worked without these libraries.20:37
poke53281According to the documentation it should be mandatory in all cases.20:38
stekernhmm, yeah, but they are a prerequisite for building the toolchain20:39
stekernso you probably have them installed on your machine when building the crosscompiler20:40
stekernor am I misunderstanding what you meant?20:40
poke53281Yes, I had them installed. And I am not sure when gcc is actually using them. I worked with libmpfr already and I thought that gcc is using it for emulating an FPU.20:42
stekernto be honest, I've been rather ignorant about what they do20:45
stekernbut getting an or1k host gcc would be a cool accomplishment20:46
poke53281Anyway, this is not the problem. I will figure it out.20:46
poke53281This is my plan. And this would solve some cross-compiling mess.20:47
poke53281At least my plan is to give you some bug reports. :)20:49
stekernthat's great20:51
poke53281It is currently compiling since 15 minutes. So far without problems. export CFLAGS="-g -O2 -fpic" did the trick.21:29
poke53281Ha, finally an error. So much luck is not possible.21:35
stekern:)21:47
poke53281Compiling and installing worked. But I don't think the initramfs will support a disk of 200 MB. Have to include ata in or1k.22:44

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