On Jul 25, 2016 7:22 AM, "Robin Becker" <[email protected]> wrote: > > I'm trying to reduce the size of the reportlab manylinux builds. and have a couple of problems. > > 1) I don't know how to detect a manylinux platform in my setup.py. A simple solution is to use an evironment variable to change behaviour, but I assume there is to be some official os name or platform. Currently I see something like this > >> platform=Linux-3.16.0-50-generic-x86_64-with-redhat-5.11-Final >> sys.platform=linux2 >> os.name=posix
There isn't any special os name or platform. A manylinux build is just a Linux build that you intend to satisfy some extra requirements, and there's no way to autodetect your intent :-). So you'll probably want to specify with an envvar or whatever's convenient. > 2) Even when I do change behaviour to try and get a static linkage of say freetype agains my code I'm getting linkage errors. Static linkage is said to be OK in pep 513, but I don't know how to get the multi build code to do it. > > I have checked and there are .a files being produced, but it seems they have the wrong compile time flags my error looks like > >> /opt/rh/devtoolset-2/root/usr/libexec/gcc/x86_64-CentOS-linux/4.8.2/ld: /usr/local/lib/libfreetype.a(ftinit.o): relocation R_X86_64_32 against `tt_driver_class' can not be used when making a shared object; recompile with -fPIC > > > I suppose I need to create a library of the .o files created for the shared build. Then I can link against that .a rather than the non shared one. Yep. Many build systems assume that static libraries will only be linked into executables, not into shared libraries, so they have the wrong defaults for what you're trying to do. It might be enough just to force -fPIC into the compiler command line, by setting CFLAGS or whatever this build system respects. -n
_______________________________________________ Wheel-builders mailing list [email protected] https://mail.python.org/mailman/listinfo/wheel-builders
