OpenWrt Forum Archive

Topic: Has anyone successfully compiled and run gpsd on a Buffalo WHR-G54S?

The content of this topic has been archived on 21 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I'm trying to build a Kamikaze firmware with gpsd. I need to build from source, because I will be needing to create a patch to handle a pulse-per-second signal on a gpio line, but initially I'm just trying to get the thing going as it comes.

I can build the firmware successfully, and everything seems to work, but when I telnet to the box and run gpsd, it locks up in an infinite loop (~100% CPU). It looks as though it's in some library initialisation code, because even if I stick a printf() statement at the beginning of main(), it still hangs.

I've got the latest everything from SVN; I've tried kernel 2.4, I've tried 2.6; I've modded the package Makefile to remove even more options; nothing makes any difference :-(

Here are the libraries it's using:

root@OpenWrt:/# ldd /usr/sbin/gpsd
        libgps.so.17 => /usr/lib/libgps.so.17 (0x2aaee000)
        libc.so.0 => /lib/libc.so.0 (0x2ab40000)
        libnsl.so.0 => /lib/libnsl.so.0 (0x2abe4000)
        libm.so.0 => /lib/libm.so.0 (0x2ac26000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x2ac74000)
        libuClibc++.so.0 => /usr/lib/libuClibc++.so.0 (0x2acc8000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x2ad3a000)
        ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0x2aaa8000)

I guess the next thing to try is to see if I can get gdb onto the box and step through the startup code, but if anyone's already solved this problem or has a better idea, I'd love to hear it.

TIA,

Steve Rencontre

Hi Steve,

i have the same trouble with a fresh trunk and gpsd.
Additional my own application had the same symptome until i compiled it as one binary instead of a library and a executable.

But with gpsd i couldn't do the same workaround. Did you had any luck in past with this? Do you know a solution?

Jay

Yes, I did solve the problem. I was planning to do a write-up of the whole project, but haven't yet got round to it.

The root cause is something strange with shared libraries that I don't fully understand. Even though my compilation settings meant that no code was being called from (I forget exactly which libs now), the executable was still being linked against them, and something in the C runtime startup code was getting stuck doing something with those libs. I know that sounds a bit vague, but my solution was simply to remove all references to the unwanted libs from the makefiles.

I don't have all the details in my head right now, but if those hints aren't enough, I can let you have a diff of my changes. However, if what you want to do /needs/ the libs I removed, then you may have to dig deeper than I did.

All the best,

Steve.

Try upgrading the package to latest upstream version 2.37.

The discussion might have continued from here.