[M3devel] rpath woes

Jay K jay.krell at cornell.edu
Fri Jun 5 06:16:24 CEST 2015


 The FreeBSD4 users were surprisingly vocal surprisingly recently.
 So I put some work into it.
 I agree it is an old system.
 
 
 Linux.common and FreeBSD.common look very similar but I agree different
 and if it is working for you, good, I can ignore it?

 
 I guess the main thing was "-Wl,-z,origin"? Needed to make $ORIGIN work?
 Was this right for FreeBSD 5 or 6 or 7 or 8?
 

 Dragonfly should be fairly easy...though it is a bit more work than is ideal. 

 
The main thing is we still have lists of targets. 
 Look in m3-sys/m3middle/src/Target.* 
 Soon hopefully the jmpbuf there will go away. That will help. 
 Areas to port are easy to find with grep/findstr: 
 
 
C:\dev2\cm3\m3-libs\libm3>findstr /m /s /i OPENBSD *
 src\os\POSIX\m3makefile 
 src\os\POSIX\m3makefile-old 
 src\uid\POSIX\getMID.c 
 src\uid\POSIX\MachineIDPosixC.c 
 tests\random\src\m3makefile 
 

C:\dev2\cm3\m3-libs\m3core>findstr /m /s /i OPENBSD *
 src\atomic\m3makefile 
 src\C\Common\Cstring.i3 
 src\Csupport\Common\lround-readme.txt 
 src\Csupport\Common\s_llroundl.c 
 src\Csupport\Common\s_lround.c 
 src\Csupport\Common\s_lroundl.c 
 src\Csupport\m3makefile-old 
 src\float\m3makefile 
 src\float\m3makefile-old 
 src\m3core.h 
 src\runtime\POSIX\RTSignalC.c 
 src\thread\POSIX\ThreadPosixC.c 
 src\thread\PTHREAD\m3makefile 
 src\thread\PTHREAD\ThreadOpenBSD.c 
 src\thread\PTHREAD\ThreadPThreadC.c 
 src\time\POSIX\m3makefile.old 
 src\unix\Common\Ustat.i3 
 src\unix\m3makefile 
 src\unix\m3makefile-old 
 

 C:\dev2\cm3\m3-sys\m3middle>findstr /m /s /i OPENBSD * 
 src\Target.i3 
 src\Target.i3-old 
 src\Target.m3 
 src\Target.m3-old 
 

 This looks scarier than it is. 
 Many cases are just to add to a list of platforms you are close enough to. 
 Some cases I hope to eliminate -- cooperative suspend will cut out a swath for example. 
 

Thanks,
 - Jay



 
> Date: Fri, 5 Jun 2015 00:28:36 +0200
> From: adacore at marino.st
> To: jay.krell at cornell.edu; m3devel at elegosoft.com
> Subject: Re: [M3devel] rpath woes
> 
> On 6/4/2015 20:10, John Marino wrote:
> > On 6/4/2015 20:05, Jay K wrote:
> >> My understanding:
> >> The modula-3 libraries, e.g. m3core,
> >> are found from the rpath I put in, like
> > 
> >> $ORIGIN:$ORIGIN/../lib
> >> Other libraries like libc.so are found by full path, that is already
> >> correct at build time?
> >> Do users want to possibly have a private /usr/local/lib/libc.so?
> >> I hadn't considered that.
> >> Or build is "staged" and the full paths aren't correct at build time?
> >> I think I hadn't considered that either.
> >> You are on the right track, looking in this area.
> >> Did you notice the "portable rpath" thingy that make-dist.py changes?
> > 
> > I believe make-dist.py is hard-coding portable rpath which means it's
> > hardcoding $ORIGIN I think, but it's not working.
> > 
> > The origin flag is set, but $ORIGIN itself is not.  I think this is a bug.
> > 
> > We prefer to use hardcoded rpaths in ports, but I will settle for
> > $ORIGIN if it works.  $ORIGIN works on FreeBSD and DragonFly, but not
> > NetBSD (not sure about OpenBSD, I'd guess it does though).
> > 
> > The "-Wl,rpath," looks wrong to me, but sticking $ORIGIN here didn't
> > work either.
> 
> Okay, I have this solved.
> The problem is FREEBSD.common is obsolete (origin linker flags were
> wrong)  I basically copied LINUX.common contents to it and now
> everything works as expected.
> 
> I've updated the port here:
> http://www.freshports.org/lang/modula3/
> 
> The patch for FREEBSD.common is here:
> https://svnweb.freebsd.org/ports/head/lang/modula3/files/
> 
> I think all references to FREEBSD4 could be removed (as I did in the
> patch).  FreeBSD4 was EOL in Jan 2007.
> 
> So I'm basically done until its time to change the port to use the C
> backend (and/or bootstrap it to DragonFly)
> 
> John
> 
> 
> 
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20150605/4d70b249/attachment-0002.html>


More information about the M3devel mailing list