Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix installation location of libffi #448

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ffontaine
Copy link
Contributor

@ffontaine ffontaine commented Aug 30, 2018

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 [email protected]
[unfuzz for 3.2.1]
Signed-off-by: Jörg Krause [email protected]
[Patch retrieved from:
https://git.buildroot.net/buildroot/tree/package/libffi/0001-Fix-installation-location-of-libffi.patch]
Signed-off-by: Fabrice Fontaine [email protected]

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 <[email protected]>
[unfuzz for 3.2.1]
Signed-off-by: Jörg Krause <[email protected]>
[Patch retrieved from:
https://git.buildroot.net/buildroot/tree/package/libffi/0001-Fix-installation-location-of-libffi.patch]
Signed-off-by: Fabrice Fontaine <[email protected]>
@bradbishop
Copy link

Was this patch ignored because of the CI failures?

@xnox
Copy link

xnox commented Aug 20, 2020

Ping, can this please be merged?

@atgreen
Copy link
Member

atgreen commented Sep 7, 2022

Wouldn't it be better to update libffi.pc?

@ffontaine
Copy link
Contributor Author

IMHO, as explained in the commit log, installing a library in toolexeclib_LTLIBRARIES is not really standard so this patch is probably better than updating libffi.pc. This patch has been applied in buildroot nearly 10 years ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants