chicken-hackers
[Top][All Lists]
Advanced

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

Re: [Chicken-hackers] [ANN]: Port Chicken to AIX


From: Erik Falor
Subject: Re: [Chicken-hackers] [ANN]: Port Chicken to AIX
Date: Thu, 10 Oct 2013 16:38:40 -0600
User-agent: Mutt/1.5.21 (2010-09-15)

On Fri, Aug 16, 2013 at 09:06:42PM +0200, Peter Bex wrote:
> On Fri, Aug 16, 2013 at 12:32:40PM -0600, Erik Falor wrote:
> > * In other news, I'm making (slow) progress in getting `make check` to
> >   work.  I was finally able to solve the problem with the 'private
> >   repository' test by letting AIX use the vanilla branch of Unix code in
> >   chicken.h's C_path_to_executable().  I tried a few platform-specific
> >   methods of determining that information, but it seems that AIX's /proc
> >   just doesn't keep track of the full path of a running image.
> > 
> > * `make check` now fails on the final "deployment tests" in runtests.sh,
> >   which I'm working on now.
> >   The final test builds a little program called rev-app/rev-app under
> >   the tests/ directory.  That program fails to run because it cannot
> >   find libchicken.so.
> 
> This is great news.  You're making good progress.
> 
> > * I also figured out what I did wrong in Makefile.aix that led me to
> >   hardcoding AIX-specific linker flags into csc.scm.  I didn't specify
> >   a value for the Make variable LINKER_OPTIONS, so that info wasn't
> >   propagated into the csc program.
> 
> I'm still not sure how this is supposed to work :)
> 
> > * While inspecting the code I put into Makefile.aix, I went through
> >   all of the #defines that are echoed into chicken-config.h, making
> >   sure that they are correct for my platform.  I notice that while
> >   these macros are present in chicken-config.h, they don't seem to be
> >   referenced by Chicken itself.  Are they there as insurance against
> >   the future, or are they leftover cruft from versions gone by?
> 
> Most of them should be referenced, but maybe there's some historical
> cruft.  We should probably cull these at some point.
> 
> Cheers,
> Peter

It's been a while since I've posted my progress with porting CHICKEN
to AIX.  School started for me and I've been a bit busy because of
that.  However, over this past weekend and through lunch breaks and
late nights I've been able to pick this up again and make a bit of
progress.  It's not finished quite yet, but I feel like I'm close.

I have been stuck with getting csc's -deploy mode to work.  For those
who aren't familiar with that behavior, it makes binaries that look
for their needed shared libraries in the same directory as the binary
itself is stored.  On Linux, this is implemented by compiling binaries
with the -Wl,-R"\$ORIGIN" flag.  This puts the string '$ORIGIN" into
the ELF metadata's rpath field which is interpreted by the loader as
"this binary's own directory".

On AIX (which uses XCOFF binaries instead of ELF) this effect is
achieved in a slightly different way: depending upon which mode the
linker is run under, you can might be able to use the -Wl,-L. flag to
get this behavior. (-Wl,-R. means something different to AIX's version
of ld(1); and as I discovered late last night, having it occur on
gcc's command line too many times yields a incorrectly linked binary).

I've had to go through all of the Makefile's LINKER_* variables to
make sure that I'm not blindly prepending '.' onto every CHICKEN
program: we don't want to load a libchicken.so that happens to be
sitting around wherever csc, csi, chicken-status, etc. are located.

I think I'm getting close...

The problem I'm having now is that when I try to be more selective
with the linker arguments I get binaries that either don't have an
entry point, can't find libchicken.so no matter where it is, or
chicken(1) throws a "nursery size too small" panic.

Wish me luck!

-- 
Erik Falor                                       http://unnovative.net
Registered Linux User #445632                  http://linuxcounter.net

Attachment: signature.asc
Description: Digital signature


reply via email to

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