Re: [PATCH] Build libxf86config with -fPIC.
From: Gaetan Nadon mems...@videotron.ca Date: Wed, 24 Nov 2010 20:59:11 -0500 On Wed, 2010-11-24 at 17:42 -0800, Dan Nicholson wrote: On Wed, Nov 24, 2010 at 3:23 PM, Mark Kettenis mark.kette...@xs4all.nl wrote: From: Gaetan Nadon mems...@videotron.ca Date: Tue, 23 Nov 2010 09:34:29 -0500 So far no one has claimed adding fPic is the correct way of creating a shared lib or that it is a necessary workaround to a situation libtool cannot handle and that it will work on all supported platforms. There certainly are platforms where -fPIC isn't the right choice. True, but libtool knows about these platforms and allows the user to control it's usage with --with-pic. Seems better than blindly adding -fPIC to the CFLAGS. I interpreted Mark's comment as confirming that -fPIC should not be added to CFLAGS as it would not be appropriate for all platforms. Indeed, that's what I meant. Perhaps Mark could comment on the patch you submitted, if not already done: http://lists.x.org/archives/xorg-devel/2010-November/015867.html I'm not an expert on libtool anymore (nor a big fan of it). But Dan's approach makes sense to me. ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] Build libxf86config with -fPIC.
From: Gaetan Nadon mems...@videotron.ca Date: Tue, 23 Nov 2010 09:34:29 -0500 So far no one has claimed adding fPic is the correct way of creating a shared lib or that it is a necessary workaround to a situation libtool cannot handle and that it will work on all supported platforms. There certainly are platforms where -fPIC isn't the right choice. ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] Build libxf86config with -fPIC.
On Wed, Nov 24, 2010 at 3:23 PM, Mark Kettenis mark.kette...@xs4all.nl wrote: From: Gaetan Nadon mems...@videotron.ca Date: Tue, 23 Nov 2010 09:34:29 -0500 So far no one has claimed adding fPic is the correct way of creating a shared lib or that it is a necessary workaround to a situation libtool cannot handle and that it will work on all supported platforms. There certainly are platforms where -fPIC isn't the right choice. True, but libtool knows about these platforms and allows the user to control it's usage with --with-pic. Seems better than blindly adding -fPIC to the CFLAGS. -- Dan ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] Build libxf86config with -fPIC.
On Wed, 2010-11-24 at 17:42 -0800, Dan Nicholson wrote: On Wed, Nov 24, 2010 at 3:23 PM, Mark Kettenis mark.kette...@xs4all.nl wrote: From: Gaetan Nadon mems...@videotron.ca Date: Tue, 23 Nov 2010 09:34:29 -0500 So far no one has claimed adding fPic is the correct way of creating a shared lib or that it is a necessary workaround to a situation libtool cannot handle and that it will work on all supported platforms. There certainly are platforms where -fPIC isn't the right choice. True, but libtool knows about these platforms and allows the user to control it's usage with --with-pic. Seems better than blindly adding -fPIC to the CFLAGS. I interpreted Mark's comment as confirming that -fPIC should not be added to CFLAGS as it would not be appropriate for all platforms. Perhaps Mark could comment on the patch you submitted, if not already done: http://lists.x.org/archives/xorg-devel/2010-November/015867.html -- Dan signature.asc Description: This is a digitally signed message part ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] Build libxf86config with -fPIC.
On Tue, 2010-11-23 at 15:51 +1000, Peter Hutterer wrote: This is an important point. We are waisting time trying to guess what this patch is for. Oh, I know what it's for, it's needed for pyxf86config. I just don't think anyone is prepared to commit to a stable ABI for libxf86config, so installing it as a shared library may not be the best plan. IMO, just because you decided to make the library shared doesn't mean you've suddenly agreed to any more ABI stability than before. the big difference is compile-time vs. run-time ABI stability. which especially in the case of a distribution can make a difference because once you compile a lib from package A into package B, what happens to A doesn't matter until you recompile B too. with a shared library, updating A can break B. (that of course doesn't mean it's the right thing to do, it's just how it is) I lost track of the details, but my general feeling is that it is a development issue. Developers should decide if shared lib or not with the desired level of compatibility. If that discussion does not happen, the issue cannot be solved with a hack in the build. So far no one has claimed adding fPic is the correct way of creating a shared lib or that it is a necessary workaround to a situation libtool cannot handle and that it will work on all supported platforms. Gaetan signature.asc Description: This is a digitally signed message part ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] Build libxf86config with -fPIC.
On Die, 2010-11-23 at 09:34 -0500, Gaetan Nadon wrote: So far no one has claimed adding fPic is the correct way of creating a shared lib or that it is a necessary workaround to a situation libtool cannot handle On many Linux architectures (x86 being a notable exception), all code linked into a shared library must be compiled with -fPIC. If a static library was built without -fPIC it can't be linked into a shared library, libtool can't do anything about that. and that it will work on all supported platforms. It should. Static libraries are traditionally built without -fPIC because it's not required for them and it reserves a precious register on x86. Building static libraries with -fPIC is an established solution for linking libraries with no ABI guarantees into shared libraries. -- Earthling Michel Dänzer |http://www.vmware.com Libre software enthusiast | Debian, X and DRI developer ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] Build libxf86config with -fPIC.
On Mon, Nov 15, 2010 at 04:11:11PM -0800, Dan Nicholson wrote: On Mon, Nov 15, 2010 at 10:38 AM, Julien Cristau jcris...@debian.org wrote: On Mon, Nov 15, 2010 at 13:28:34 -0500, Gaetan Nadon wrote: On Mon, 2010-11-15 at 15:35 +0100, Julien Cristau wrote: If you want to install it as a shared library you also want to track its ABI and give it a SONAME, which is more work. Shipping it as a PIC static lib which you don't have to be as careful with possible ABI breaks, but you can still embed it in something like a python module (which must be PIC). This is an important point. We are waisting time trying to guess what this patch is for. Oh, I know what it's for, it's needed for pyxf86config. I just don't think anyone is prepared to commit to a stable ABI for libxf86config, so installing it as a shared library may not be the best plan. IMO, just because you decided to make the library shared doesn't mean you've suddenly agreed to any more ABI stability than before. the big difference is compile-time vs. run-time ABI stability. which especially in the case of a distribution can make a difference because once you compile a lib from package A into package B, what happens to A doesn't matter until you recompile B too. with a shared library, updating A can break B. (that of course doesn't mean it's the right thing to do, it's just how it is) Cheers, Peter However, I think you can make a libtool library (bringing in PIC magic) and have it be static only. In addition to the diff I sent earlier, add: libxf86config_la_LDFLAGS = -static A little testing with a dummy project shows this works. ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] Build libxf86config with -fPIC.
On 16:11 Mon 15 Nov , Dan Nicholson wrote: On Mon, Nov 15, 2010 at 10:38 AM, Julien Cristau jcris...@debian.org wrote: On Mon, Nov 15, 2010 at 13:28:34 -0500, Gaetan Nadon wrote: On Mon, 2010-11-15 at 15:35 +0100, Julien Cristau wrote: If you want to install it as a shared library you also want to track its ABI and give it a SONAME, which is more work. Shipping it as a PIC static lib which you don't have to be as careful with possible ABI breaks, but you can still embed it in something like a python module (which must be PIC). This is an important point. We are waisting time trying to guess what this patch is for. Oh, I know what it's for, it's needed for pyxf86config. I just don't think anyone is prepared to commit to a stable ABI for libxf86config, so installing it as a shared library may not be the best plan. IIRC, installing a shared lib with a SOVER of 0 means no promise of ABI stability... I'd rather see it done in a right way than hacking around the same issue and ending up with bundled static libs in places where you wouldn't expect them. -- Thanks, Donnie Donnie Berkholz Sr. Developer, Gentoo Linux Blog: http://dberkholz.wordpress.com pgp8FAId1c5ip.pgp Description: PGP signature ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] Build libxf86config with -fPIC.
Le 15/11/2010 19:38, Julien Cristau a écrit : Oh, I know what it's for, it's needed for pyxf86config. I just don't think anyone is prepared to commit to a stable ABI for libxf86config, so installing it as a shared library may not be the best plan. We stopped trying to make libxf86config a shared library around 1.6~1.7 since things were going weird on all our non-x86 arches. We also got rid of pyxf86config in the process since it was the only known user of the lib. Since we only used pyxf86config to provide a scripted transition from xorg.conf to HAL fdi, now that we're back to xorg.conf, pyxf86config is useless (at least for us). I'd be interested in knowing what RH uses pyxf86config for these days. Cheers, Rémi ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] Build libxf86config with -fPIC.
On Sun, Nov 14, 2010 at 21:31:42 -0800, Dan Nicholson wrote: Why not just make libxf86config into a libtool library? Then libtool will take care of all the PIC details, follow the --with-pic configuration, and be static or shared as requested by the user. Here's an untested diff, but I think it's all it would take (gmail has surely broken the whitespace). If you want to install it as a shared library you also want to track its ABI and give it a SONAME, which is more work. Shipping it as a PIC static lib which you don't have to be as careful with possible ABI breaks, but you can still embed it in something like a python module (which must be PIC). Cheers, Julien ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] Build libxf86config with -fPIC.
On Mon, 2010-11-15 at 15:35 +0100, Julien Cristau wrote: If you want to install it as a shared library you also want to track its ABI and give it a SONAME, which is more work. Shipping it as a PIC static lib which you don't have to be as careful with possible ABI breaks, but you can still embed it in something like a python module (which must be PIC). This is an important point. We are waisting time trying to guess what this patch is for. Implementing a feature correctly is always less work. This loose option looks like a hack to me. I did not see any precedent in all of xorg modules and there is still no assurance it will work correctly on all platforms. signature.asc Description: This is a digitally signed message part ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] Build libxf86config with -fPIC.
On Mon, Nov 15, 2010 at 13:28:34 -0500, Gaetan Nadon wrote: On Mon, 2010-11-15 at 15:35 +0100, Julien Cristau wrote: If you want to install it as a shared library you also want to track its ABI and give it a SONAME, which is more work. Shipping it as a PIC static lib which you don't have to be as careful with possible ABI breaks, but you can still embed it in something like a python module (which must be PIC). This is an important point. We are waisting time trying to guess what this patch is for. Oh, I know what it's for, it's needed for pyxf86config. I just don't think anyone is prepared to commit to a stable ABI for libxf86config, so installing it as a shared library may not be the best plan. Cheers, Julien ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] Build libxf86config with -fPIC.
On Mon, 2010-11-15 at 19:38 +0100, Julien Cristau wrote: Oh, I know what it's for, it's needed for pyxf86config. I just don't think anyone is prepared to commit to a stable ABI for libxf86config, so installing it as a shared library may not be the best plan. Indeed, pyxf86config needs pretty regular updating as the library changes. I'm inclined to think the whole idea was a mistake and pyxf86config should just import a copy and be done with it. - ajax signature.asc Description: This is a digitally signed message part ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] Build libxf86config with -fPIC.
On Mon, Nov 15, 2010 at 10:38 AM, Julien Cristau jcris...@debian.org wrote: On Mon, Nov 15, 2010 at 13:28:34 -0500, Gaetan Nadon wrote: On Mon, 2010-11-15 at 15:35 +0100, Julien Cristau wrote: If you want to install it as a shared library you also want to track its ABI and give it a SONAME, which is more work. Shipping it as a PIC static lib which you don't have to be as careful with possible ABI breaks, but you can still embed it in something like a python module (which must be PIC). This is an important point. We are waisting time trying to guess what this patch is for. Oh, I know what it's for, it's needed for pyxf86config. I just don't think anyone is prepared to commit to a stable ABI for libxf86config, so installing it as a shared library may not be the best plan. IMO, just because you decided to make the library shared doesn't mean you've suddenly agreed to any more ABI stability than before. However, I think you can make a libtool library (bringing in PIC magic) and have it be static only. In addition to the diff I sent earlier, add: libxf86config_la_LDFLAGS = -static A little testing with a dummy project shows this works. -- Dan ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH] Build libxf86config with -fPIC.
From: Adam Jackson a...@redhat.com Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- hw/xfree86/parser/Makefile.am |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/xfree86/parser/Makefile.am b/hw/xfree86/parser/Makefile.am index caf7079..3bda51e 100644 --- a/hw/xfree86/parser/Makefile.am +++ b/hw/xfree86/parser/Makefile.am @@ -32,7 +32,7 @@ libxf86config_internal_la_SOURCES = \ libxf86config_a_SOURCES = \ $(INTERNAL_SOURCES) -libxf86config_a_CFLAGS = $(AM_CFLAGS) +libxf86config_a_CFLAGS = $(AM_CFLAGS) -fPIC AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) \ -DSYSCONFDIR=\$(sysconfdir)\ \ -- 1.7.3.2 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] Build libxf86config with -fPIC.
On Mon, 15 Nov 2010 11:25:11 +1000, Peter Hutterer peter.hutte...@who-t.net wrote: From: Adam Jackson a...@redhat.com Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- hw/xfree86/parser/Makefile.am |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/xfree86/parser/Makefile.am b/hw/xfree86/parser/Makefile.am index caf7079..3bda51e 100644 --- a/hw/xfree86/parser/Makefile.am +++ b/hw/xfree86/parser/Makefile.am @@ -32,7 +32,7 @@ libxf86config_internal_la_SOURCES = \ libxf86config_a_SOURCES = \ $(INTERNAL_SOURCES) -libxf86config_a_CFLAGS = $(AM_CFLAGS) +libxf86config_a_CFLAGS = $(AM_CFLAGS) -fPIC Should this change also be done for the two libfbcmap libraries in vfb and xnest? -- keith.pack...@intel.com pgp46XXJVMIc8.pgp Description: PGP signature ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] Build libxf86config with -fPIC.
On Mon, Nov 15, 2010 at 10:29:30AM +0800, Keith Packard wrote: On Mon, 15 Nov 2010 11:25:11 +1000, Peter Hutterer peter.hutte...@who-t.net wrote: From: Adam Jackson a...@redhat.com Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- hw/xfree86/parser/Makefile.am |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/xfree86/parser/Makefile.am b/hw/xfree86/parser/Makefile.am index caf7079..3bda51e 100644 --- a/hw/xfree86/parser/Makefile.am +++ b/hw/xfree86/parser/Makefile.am @@ -32,7 +32,7 @@ libxf86config_internal_la_SOURCES = \ libxf86config_a_SOURCES = \ $(INTERNAL_SOURCES) -libxf86config_a_CFLAGS = $(AM_CFLAGS) +libxf86config_a_CFLAGS = $(AM_CFLAGS) -fPIC Should this change also be done for the two libfbcmap libraries in vfb and xnest? I think the motivation here was that some other package we use in Fedora links libxf86config into a shared library (I might be wrong here). AFAIK, Debian doesn't package it at all. Not sure about other distros. We've been carrying this patch since 1.4-ish, dropped it at some point when it went .so for a short while and then added the patch again. We don't carry anything for libfbcmap. Cheers, Peter ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] Build libxf86config with -fPIC.
Peter Hutterer peter.hutte...@who-t.net (15/11/2010): AFAIK, Debian doesn't package it at all. (I'm still quite new in its X packaging team, but that still) sounds about right. Mraw, KiBi. signature.asc Description: Digital signature ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] Build libxf86config with -fPIC.
On Sun, Nov 14, 2010 at 5:25 PM, Peter Hutterer peter.hutte...@who-t.net wrote: From: Adam Jackson a...@redhat.com Signed-off-by: Peter Hutterer peter.hutte...@who-t.net --- hw/xfree86/parser/Makefile.am | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/xfree86/parser/Makefile.am b/hw/xfree86/parser/Makefile.am index caf7079..3bda51e 100644 --- a/hw/xfree86/parser/Makefile.am +++ b/hw/xfree86/parser/Makefile.am @@ -32,7 +32,7 @@ libxf86config_internal_la_SOURCES = \ libxf86config_a_SOURCES = \ $(INTERNAL_SOURCES) -libxf86config_a_CFLAGS = $(AM_CFLAGS) +libxf86config_a_CFLAGS = $(AM_CFLAGS) -fPIC AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) \ -DSYSCONFDIR=\$(sysconfdir)\ \ Why not just make libxf86config into a libtool library? Then libtool will take care of all the PIC details, follow the --with-pic configuration, and be static or shared as requested by the user. Here's an untested diff, but I think it's all it would take (gmail has surely broken the whitespace). diff --git a/hw/xfree86/parser/Makefile.am b/hw/xfree86/parser/Makefile.am index caf7079..6cbf8e4 100644 --- a/hw/xfree86/parser/Makefile.am +++ b/hw/xfree86/parser/Makefile.am @@ -1,6 +1,6 @@ if INSTALL_LIBXF86CONFIG noinst_LTLIBRARIES = libxf86config_internal.la -lib_LIBRARIES = libxf86config.a +lib_LTLIBRARIES = libxf86config.la LIBHEADERS = \ xf86Optrec.h \ xf86Parser.h @@ -30,9 +30,9 @@ INTERNAL_SOURCES= \ libxf86config_internal_la_SOURCES = \ $(INTERNAL_SOURCES) -libxf86config_a_SOURCES = \ +libxf86config_la_SOURCES = \ $(INTERNAL_SOURCES) -libxf86config_a_CFLAGS = $(AM_CFLAGS) +libxf86config_la_CFLAGS = $(AM_CFLAGS) AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) \ -DSYSCONFDIR=\$(sysconfdir)\ \ ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel