Kurt Hornik <Kurt.Hornik@ci.tuwien.ac.at> writes:
Excerpt from Kurt's email this morning:
2) after configure (with CC=gcc but using AIX's linker
Makefile in src/library/tcltk/src doesn't protect the linker
with -Xlinker! (-Xlinker is required when using gcc so that the
are passed on to ld correctly. Which I know that you know...)
The fix is to add -Xlinker before every -bI. Sorry, haven't
patching configure yet...
Very strange. Configure has
*aix4.[2-9]*)
EXPORTFILE="\$(top_builddir)/etc/R.exp"
cpicflags=
cxxpicflags=
fpicflags=
wl="-Wl,"
main_ldflags="${wl}-bdynamic ${wl}-bE:${EXPORTFILE} ${wl}-bM:SRE"
shlib_ldflags="${wl}-bM:SRE ${wl}-H512 ${wl}-T512 ${wl}-bnoentry \
${wl}-bexpall ${wl}-bI:\$(R_HOME)/etc/R.exp"
SHLIB_LIBADD="\$(LIBM)"
;;
so unless I am missing something obvious all linker flages are
protected
via `-Wl,' (which should also work if the C compiler is not gcc).
Sorry, should have been more explicit, I guess: the problem is with
PKG_LIBS (which is the only variable in that Makefile using linker
flags...) Some digging shows that '-Wl,' (or '-Xlinker') is missing
in tkConfig.sh. So if you have Tcl/Tk (8.3 in my case) installed and
used AIX's 'cc' compiler, you get in trouble with later using gcc
(e.g. for R). Oddly, this didn't show when compiling, say, Tktable.
There is the question, why configure didn't "see" this coming. What
would be nice is a warning to the effect that tkConfig.sh is broken
when R can't compile tcltk.c. (Currently I get messages about libc.a
not found...)
This is asking for a bit much, I think. How would configure know for
sure that tkConfig.sh is broken?
I promise to get more sleep soon... 'What would be nice is a warning
to the effect that the Tcl/Tk configuration failed, like:
checking how to compile and link tcl/tk.... failed
' Asking about tkConfig.sh (or tclConfig.sh) is probably too muc as
threre are other factors that can cause the fail (config.site...).
What this would boil down to is trying to compile e.g. tkAppInit.c and
see whether compilation and linking works. But even this may
be asking fortoo much, this is just one architecture. Things like these
will continue to happen with AIX as long as there are those '.exp'
files around...
On second thought: the comment in tkConfig.sh says
# String to pass to linker to pick up the Tk library from its
# installed directory.
TK_LIB_SPEC='@TK_LIB_SPEC@'
so maybe this assumes to be called by ld directly ...
What happens if we omit TK_LIB_SPEC from TCLTK_LIBS?
hell breaks loose. TK_LIB_SPEC contains '-bI/some/path/libtk8.3.exp'
which is needed badly when linking on AIX.