[augeas-devel] augeas on AIX

Kristof Willaert kristof.willaert at gmail.com
Fri Jun 19 09:55:42 UTC 2009


David,

sorry for the late reply.

[snip]

>> The getopt_long function does not exist in AIX libc, and there is no substitute
>> in gnulib. So I kind of mangled the source and used getopt instead (getopt_long
>> only adds the --noload and --nostdinc arguments I think, and just to
>> get it to compile
>> they were not crucial).
>> There is definitely a better way to fix this, but due to my lack of C skills ...
>
> The 'getopt' module from gnulib actually contains getopt_long,
> unfortunately, it's licensed LGPLv3 - I need to see if I can get the
> gnulib maintainers to relicense it.
>
> In the meantime, it would be great if you could post a patch of what you
> did (a simple unified diff is good enough)

I'm quite ashamed to tell I just ripped out the "_long" from getopt_long, so
some options are not available from the resulting binaries. I just wanted to get
a working binary first.
Diff is attached.

>> The second problem was a "referenced symbol not found" error in libfa.
>> Asprintf (and vasprintf) is missing from the AIX libc. Configure notices that:
>>
>> checking for vasprintf... no
>>
>> and make compiles asprintf.c and vasprintf.c in gnulib/lib.
>> But these are not linked into libfa.
>
> This is very strange - and it definitely works on other non-glibc
> systems, like FreeBSD. The Makefile does link libfa with gnulib ... do
> you have the errors from make ?

Adding gnulib to src/Makefile.in for libfa make the thing compile and
run with segfaulting:

libfa_la_LIBADD = $(GNULIB)

Had to force make to use the gnu ld instead of the AIX ld. AIX ld gave me:

gcc -shared -o .libs/libaugeas.so.0  .libs/augeas.o .libs/pathx.o
.libs/internal.o .libs/memory.o .libs/syntax.o .libs/parser.o
.libs/builtin.o .libs/lens.o .libs/regexp.o .libs/transform.o
.libs/ast.o .libs/get.o .libs/put.o  ./.libs/liblexer.a
../gnulib/lib/.libs/libgnu.a
-Wl,-blibpath:/tmp/augeas-0.5.0/src/.libs:/usr/local/lib:/opt/freeware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.2.0:/opt/freeware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.2.0/../../..:/usr/lib:/lib
-L./.libs -lfa -lc -Wl,-bnoentry  -Wl,-M -Wl,./augeas_sym.version
-Wl,-bE:.libs/libaugeas.exp ${wl}-berok
ld: 0711-715 ERROR: File ./augeas_sym.version cannot be processed.
        The file must be an object file, an import file, or an archive.
collect2: ld returned 8 exit status
make[3]: *** [libaugeas.la] Error 1
make[3]: Leaving directory `/tmp/augeas-0.5.0/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/tmp/augeas-0.5.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/augeas-0.5.0'
make: *** [all] Error 2

> Excellent ! I've been building/testing Augeas on OpenSolaris, but
> getting it to work on Solaris proper would be really cool.

Building on Solaris 10 was actually quite easy. The only thing I had
to change was making sure
gnulib was linked into libfa.

I just changed src/Makefile.in to read:

libfa_la_LIBADD = $(GNULIB)

This should probably be done  in Makefile.am though.

I compiled with gcc 3.4.5 and used the native Solaris ld.

>> Augtool print output below. I removed all lenses except the
>> aliases.aug, util.aug and
>> sudoers.aug to simplify things (aliases file and sudoers are
>> syntactically the same on all unices I think):
>
> sudoers and aliases are actually syntactically quite different, at least
> on Linux.

I meant to say sudoers file is the same on both Linux, Solaris, AIX, ...,
as is the aliases file. So the lenses that work for these files on Linux should
give me no problems on Solaris, AIX.

> If you feel really adventurous and have a debugger handy, you might want
> to break on transform_load and step through it, in particular through
> filter_generate and load_file.

Did that, output in attachment. But I am really not qualified to
interpret what gdb spits out.

Kind regards,

kristof
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gdb.out
Type: application/octet-stream
Size: 44049 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20090619/69668e26/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diff
Type: application/octet-stream
Size: 3135 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20090619/69668e26/attachment-0001.obj>


More information about the augeas-devel mailing list