Bug 503

Summary: Sudo 1.8.x using xlc on aix 7 build fails on libsudoers.a
Product: Sudo Reporter: Kevin Brott <bugzil>
Component: ConfigureAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED FIXED    
Severity: normal    
Priority: normal    
Version: 1.8.0   
Hardware: IBM   
OS: AIX   
Attachments: sudo-1.8.2rc10 config.log using IBM xlc on AIX 7100-00-03-1115

Description Kevin Brott 2011-08-10 18:31:16 MDT
All versions of sudo from 1.8.0 to 1.8.2rc9 manifest this build error.
sudo 1.7.6p2 builds and runs fine.

./configure runs fine - build comes to this point and pukes.

...
/usr/bin/ksh ../../libtool --mode=link xlc -o libsudoers.la alias.lo audit.lo defaults.lo gram.lo match.lo pwutil.lo timestr.lo toke.lo toke_util.lo redblack.lo -no-install
libtool: link: ar cru .libs/libsudoers.a  alias.o audit.o defaults.o gram.o match.o pwutil.o timestr.o toke.o toke_util.o redblack.o
libtool: link: ranlib .libs/libsudoers.a
libtool: link: ( cd ".libs" && rm -f "libsudoers.la" && ln -s "../libsudoers.la" "libsudoers.la" )
/usr/bin/ksh ../../libtool  --mode=link xlc   -Wl,-bI:./aixcrypt.exp  -o sudoers.la sudo_auth.lo aix_auth.lo boottime.lo check.lo env.lo goodpath.lo group_plugin.lo find_path.lo interfaces.lo logging.lo logwrap.lo parse.lo set_perms.lo sudoers.lo sudo_nss.lo iolog.lo iolog_path.lo  libsudoers.la -ls   ../../common/libcommon.la ../../compat/libreplace.la   -lz -module -export-symbols ./sudoers.sym -avoid-version -rpath /opt/tools/libexec
libtool: link: rm -fr  .libs/libsudoers.a .libs/libsudoers.la
libtool: link: (cd .libs/sudoers.lax/libsudoers.a && ar x "/lppdir/build/sudo/sudo-1.8.2rc9/plugins/sudoers/./.libs/libsudoers.a")
ar: 0707-100 /lppdir/build/sudo/sudo-1.8.2rc9/plugins/sudoers/./.libs/libsudoers.a does not exist.
gmake[1]: *** [sudoers.la] Error 1
gmake[1]: Leaving directory `/lppdir/build/sudo/sudo-1.8.2rc9/plugins/sudoers'
gmake: *** [all] Error 2
Comment 1 Todd C. Miller 2011-08-11 09:41:19 MDT
It sounds like libtool is getting confused between the sudoers.so loadable module and the libsudoers convenience library.  Can you give the following a try and see if the problem persists?  It has libsudoers renamed to libparsesudoers.  I don't have access to an AIX machine with xlc installed to test it myself.

ftp://ftp.sudo.ws/pub/millert/sudo/sudo-1.8.2rc10.tar.gz
Comment 2 Kevin Brott 2011-08-11 12:38:33 MDT
It gets further in rc10 ... 
...
/usr/bin/ksh ../libtool  --mode=link xlc -o sudo conversation.o error.o exec.o exec_pty.o get_pty.o net_ifs.o load_plugins.o parse_args.o sudo.o sudo_edit.o tgetpass.o ttysize.o utmp.o  preload.o  ../plugins/sudoers/sudoers.la    ../common/libcommon.la ../compat/libreplace.la -static-libtool-libs
libtool: link: xlc -o sudo conversation.o error.o exec.o exec_pty.o get_pty.o net_ifs.o load_plugins.o parse_args.o sudo.o sudo_edit.o tgetpass.o ttysize.o utmp.o preload.o  ../plugins/sudoers/.libs/libsudoers.a -ls -lz ../common/.libs/libcommon.a ../compat/.libs/libreplace.a
ld: 0711-317 ERROR: Undefined symbol: error_jmp
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
gmake[1]: *** [sudo] Error 8
gmake[1]: Leaving directory `/lppdir/build/phs-sudo/sudo-1.8.2rc10/src'
gmake: *** [all] Error 2

I'm going to gen a loadmap and see if I can work out what's missing
Comment 3 Todd C. Miller 2011-08-11 13:20:48 MDT
It appears that configure didn't detect shared module support.  That is why it is linking libsudoers.a statically and building preload.c.  Can you attach the config.log file?
Comment 4 Kevin Brott 2011-08-11 13:33:56 MDT
Loadmap ...
(ld): halt 4
(ld): setfflag 4
(ld): savename sudo
(ld): filelist 23 1
(ld): i /lib/crt0.o
(ld): i conversation.o
(ld): i error.o
(ld): i exec.o
(ld): i exec_pty.o
(ld): i get_pty.o
(ld): i net_ifs.o
(ld): i load_plugins.o
(ld): i parse_args.o
(ld): i sudo.o
(ld): i sudo_edit.o
(ld): i tgetpass.o
(ld): i ttysize.o
(ld): i utmp.o
(ld): i preload.o
(ld): i ../plugins/sudoers/.libs/libsudoers.a
(ld): lib /usr/lib/libs.a
(ld): lib /usr/lib/libz.a
(ld): i ../common/.libs/libcommon.a
(ld): i ../compat/.libs/libreplace.a
(ld): lib /usr/vac/lib/libxlopt.a
(ld): lib /usr/vac/lib/libxlipa.a
(ld): lib /usr/vac/lib/libxl.a
LIBRARY: Shared object libs.a[shr.o]: 3244 symbols imported.
LIBRARY: Shared object libs.a[meth.o]: 2 symbols imported.
LIBRARY: Shared object libs.a[posix_aio.o]: 20 symbols imported.
LIBRARY: Shared object libs.a[aio.o]: 18 symbols imported.
LIBRARY: Shared object libs.a[pse.o]: 8 symbols imported.
LIBRARY: Shared object libs.a[dl.o]: 4 symbols imported.
LIBRARY: Shared object libs.a[pty.o]: 1 symbols imported.
LIBRARY: Shared object libz.a[libz.so.1]: 72 symbols imported.
FILELIST: Number of previously inserted files processed: 23
(ld): resolve
RESOLVE: 1005 of 9051 symbols were kept.
(ld): addgl /usr/lib/glink.o
ADDGL: Glink code added for 167 symbols.
(ld): er full
ld: 0711-318 ERROR: Undefined symbols were found.
        The following symbols are in error:
 Symbol                    Inpndx  TY CL Source-File(Object-File) OR Import-File{Shared-object}
                              RLD: Address  Section  Rld-type Referencing Symbol
 ----------------------------------------------------------------------------------------------
 error_jmp                 [70]    ER UA ./iolog.c(../plugins/sudoers/.libs/libsudoers.a[iolog.o])
                                   00001714 .data    R_POS    [72]    <error_jmp>
 error_jmp                 [61]    ER UA ./logging.c(../plugins/sudoers/.libs/libsudoers.a[logging.o])
                                   00001c1c .data    R_POS    [63]    <error_jmp>
 error_jmp                 [92]    ER UA ./sudoers.c(../plugins/sudoers/.libs/libsudoers.a[sudoers.o])
                                   0000361c .data    R_POS    [94]    <error_jmp>
ER: The return code is 8.

Just FYI - AIX native libraries are all named .a
Comment 5 Kevin Brott 2011-08-11 13:38:19 MDT
Created attachment 313 [details]
sudo-1.8.2rc10 config.log using IBM xlc on AIX 7100-00-03-1115
Comment 6 Todd C. Miller 2011-08-11 14:52:50 MDT
It looks like the version of libtool sudo's configure was built with doesn't properly support AIX 7.  I've updated libtool and autoconf for sudo 1.8.2rc11.  Please try:

ftp://ftp.sudo.ws/pub/millert/sudo/sudo-1.8.2rc11.tar.gz
Comment 7 Kevin Brott 2011-08-11 15:03:23 MDT
Excellent!
sudo-1.8.2rc11 - builds and passes 'make check' on this platform!
I'd call that fixed. :)
Thanks!