
I now believe, after discussion with the binutils developers, that the problem is that -zcombreloc just plain doesn't work in any release of binutils. One implication of this fact is that turning on -znocombreloc when building python is insufficient to make it work if you built gcc with -zcombreloc, because that build will write dynamic libraries that the Sun loader cannot handle no matter what.
So I think you are right -- the correct fix is to warn people that they should not use binutils 2.13 on Solaris, period. I believe that they will fix the problem in 2.13.1 and will let you know.
Meanwhile, might I suggest including the following test somewhere in the build procedure? If it fails, I believe it will not be possible to build Python successfully, so one might as well find about it early....
If you run this and the output includes "core dumped', it failed :-)
-------------------------cut here---------------------- #! /bin/sh
mkdir /tmp/t.$$ || exit 3 cd /tmp/t.$$ || exit 3
cat >main.c <<'EOF' #include <stdio.h> #include <dlfcn.h>
int main(void) { void *handle, *sym; char *error;
puts("calling dlopen"); handle = dlopen("./dyn.so", RTLD_NOW); if (!handle) { printf("%s\n", dlerror()); return 1; }
puts("calling dlsym"); sym = dlsym(handle, "sym"); if ((error = dlerror()) != 0) { printf("%s\n", error); return 1; } puts("calling sym"); ((void (*)(void))sym)(); puts("done"); return 0; } EOF
cat >dyn.c <<'EOF' #include <stdio.h> void sym(void) { puts("in sym"); } EOF
[ -n "$SHFLAGS" ] || SHFLAGS="-fPIC -shared" [ -n "$CC" ] || CC=gcc
set -x
$CC $CFLAGS $SHFLAGS dyn.c -o dyn.so $CC $CFLAGS main.c -o main -ldl
./main || exit $?
cd /tmp rm -rf t.$$

Meanwhile, might I suggest including the following test somewhere in the build procedure? If it fails, I believe it will not be possible to build Python successfully, so one might as well find about it early....
If you run this and the output includes "core dumped', it failed :-)
I hope someone does this. In the mean time, I've added a warning about binutils 2.13 to the README file (and also to the 2.2.2 branch README file).
--Guido van Rossum (home page: http://www.python.org/~guido/)

ark> So I think you are right -- the correct fix is to warn people that ark> they should not use binutils 2.13 on Solaris, period. I believe that ark> they will fix the problem in 2.13.1 and will let you know.
I received a fix this morning from one of the binutils developers and am testing it now. The good news is that the Python build has gotten further than it did last time, so I'm going to try rebuilding gcc with the fixed binutils 2.13 and then rebuilding Python.
That process takes about 16 hours of cpu time, so don't expect to hear from me until tomorrow at the earliest.
The bad news is that the fix is specific to Solaris, which means that installing it breaks the linker for Sparc/Linux. They are now trying to figure out how to fix it in a way that does not break Linux; obviously, they're not going to put it in a release until they have one that works on both operating systems.
More news as I get it.
participants (2)
-
Andrew Koenig
-
Guido van Rossum