gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-dev] libgps?


From: Hal Murray
Subject: Re: [gpsd-dev] libgps?
Date: Sun, 22 Mar 2015 02:29:01 -0700

scons check with the current stuff is broken unless you say chrpath=yes or 
shared=no.

There is no error message if you don't specify one or the other.

The build line from "scons" says:
gcc -o gpsd -pthread -Wl,-rpath=//usr/local/lib gpsd.o timehint.o shmexport.o 
dbusexport.o sd_socket.o -L. -lrt -lgpsd -lgps -lm

That's setup to use shared libraries from /usr/local/lib.  Testing will use 
the installed libraries, not the ones you just built.

----------

<grump on>
You take great pride (justifiably) in the checking harness.  But it only 
tests the code.  Please apply some of your energy to testing the build and 
test recipes.
<grump off>

Is gpsd the only project using shared libraries?  Or the only one trying to 
test them before installing?

How do other projects using shared libraries test things before installing?  
How many options are there?
  Link using local libraries.  Test.  Use chrpath to fixup the installed copy
  Link using local libraries.  Test.  Re-link to install.
  Link using installed library locations.  Use LD_LIBRARY_PATH to test
    (On Linux, that requires linking with RUNPATH rather than RPATH)
  Install, then test using installed libraries.  (Needs (semi-)dedicated 
machine.)
  Don't use shared libraries.

-----------

It's a 2 line change to get RUNPATH rather than RPATH.  This fixes the mess 
I've been trying to get you to fix for a while.  I think that covers the recent 
troubles too.

diff --git a/SConstruct b/SConstruct
index e865d90..490a2d6 100644
--- a/SConstruct
+++ b/SConstruct
@@ -313,7 +313,7 @@ if env["sysroot"]:
 # minimum default load path.
 if env["shared"]:
     if env["libdir"] not in ["/usr/lib", "/lib"]:
-        env.Prepend(RPATH=[installdir('libdir')])
+        env.Prepend(RPATH=[installdir('libdir')+",--enable-new-dtags"])
 
 # Give deheader a way to set compiler flags
 if 'MORECFLAGS' in os.environ:
@@ -536,7 +536,7 @@ else:
             # all systems.  Not good to use '.' or a relative path
             # here; it's a security risk.  At install time we use
             # chrpath to edit this out of RPATH.
-            env.Prepend(RPATH=[os.path.realpath(os.curdir)])
+            
env.Prepend(RPATH=[os.path.realpath(os.curdir)+",--enable-new-dtags"])
         else:
             print "chrpath is not available; forcing static linking."

NetBSD and FreeBSD accept the "--enable-new-dtags" syntax, but chrpath says 
RPATH.  The man page for their ld.so describes the precedence you need to test 
shared libraries.  It doesn't mention RUNPATH but testing indicates it works 
with either RPATH or RUNPATH. 

-- 
These are my opinions.  I hate spam.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]