poke53281 | it's there but it is marked as "The symbol is undefined" | 00:02 |
---|---|---|
Erant | Yeah, sounds like that's coming from somewhere else then. | 00:07 |
Erant | poke53281: What's your link line? As in, what are you passing to ld? | 00:08 |
Erant | -lc -lgcc? | 00:08 |
Erant | It just sounds like libgcc isn't being linked in, basically. | 00:11 |
poke53281 | http://pastebin.com/SMxfCWxr | 00:21 |
poke53281 | after executing "or1k-linux-gcc -v test.c" | 00:22 |
poke53281 | sorry, wrong file | 00: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 |
poke53281 | this is the linker command | 00:24 |
poke53281 | -lgcc -lc is included | 00:25 |
Erant | herp. Hmm. Exported symbols from libgcc? That's weird. | 00:25 |
Erant | That 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 |
poke53281 | Do you have the dev. toolchain installed to reproduce the error? | 01:07 |
poke53281 | If you can't reproduce the error I can reinstall the whole toolchain. | 01:08 |
Erant | I'm not using that toolchain, rather the or32 one. | 01:12 |
Erant | At least, I'm assuming you're using a different toolchain | 01:12 |
Erant | In fact, I gotta build my toolchain again. | 01:13 |
poke53281 | http://pastie.org/5031284 | 01:15 |
poke53281 | This is manual to build the dev uClibc toolchain with shared libraries. | 01:15 |
Erant | What exactly is the difference between the or1k and or32 toolchains? | 01:16 |
Erant | And I'm not going to be building dynamic libraries, so. | 01:16 |
poke53281 | or32 is the stable (old) one. | 01:16 |
poke53281 | with support for static binaries. | 01:17 |
Erant | And this is dev/experimental? | 01:17 |
poke53281 | Yes | 01:17 |
Erant | Why are you building the dev build? | 01:17 |
poke53281 | To use shared libraries. More compatible with all the other open source libraries out there. And it reduces space. | 01:18 |
Erant | Just out of curiosity, what platform are you building for? | 01:18 |
Erant | Linux? | 01:19 |
poke53281 | Yes | 01:19 |
Erant | So or32-linux? Fair enough. Anyway, reinstalling your toolchain won't help | 01:20 |
Erant | The problem is looking like it's with your libc | 01:20 |
poke53281 | the dev (new) one is called or1k-linux. But they are more or less the same. | 01:20 |
Erant | Did you try rebuilding uClibc? | 01:22 |
poke53281 | Yes. 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 |
poke53281 | Yes, I tried. | 01:22 |
poke53281 | I tried reinstalling gcc too. | 01:23 |
Erant | Yeah, I'm not affiliated with openRISC, I came in here for the same reason. Stuff broke. :P | 01:23 |
Erant | I just have some experience with bringing up a platform. | 01:23 |
poke53281 | http://simulationcorner.net/opencore/jor1k.html | 01:24 |
poke53281 | Take a look. My project | 01:25 |
Erant | Hmm. Run readelf -d on your libc? | 01:26 |
Erant | That should dump out the dynamic section | 01:26 |
poke53281 | Just for fun. Main goal was to learn Javascript. | 01:26 |
poke53281 | Dynamic section at offset 0x5da74 contains 17 entries: | 01:29 |
poke53281 | Tag Type Name/Value | 01: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) 0x54c80 | 01:29 |
poke53281 | 0x00000004 (HASH) 0xf4 | 01:29 |
poke53281 | 0x00000005 (STRTAB) 0x752c | 01:29 |
poke53281 | 0x00000006 (SYMTAB) 0x251c | 01:29 |
poke53281 | 0x0000000a (STRSZ) 12272 (bytes) | 01:29 |
poke53281 | 0x0000000b (SYMENT) 16 (bytes) | 01:29 |
poke53281 | 0x00000003 (PLTGOT) 0x5fe48 | 01:29 |
poke53281 | 0x00000002 (PLTRELSZ) 552 (bytes) | 01:29 |
poke53281 | 0x00000014 (PLTREL) RELA | 01:29 |
poke53281 | 0x00000017 (JMPREL) 0xaf60 | 01:29 |
poke53281 | The option is to wait for stekern. | 01:30 |
Erant | Yeah, 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 |
Erant | To see if it exports those symbols? | 01:48 |
poke53281 | it's in there with a great "T". "T" means: "The symbol is in the text (code) section" | 01:52 |
Erant | Yeah, I know. Hmm. | 01:54 |
poke53281 | The 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 |
poke53281 | But 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 |
poke53281 | static compilations are working without problems. | 01:56 |
Erant | Shared libraries doesn't equate PIC. | 01:58 |
poke53281 | in principle you are right but I think it helps a lot if shared libraries are using PIC. | 02:02 |
stekern | poke53281: do you have a linux image laying around with your system? | 04:36 |
stekern | so I could try to reproduce here | 04:36 |
stekern | blueCmd: 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 |
stekern | Erant: minsoc maintainer is Raul Fajardo (rfajardo@opencores.org), connect him about minsoc patches | 04:40 |
poke53281 | Yes | 04:49 |
poke53281 | One second | 04:51 |
Erant | stekern: Eh, I tried getting orpsoc to work on the atlys, I wasn't that succesful. | 04:55 |
stekern | Erant: what was the problem? | 04:56 |
stekern | and did you use my repo or svn? | 04:56 |
stekern | both _should_ work, but just so I know where to look | 05:02 |
Erant | stekern: svn. | 05:04 |
Erant | I 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 |
Erant | orpmon 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 |
poke53281 | ext2fsimage contains the current system i am chrooting in. | 05:06 |
poke53281 | vmlinux.bin contains more or less the current "jonas" kernel with some additional modules and the rootfs. | 05:07 |
poke53281 | You can directly start everything by open the jor1k.html | 05:08 |
poke53281 | "mount /dev/mtdblock0 /mnt" | 05:08 |
poke53281 | chroot /mnt | 05:08 |
stekern | poke53281: ok, thanks, I'll investigate | 05:11 |
poke53281 | ./a.out is the shared library hello world example | 05:13 |
stekern | ok, 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.out | 05:19 |
stekern | ./a.out | 05:19 |
stekern | Hello world! | 05:19 |
stekern | so there it works | 05:20 |
poke53281 | ok, so a diff of nm libc, uClibc, libgcc would be nice | 05:20 |
poke53281 | So I did not everything wrong. :) | 05:21 |
poke53281 | 30 minutes away from keyboard. | 05:24 |
stekern | it works in a from-scratch built environment too (done with my build instructions) | 05:42 |
stekern | let's see what happens if I copy in your libs into the ramfs | 05:43 |
stekern | hmm, that works too | 05:50 |
poke53281 | re | 05:54 |
poke53281 | I am confused now | 05:56 |
stekern | me too :/ | 05:56 |
poke53281 | did you copy /lib and /usr/lib? | 05:57 |
stekern | yes, double checking now | 06:01 |
stekern | ok, now I got the missing udivsi it, must have forgot something in /usr/lib | 06:02 |
poke53281 | Hmm, I reckonize that I link ld.so.1 to ../../ld-uClibc.so,0 | 06:10 |
poke53281 | I mean ../../lib/ld-uClibc.so.0 | 06:10 |
poke53281 | But there is another ld.uClibc.so.0 in /usr/lib | 06:11 |
poke53281 | Ahh, but it's not an executable. Forget it | 06:11 |
stekern | I think you had some stuff in there that wasn't in my sys-root | 06:14 |
poke53281 | I have tried to install ncurses and directfb | 06:15 |
poke53281 | But this is non-working stuff right now. | 06:15 |
stekern | http://oompa.chokladfabriken.org/tmp/or1k-linux-sysroot.tar.gz | 06:15 |
stekern | that's the sysroot I got from my clean install | 06:16 |
poke53281 | I have installed uClibc and gcc to be sure that the other libraries did not overwrite something | 06:16 |
poke53281 | Well, I activated the debugging of uClibc. Otherwise the main files should be identical. | 06:17 |
stekern | and then i just copied that into the initramfs of a clean checkout from jonas linux repo at openrisc.net | 06:18 |
stekern | that's my 'known-to-work' system | 06:19 |
stekern | sorry, gotta run, bbl | 06:20 |
poke53281 | Ok, thank you very much. I will take a look and compare | 06:20 |
poke53281 | stekern: I have reinstalled the whole toolchain and it works! | 07:24 |
poke53281 | Last timeI installed uClibc again with gcc stage 2. Could this be the problem? | 07:24 |
stekern | poke53281: shouldn't be | 09:25 |
stekern | poke53281: I made some progress, it's the extra libuClibc-0.9.34-git.so in /usr/lib that is causing problems | 10:08 |
stekern | removing that solves it | 10:09 |
MrTAToad | Hello | 14:50 |
MrTAToad | Can 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 |
stekern | What is RPCEmu? | 15:08 |
MrTAToad | The Acorn RiscOS emulator | 15:09 |
stekern | I see | 15:10 |
MrTAToad | :) | 15:13 |
stekern | We 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 here | 15:13 |
stekern | ... that said, you never know ;) | 15:14 |
MrTAToad | fair enough | 15:14 |
MrTAToad | true :) | 15:17 |
poke53281 | stekern: Thanks for figuring it out. | 20:26 |
poke53281 | One question: Is the or1k-gcc repository able to compile running on the or1k host? | 20:27 |
poke53281 | I tried but I am running in an assertion fail in bfd/elf32-or1k.c:892 | 20:28 |
poke53281 | ../libiberty/libiberty.a(argv.o): probably compiled without -fPIC | 20:29 |
poke53281 | no problem if not | 20:31 |
stekern | poke53281: theoretically it should be possible, but I bet you are the first to try ;) | 20:33 |
poke53281 | I had to copy libmpfr and libgmp into or1k-gcc. I am wondering why stage 1 and stage 2 worked without these libraries. | 20:37 |
poke53281 | According to the documentation it should be mandatory in all cases. | 20:38 |
stekern | hmm, yeah, but they are a prerequisite for building the toolchain | 20:39 |
stekern | so you probably have them installed on your machine when building the crosscompiler | 20:40 |
stekern | or am I misunderstanding what you meant? | 20:40 |
poke53281 | Yes, 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 |
stekern | to be honest, I've been rather ignorant about what they do | 20:45 |
stekern | but getting an or1k host gcc would be a cool accomplishment | 20:46 |
poke53281 | Anyway, this is not the problem. I will figure it out. | 20:46 |
poke53281 | This is my plan. And this would solve some cross-compiling mess. | 20:47 |
poke53281 | At least my plan is to give you some bug reports. :) | 20:49 |
stekern | that's great | 20:51 |
poke53281 | It is currently compiling since 15 minutes. So far without problems. export CFLAGS="-g -O2 -fpic" did the trick. | 21:29 |
poke53281 | Ha, finally an error. So much luck is not possible. | 21:35 |
stekern | :) | 21:47 |
poke53281 | Compiling 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!