Pythin-2.2.1 install on Solaris question.

Andrew Koenig ark at research.att.com
Thu Oct 17 09:29:17 EDT 2002


Hennie> During "make install" the following errors are displayed for all
Hennie> modules: (using the pwd module as example)

Hennie> building 'pwd' extension
Hennie> /usr/local/bin/gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC
Hennie> -I. -I/usr/local/src/Python-2.2.1/./Include -I/usr/local/include
Hennie> -IInclude/ -c /usr/local/src
Hennie> /Python-2.2.1/Modules/pwdmodule.c -o
Hennie> build/temp.solaris-2.8-sun4u-2.2/pwdmodule.o
Hennie> /usr/local/bin/gcc -shared
Hennie> build/temp.solaris-2.8-sun4u-2.2/pwdmodule.o -L/usr/local/lib -o
Hennie> build/lib.solaris-2.8-sun4u-2.2/pwd.so
Hennie> WARNING: removing "pwd" since importing it failed

Hennie> Why is this happening ? What am I doing wrong ?

What happens if you run the following shell script?  If it dumps core,
your linker is broken.

#! /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.$$



-- 
Andrew Koenig, ark at research.att.com, http://www.research.att.com/info/ark



More information about the Python-list mailing list