public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix installation localtion of libffi
@ 2013-02-07 21:31 Thomas Petazzoni
  2013-02-07 21:40 ` Jakub Jelinek
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Petazzoni @ 2013-02-07 21:31 UTC (permalink / raw)
  To: libffi-discuss

The libffi is currently declared as toolexeclib_LTLIBRARIES. In many
cases, toolexeclib libraries will be installed in /usr/lib, so it
doesn't make any difference.

However, with multilib toolchains, they get installed in a
subdirectory of /usr/lib/. For example, with a Sourcery CodeBench
PowerPC toolchain, if the e500mc multilib variant is used, the libffi
library gets installed in /usr/lib/te500mc/. This is due to the
following code in the configure script:

  multi_os_directory=`$CC -print-multi-os-directory`
  case $multi_os_directory in
    .) ;; # Avoid trailing /.
    *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
  esac

Once the library is installed in /usr/lib/te500mc/, nothing works
because this installation location is inconsistent with the
installation location declared in libffi.pc.

So, instead of using this bizarre toolexeclib_LTLIBRARIES, simply use
the more standard lib_LTLIBRARIES, which ensures that the libffi
library is always installed in /usr/lib.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 Makefile.am |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index 6f669ca..b60bcc1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -93,7 +93,7 @@ FLAGS_TO_PASS = $(AM_MAKEFLAGS)
 
 MAKEOVERRIDES=
 
-toolexeclib_LTLIBRARIES = libffi.la
+lib_LTLIBRARIES = libffi.la
 noinst_LTLIBRARIES = libffi_convenience.la
 
 libffi_la_SOURCES = src/prep_cif.c src/types.c \
-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Fix installation localtion of libffi
  2013-02-07 21:31 [PATCH] Fix installation localtion of libffi Thomas Petazzoni
@ 2013-02-07 21:40 ` Jakub Jelinek
  2013-02-07 21:54   ` Thomas Petazzoni
  2013-02-07 22:19   ` Matthias Klose
  0 siblings, 2 replies; 5+ messages in thread
From: Jakub Jelinek @ 2013-02-07 21:40 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: libffi-discuss

On Thu, Feb 07, 2013 at 10:31:31PM +0100, Thomas Petazzoni wrote:
>   multi_os_directory=`$CC -print-multi-os-directory`
>   case $multi_os_directory in
>     .) ;; # Avoid trailing /.
>     *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
>   esac
> 
> Once the library is installed in /usr/lib/te500mc/, nothing works
> because this installation location is inconsistent with the
> installation location declared in libffi.pc.
> 
> So, instead of using this bizarre toolexeclib_LTLIBRARIES, simply use
> the more standard lib_LTLIBRARIES, which ensures that the libffi
> library is always installed in /usr/lib.

There is nothing bizzare on it, of course you want to install say
on x86_64 the 64-bit library into /usr/lib64/ directory where the dynamic
linker will find it, not into /usr/lib/ where it is looking for 32-bit
libraries, etc.
So this change is wrong.

	Jakub

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Fix installation localtion of libffi
  2013-02-07 21:40 ` Jakub Jelinek
@ 2013-02-07 21:54   ` Thomas Petazzoni
  2013-02-07 22:19   ` Matthias Klose
  1 sibling, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2013-02-07 21:54 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: libffi-discuss

Dear Jakub Jelinek,

On Thu, 7 Feb 2013 22:40:33 +0100, Jakub Jelinek wrote:

> There is nothing bizzare on it, of course you want to install say
> on x86_64 the 64-bit library into /usr/lib64/ directory where the dynamic
> linker will find it, not into /usr/lib/ where it is looking for 32-bit
> libraries, etc.
> So this change is wrong.

No other package that I know of use toolexeclib_LTLIBRARIES. In the
context of Buildroot, we have 800+ packages, many of which are
libraries, and it is really the first time that I see
toolexeclib_LTLIBRARIES being used.

Moreover, the libffi.pc being installed is anyway inconsistent with
this bizarre installation location. So definitely, something must be
fixed. Either the installation location, or the libffi.pc file. As it
is now, many packages fail to link with libffi due to this
inconsistency.

Best regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Fix installation localtion of libffi
  2013-02-07 21:40 ` Jakub Jelinek
  2013-02-07 21:54   ` Thomas Petazzoni
@ 2013-02-07 22:19   ` Matthias Klose
  2013-03-17 13:36     ` Anthony Green
  1 sibling, 1 reply; 5+ messages in thread
From: Matthias Klose @ 2013-02-07 22:19 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Thomas Petazzoni, libffi-discuss

Am 07.02.2013 22:40, schrieb Jakub Jelinek:
> On Thu, Feb 07, 2013 at 10:31:31PM +0100, Thomas Petazzoni wrote:
>>   multi_os_directory=`$CC -print-multi-os-directory`
>>   case $multi_os_directory in
>>     .) ;; # Avoid trailing /.
>>     *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
>>   esac
>>
>> Once the library is installed in /usr/lib/te500mc/, nothing works
>> because this installation location is inconsistent with the
>> installation location declared in libffi.pc.
>>
>> So, instead of using this bizarre toolexeclib_LTLIBRARIES, simply use
>> the more standard lib_LTLIBRARIES, which ensures that the libffi
>> library is always installed in /usr/lib.
> 
> There is nothing bizzare on it, of course you want to install say
> on x86_64 the 64-bit library into /usr/lib64/ directory where the dynamic
> linker will find it, not into /usr/lib/ where it is looking for 32-bit
> libraries, etc.
> So this change is wrong.

It looks odd for the standalone libffi release, and only works for multilib
configurations, when MULTILIB_OSDIRNAMES is defined too.  There are multilib
configurations where $CC -print-multi-os-directory isn't `.' for the default.

I didn't check, but maybe something like this is wanted?

   case $multi_os_directory in
     .) ;; # Avoid trailing /.
     ../*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
   esac

Matthias

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Fix installation localtion of libffi
  2013-02-07 22:19   ` Matthias Klose
@ 2013-03-17 13:36     ` Anthony Green
  0 siblings, 0 replies; 5+ messages in thread
From: Anthony Green @ 2013-03-17 13:36 UTC (permalink / raw)
  To: Matthias Klose; +Cc: Jakub Jelinek, Thomas Petazzoni, libffi-discuss

On Thu, Feb 7, 2013 at 5:19 PM, Matthias Klose <doko@ubuntu.com> wrote:
> Am 07.02.2013 22:40, schrieb Jakub Jelinek:
>> On Thu, Feb 07, 2013 at 10:31:31PM +0100, Thomas Petazzoni wrote:
>>>   multi_os_directory=`$CC -print-multi-os-directory`
>>>   case $multi_os_directory in
>>>     .) ;; # Avoid trailing /.
>>>     *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
>>>   esac
>>>
>>> Once the library is installed in /usr/lib/te500mc/, nothing works
>>> because this installation location is inconsistent with the
>>> installation location declared in libffi.pc.
>>>
>>> So, instead of using this bizarre toolexeclib_LTLIBRARIES, simply use
>>> the more standard lib_LTLIBRARIES, which ensures that the libffi
>>> library is always installed in /usr/lib.
>>
>> There is nothing bizzare on it, of course you want to install say
>> on x86_64 the 64-bit library into /usr/lib64/ directory where the dynamic
>> linker will find it, not into /usr/lib/ where it is looking for 32-bit
>> libraries, etc.
>> So this change is wrong.
>
> It looks odd for the standalone libffi release, and only works for multilib
> configurations, when MULTILIB_OSDIRNAMES is defined too.  There are multilib
> configurations where $CC -print-multi-os-directory isn't `.' for the default.
>
> I didn't check, but maybe something like this is wanted?
>
>    case $multi_os_directory in
>      .) ;; # Avoid trailing /.
>      ../*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
>    esac

This looks reasonable.  A ticket was recently filed on this...

https://github.com/atgreen/libffi/issues/31

...and I've rolled your solution into
ftp://sourceware.org/pub/libffi/libffi-3.0.13-rc2.tar.gz for testing.

Thanks!

AG

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-03-17 13:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-07 21:31 [PATCH] Fix installation localtion of libffi Thomas Petazzoni
2013-02-07 21:40 ` Jakub Jelinek
2013-02-07 21:54   ` Thomas Petazzoni
2013-02-07 22:19   ` Matthias Klose
2013-03-17 13:36     ` Anthony Green

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).