Bug#372517: libtool builds non-PIC shared libraries with AC_DISABLE_STATIC and --enable-static
close 372517 thanks Le Samedi 10 Juin 2006 00:48, Ralf Wildenhues a écrit : I have not heard of such behavior before (that I remember), and cannot reproduce it with the test below. Could you show what you did differently to expose this? Ops. My fault. There was an underlying not-so-convenient library that was built with -static in _LDFLAGS then linked into the shared ones. Sorry for bothering. -- Rémi Denis-Courmont http://www.remlab.net/
Bug#372517: libtool builds non-PIC shared libraries with AC_DISABLE_STATIC and --enable-static
Package: libtool Version: 1.5.22-4 Severity: normal Hello, When passing the --enable-static option to the configure script of a package that has disabled static libraries by default using AC_DISABLE_STATIC in its configure.ac, both static and *shared* libraries that libtool builds are non-PIC. Shared libraries should NEVER EVER be non-PIC. This is fairly annoying considering that Debian policy recommends that both shared and static libraries be provided (policy §8.3), and mandates that shared libraries be PIC (policy §10.2). Regards, -- System Information: Debian Release: testing/unstable APT prefers unstable APT policy: (500, 'unstable'), (500, 'testing') Architecture: i386 (i686) Shell: /bin/sh linked to /bin/dash Kernel: Linux 2.6.16.20 Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8) Versions of packages libtool depends on: ii autotools-dev 20060223.1 Update infrastructure for config.{ ii cpp 4:4.1.1-1 The GNU C preprocessor (cpp) ii file 4.17-1 Determines file type using magic ii gcc [c-compiler] 4:4.1.1-1 The GNU C compiler ii gcc-3.3 [c-compiler] 1:3.3.6-13 The GNU C compiler ii gcc-4.1 [c-compiler] 4.1.1-2The GNU C compiler ii libc6-dev [libc-dev] 2.3.6-15 GNU C Library: Development Librari Versions of packages libtool recommends: ii libltdl3-dev 1.5.22-4 A system independent dlopen wrappe -- no debconf information
Bug#372517: libtool builds non-PIC shared libraries with AC_DISABLE_STATIC and --enable-static
Hello Rémi, * Rémi Denis-Courmont wrote on Fri, Jun 09, 2006 at 10:34:43PM CEST: When passing the --enable-static option to the configure script of a package that has disabled static libraries by default using AC_DISABLE_STATIC in its configure.ac, both static and *shared* libraries that libtool builds are non-PIC. Shared libraries should NEVER EVER be non-PIC. I have not heard of such behavior before (that I remember), and cannot reproduce it with the test below. Could you show what you did differently to expose this? Cheers, Ralf $ cat configure.ac AC_INIT([non-pic-shared], [1], [devnull]) AM_INIT_AUTOMAKE([foreign]) AC_CONFIG_FILES([Makefile]) AC_PROG_CC AC_DISABLE_STATIC AC_PROG_LIBTOOL AC_OUTPUT $ cat Makefile.am lib_LTLIBRARIES = libfoo.la $ touch libfoo.c $ autoreconf -v -i $ ./configure --enable-static $ make | grep -i pic gcc -DPACKAGE_NAME=\a\ -DPACKAGE_TARNAME=\a\ -DPACKAGE_VERSION=\1\ -DPACKAGE_STRING=\a 1\ -DPACKAGE_BUGREPORT=\b\ -DPACKAGE=\a\ -DVERSION=\1\ -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -I. -I. -g -O2 -c libfoo.c -fPIC -DPIC -o .libs/libfoo.o