Bug 27215

Summary: ./configure --with-pic doesn't have any effect
Product: dbus Reporter: Sascha Silbe <sascha-web-bugs.freedesktop.org>
Component: coreAssignee: Havoc Pennington <hp>
Status: RESOLVED DUPLICATE QA Contact: John (J5) Palmieri <johnp>
Severity: minor    
Priority: low    
Version: 1.2.x   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Sascha Silbe 2010-03-20 14:08:06 UTC
configure advertises the --with-pic (--without-pic) option, but it doesn't have any effect because the PIC/PIE flags are always enabled in configure.in if the compiler supports them.
Comment 1 Thiago Macieira 2010-03-20 14:36:39 UTC
Should remove the flag then.

Or they part of stock autoconf?
Comment 2 Simon McVittie 2011-02-01 11:19:29 UTC
--with-pic, --without-pic are provided by libtool, which normally generates PIC for shared libraries, but not for static libraries. We link dbus-daemon and other D-Bus executables to a static version of libdbus, which lets them use certain APIs that aren't normally public.

We try to use -fPIE for dbus-daemon, so we can have a PIE (position-independent executable) dbus-daemon, which is good for avoiding system-bus exploits (you have to use PIC or PIE code for address space layout randomization to be effective). However, this requires us to force PIC code to be used in the static version of libdbus.

Why don't you want PIC code to be generated?
Comment 3 Sascha Silbe 2011-02-01 11:57:16 UTC
My use case for --without-pic was that gdb didn't have PIE support on at least one of the platforms I tried debugging dbus on (probably x86, but might have been armel; both machines are running Debian Squeeze). This has since changed (at least for x86 - haven't tried on armel recently).
No matter whether you're going to support this use case, please don't offer an option that doesn't work. Either make it work or remove the option. The current state is rather confusing.
Comment 4 Simon McVittie 2011-02-21 08:18:33 UTC
We can't remove the option; it's one of the generic options offered by libtool.

However, if we resolve Bug #16621 by removing the goo that forces -fPIE to be used, that'll also resolve this bug.
Comment 5 Simon McVittie 2011-03-14 05:10:07 UTC

*** This bug has been marked as a duplicate of bug 16621 ***

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.