bugGPSD - Bugs: bug #43642, static build failure - is trying...

 
 

bug #43642: static build failure - is trying to build a shared library

Submitter:  Vicente Olivert Riera <vriera>
Submitted:  Thu 20 Nov 2014 12:03:29 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  esr
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sun 15 Feb 2015 05:58:02 PM UTC, comment #11: 

Hello Eric,

non-static? My problem is when doing a full static build.

Sorry, could you please give me more details about how would this be solved? Which commit fixed this? Then I can backport that patch and try it.

Thanks

Vicente Olivert Riera <vriera>
Sun 15 Feb 2015 05:53:28 PM UTC, comment #10: 

I discovered that the non-static dbuds build was busted and fixed it.  Your case should work now, too.

Eric S. Raymond <esr>
Group administrator
Fri 13 Feb 2015 08:46:20 AM UTC, comment #9: 

No problem, I will wait for 3.12.

Why do you say that I'm not going to need dbus in an embedded deployment?

Vicente Olivert Riera <vriera>
Thu 12 Feb 2015 08:50:18 PM UTC, comment #8: 

After looking at what it would take to do this, it's not going to happen before 3.12.  I don't see any way to get there without complicating the build recipe way more than I'm happy with.

For now, just configure dbus out.  You're not going to need it in an embedded deployment, anyway.

Eric S. Raymond <esr>
Group administrator
Wed 14 Jan 2015 09:34:01 AM UTC, comment #7: 

It could be a workaround, but I think it's better to wait until you fix the problem. Thanks Eric.

Vicente Olivert Riera <vriera>
Tue 13 Jan 2015 12:46:29 PM UTC, comment #6: 

Fixing this going to require some risky and major surgery on the build file.  Until I can get that done (which may not be before the next point release) is dbus_export=no a workaround?

Eric S. Raymond <esr>
Group administrator
Tue 13 Jan 2015 12:11:59 PM UTC, comment #5: 

This is a Buildroot build. I'm crosscompiling gpsd for MIPS architecture building it statically and using uClibc. When doing static builds the order of the libraries is very important.

The dbus_export=yes scons option was used.

Vicente Olivert Riera <vriera>
Tue 13 Jan 2015 12:03:13 PM UTC, comment #4: 

scons shared=no builsds without errors under Ubuntu.  What is your build environment?

Try confuguring out the dbus support. It looks like that might help.

Eric S. Raymond <esr>
Group administrator
Tue 13 Jan 2015 11:59:41 AM UTC, comment #3: 

Passing the libraries to link gpsctl in this order seems to fix the problem (having -ldbus-1 at the end):

-lrt -lgpsd -lusb-1.0 -lgps -lm -ldbus-1

However I haven't found a way to achieve that by modifying the SConstruct file.

Vicente Olivert Riera <vriera>
Tue 13 Jan 2015 08:44:21 AM UTC, comment #2: 

The scons' shared=no option seems to be helpful. Now the error message is gone, but it's still failing with another error message:

-----------------------------
/br/output/host/usr/bin/mipsel-ctng-linux-uclibc-gcc -o gpsctl --sysroot=/br/output/host/usr/mipsel-buildroot-linux-uclibc/sysroot -pthread gpsctl.o -L. -L/br/output/host/usr/mipsel-buildroot-linux-uclibc/sysroot/usr/lib -lrt -ldbus-1 -lgpsd -lusb-1.0 -lgps -lm
./libgps.a(libgps_dbus.o): In function `signal_handler':
libgps_dbus.c:(.text+0xc): undefined reference to `dbus_message_is_signal'
libgps_dbus.c:(.text+0x64): undefined reference to `dbus_error_init'
libgps_dbus.c:(.text+0xec): undefined reference to `dbus_message_get_args'
./libgps.a(libgps_dbus.o): In function `gps_dbus_open':
libgps_dbus.c:(.text+0x1dc): undefined reference to `dbus_error_init'
libgps_dbus.c:(.text+0x1f4): undefined reference to `dbus_bus_get'
libgps_dbus.c:(.text+0x208): undefined reference to `dbus_error_is_set'
libgps_dbus.c:(.text+0x258): undefined reference to `dbus_bus_add_match'
libgps_dbus.c:(.text+0x274): undefined reference to `dbus_error_is_set'
libgps_dbus.c:(.text+0x2c0): undefined reference to `dbus_connection_add_filter'
./libgps.a(libgps_dbus.o): In function `gps_dbus_mainloop':
libgps_dbus.c:(.text+0x36c): undefined reference to `dbus_connection_read_write_dispatch'
collect2: error: ld returned 1 exit status
scons: * [gpsctl] Error 1
scons: building terminated because of errors.
make: * [/br/output/build/gpsd-3.11/.stamp_built] Error 2
-----------------------------

I think it could be caused by the order of the libraries: -lrt -ldbus-1 -lgpsd -lusb-1.0 -lgps -lm

Vicente Olivert Riera <vriera>
Thu 08 Jan 2015 03:39:38 AM UTC, comment #1: 

Try giving scons the option shared=no

Eric S. Raymond <esr>
Group administrator
Thu 20 Nov 2014 12:03:29 PM UTC, original submission:  

I'm having a problem when doing a static build of gpsd. There problem is that is trying to build a shared library, and then it fails with an error like this one:

/home/peko/autobuild/instance-1/output/host/opt/ext-toolchain/bin/../lib/gcc/mipsel-ctng-linux-uclibc/4.8.2/../../../../mipsel-ctng-linux-uclibc/bin/ld: /home/peko/autobuild/instance-1/output/host/usr/mipsel-buildroot-linux-uclibc/sysroot/usr/lib/libdbus-1.a(libdbus_1_la-dbus-bus.o): relocation R_MIPS_HI16 against `__gnu_local_gp' can not be used when making a shared object; recompile with -fPIC
/home/peko/autobuild/instance-1/output/host/usr/mipsel-buildroot-linux-uclibc/sysroot/usr/lib/libdbus-1.a: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
scons: * [libgps.so.21.0.0] Error 1

Could it be possible to add a new option to the configure script to not build the shared library?

Vicente Olivert Riera <vriera>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by esr (Posted a comment)
  • -email is unavailable- added by vriera (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-02-22 esr Open/ClosedOpen Closed
    2015-02-15 esr StatusPostponed Fixed
    2015-02-12 esr StatusNone Postponed
    2015-01-13 esr Assigned toNone esr

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code