From LGualano at daronmont.com.au Wed Jan 5 01:16:30 2005 From: LGualano at daronmont.com.au (Luciano Gualano) Date: Wed, 5 Jan 2005 17:16:30 +1100 Subject: [Pymilter] Milter build error Message-ID: <4796E5655CD4D71189BB0008C7FAB3630C51EA@pd002025.daronmont.com.au> Hi, Trying to build Milter module 7.1 using Python 2.4, but encountering the following build error: running build running build_py running build_ext building 'milter' extension creating build/temp.linux-x86_64-2.4 gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -DMAX_ML_REPLY=32 -I/usr/include/python2.4 -c miltermodule.c -o build/temp.linux-x86_64-2.4/miltermodule.o In file included from /usr/include/python2.4/Python.h:8, from miltermodule.c:152: /usr/include/python2.4/pyconfig.h:835:1: warning: "_POSIX_C_SOURCE" redefined In file included from /usr/include/pthread.h:18, from miltermodule.c:150: /usr/include/features.h:172:1: warning: this is the location of the previous definition gcc -pthread -shared build/temp.linux-x86_64-2.4/miltermodule.o -lmilter -lsmutil -o build/lib.linux-x86_64-2.4/milter.so /usr/bin/ld: /usr/lib/gcc-lib/x86_64-redhat-linux/3.2.3/../../../../lib64/libmilter.a(mai n.o): relocation R_X86_64_32S can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc-lib/x86_64-redhat-linux/3.2.3/../../../../lib64/libmilter.a: could not read symbols: Bad value collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 Any help would be much appreciated. Regards Looch From stuart at bmsi.com Wed Jan 5 11:30:09 2005 From: stuart at bmsi.com (Stuart D. Gathman) Date: Wed, 5 Jan 2005 11:30:09 -0500 (EST) Subject: [Pymilter] Milter build error In-Reply-To: <4796E5655CD4D71189BB0008C7FAB3630C51EA@pd002025.daronmont.com.au> Message-ID: On Wed, 5 Jan 2005, Luciano Gualano wrote: > gcc -pthread -shared build/temp.linux-x86_64-2.4/miltermodule.o -lmilter > -lsmutil -o build/lib.linux-x86_64-2.4/milter.so > /usr/bin/ld: > /usr/lib/gcc-lib/x86_64-redhat-linux/3.2.3/../../../../lib64/libmilter.a(mai > n.o): relocation R_X86_64_32S can not be used when making a shared object; > recompile with -fPIC > /usr/lib/gcc-lib/x86_64-redhat-linux/3.2.3/../../../../lib64/libmilter.a: libmilter.a is part of sendmail. The sendmail RPM you are using doesn't compile it with -fPIC. It needs to if the lib is going to be statically linked with a dynamic module on x86_64. We don't want another dynamic library cluttering up the sendmail runtime, and Python modules must be dynamic (unless you want to get involved in adding a static module to the Python RPM). So I recommend changing the sendmail RPM to compile libmilter.a with -fPIC, at least on x86_64. You could try it out first by building the RPM (for sendmail), then going to the BUILD directory and changing the Makefile and recompiling just libmilter.a. Replace libmilter.a with that version - or arrange for the pymilter link to use the alternate version (e.g. cp libmilter.a /usr/lib/libmilterpic.a, and use -lmilterpic on pymilter link command). -- Stuart D. Gathman Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154 "Confutatis maledictis, flamis acribus addictis" - background song for a Microsoft sponsored "Where do you want to go from here?" commercial.