[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: AIX and _nc_is_abs_path
From: |
Ben Lentz |
Subject: |
Re: AIX and _nc_is_abs_path |
Date: |
Mon, 16 Jun 2014 20:54:19 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 |
On 6/16/14, 6:32 PM, Thomas Dickey wrote:
On Mon, Jun 16, 2014 at 08:00:13AM -0400, Ben Lentz wrote:
Hello,
I'm trying to build ncurses-5.9 for AIX and I've found that
somewhere after 5.5 and starting with 5.8 and 5.9, a dependency on
the function _nc_is_abs_path was added in several places.
I've tried looking around (unsuccessfully) and I'm pretty sure I
don't have this function in any of the AIX system libraries.
I tried adding -UNCURSES_TERM_ENTRY_H_incl to CFLAGS while doing
./configure (I thought maybe the hooks in ./include/term_entry.h
would help me) but there are still references in tset.c.
If I set -UNCURSES_TERM_ENTRY_H_incl, hack out the references to
_nc_is_abs_path in tset.c, then the build proceeds further, but
dies linking toe:
no - the problem is before that
gcc -g
-Wl,-blibpath:/opt/local/bash/lib:/usr/lib:/lib,-brtl -maix64 ../obj_s/toe.o
-L/opt/local/bash/lib -I../progs -I.
The -blibpath option is expected for "--with-shared"
Actually the first -L option is unexpected, unless you've set LIBS or LDFLAGS
environment variables.
-DHAVE_CONFIG_H -I/opt/local/bash/include -D_ALL_SOURCE -DNDEBUG
-I. -I../include -I/opt/local/bash/include/ncurses
-I/opt/local/bash/include -UNCURSES_TERM_ENTRY_H_incl --param
max-inline-insns-single=1200 -L../lib -lncurses -L../lib -lncurses -o toe
The -L../lib is what you should be using (and would be overridden by the first
-L option)
ld: 0711-317 ERROR: Undefined symbol: ._nc_is_dir_path
ld: 0711-317 ERROR: Undefined symbol: ._nc_is_file_path
ld: 0711-317 ERROR: Undefined symbol: ._nc_first_db
ld: 0711-317 ERROR: Undefined symbol: ._nc_next_db
ld: 0711-317 ERROR: Undefined symbol: ._nc_last_db
I've read the INSTALL document and googled my heart out for this
issue and am trying this mailing list as a last resort before I
give in an revert back to an older version that compiles without
issue on AIX.
The problem is likely that there's an older version of ncurses in
/opt/local/bash/lib,
and the link is picking that. You can work around upgrades of this sort by
setting
the environment RPATH_LIST, e.g., to these two directories
../lib
/opt/local/bash/lib
The variable is a colon-separated list. Something like this:
(make distclean first, of course)
RPATH_LIST=../lib:/opt/local/bash/lib ./configure --with-shared
should produce makefile with that list embedded rather than just the single
directory.
However, setting LIBS or LDFLAGS to /opt/local/bash/lib will give problems.
That's what the --prefix and --exec-prefix options are for.
You're completely right... I had 5.5 without --with-shared (not
supported on 5.5 on AIX) in there beforehand. Some of the environment
variables are from a huge build script that I use to build open source
stuff. I can definitely empty these out if they're causing an issue with
the build system in ncurses.
After following your suggestion and emptying out the destination, I have
made more progress, except it seems there's now an issue with the make
install step.
On AIX, an unfortunate personality quirk is that the shared library file
extensions are .a instead of .so, and the .so files are archived into
the .a. This might be causing the 'make install' problem I'm having on
5.9. For example:
$ file /opt/local/curl/lib/libcurl.a
/opt/local/curl/lib/libcurl.a: archive (big format)
$ ar tv /opt/local/curl/lib/libcurl.a
rwxr-xr-x 0/0 3748939 Jun 01 22:59 2014 libcurl.so.4
$ ldd /opt/local/curl/bin/curl | grep libcurl.a
/opt/local/curl/lib/libcurl.a(libcurl.so.4)
$ ar xv /opt/local/curl/lib/libcurl.a
x - libcurl.so.4
$ file libcurl.so.4
libcurl.so.4: 64-bit XCOFF executable or object module not stripped
Here's the entire set of build steps. Notice I'm doing this with the
latest version of 5.9 I could find installed into a totally empty
directory (rm -rf $WHERE); and I'm getting a lot further. It's almost
like this is getting installed as a .a and it should be a .so
$ export WHERE=/opt/local/ncurses
$ export PATH="$WHERE/bin:$PATH"
$ export CFLAGS="-I$WHERE/include"
$ export CPPFLAGS=$CFLAGS
$ export LDFLAGS="-L$WHERE/lib"
$ export CC="gcc -g -Wl,-blibpath:$WHERE/lib:/usr/lib:/lib,-brtl -maix64"
$ export CXX="g++ -g -Wl,-blibpath:$WHERE/lib:/usr/lib:/lib,-brtl -maix64"
$ export OBJECT_MODE="64"
$ curl -sL
ftp://invisible-island.net/ncurses/current/ncurses-5.9-20140614.tgz |
gunzip | tar xf -
$ cd ncurses-5.9-20140614
$ rm -rf $WHERE
$ ./configure --prefix=$WHERE --mandir=$WHERE/share/man
--infodir=$WHERE/share/info --with-shared
...
$ make
...
$ make install
...
Target "install" is up to date.
installing ../lib/libncurses.a as /opt/local/ncurses/lib/libncurses.a
/mnt/sw/build/ncurses-5.9-20140614/install-sh -c -m 644
../lib/libncurses.a /opt/local/ncurses/lib/libncurses.a
ranlib /opt/local/ncurses/lib/libncurses.a
ar: 0707-108 File /opt/local/ncurses/lib/libncurses.a is not an archive
file.
ranlib: 0654-601 Execution of ar failed
Usage: ranlib [-t] [-X {32|64|32_64}] [--] file ...
make: 1254-004 The error code from the last command is 1.
Stop.
make: 1254-004 The error code from the last command is 2.
Stop.
$ file /opt/local/ncurses/lib/libncurses.a
/opt/local/ncurses/lib/libncurses.a: 64-bit XCOFF executable or object
module not stripped