[M3devel] runpath/unshipped vs. shipped binaries

Jay jay.krell at cornell.edu
Mon Apr 6 10:43:52 CEST 2009


Good point thanks, /usr/random better than /tmp/random.
 I'd build as root, so you are safe from non-root, or somesuch.
Hopefully it'll become moot.
I have made progress inserting $ORIGIN at the front already.
I need to double check if that is /cm3/lib or /cm3/pkg/foo/linuxlibc6.
Hopefully /cm3/lib.
And then see about removing the rest.
Solaris is looking good, at least.
NetBSD doesn't support $origin.
(but hey, my NetBSD machine is booted to FreeBSD currently, where, besides these issues, I want to switch to the new/small/portable Unix/*.i3 files :) )
 
 
Ok, Linux/x86 is looking good.
Just a tad ugly, you end up with "../lib" for each level in the dependency tree:
 
ldd -v /cm3/bin/Juno:
 
libm3X11R4.so.5 => /home/jay/cm3/bin/../lib/../lib/libm3X11R4.so.5
 
but that's ok.
 
 
Pray tell, what's the difference between RPATH and RUNPATH?
 
objdump -f -x /cm3/bin/Juno
 
Dynamic Section:
  NEEDED      libjuno-compiler.so.5
  NEEDED      libjuno-machine.so.5
  NEEDED      libm3formsvbt.so.5
  NEEDED      libm3vbtkit.so.5
  NEEDED      libm3ui.so.5
  NEEDED      libm3netobj.so.5
  NEEDED      libm3.so.5
  NEEDED      libm3core.so.5
  NEEDED      libc.so.6
  RPATH       $ORIGIN/../lib
  RUNPATH     $ORIGIN/../lib
 
 - Jay


----------------------------------------
> Date: Mon, 6 Apr 2009 01:35:42 -0700
> From: carson at taltos.org
> To: jay.krell at cornell.edu
> CC: m3devel at elegosoft.com
> Subject: Re: [M3devel] runpath/unshipped vs. shipped binaries
>
> BTW, I'm glad you're working on this, I just want to make sure we end up
> someplace better ;-)
>
> Jay wrote:
>> Well, the big polluted runpath is how Modula-3 has always built
>> things. The only reason for /tmp/tmprandom is because I build up an
>> entire new install from scratch. Otherwise it would be
>> /usr/local/cm3/pkg/... or such. If you look at the distributions Olaf
>> has put out you can see he does similar. I think the Tinderbox builds
>> are the same.
>
> The problem with using /tmp is that _any_ user can throw their own .so's
> in there. Bogus /usr/... paths are still unfortunate, but not a security
> nightmare like /tmp/... paths are.
>
> It may be that re-organizing the build system to behave better is more
> work than you have time for at the moment, and throwing in a $ORIGIN
> RPATH isn't a bad thing even if you don't fix the rest. But please don't
> ship binaries with an RPATH containing /tmp - someone will hurt themselves.
>
> --
> Carson


More information about the M3devel mailing list