Bug 727301 - Wrong location of header files
Summary: Wrong location of header files
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: libffi
Version: 19
Hardware: All
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Anthony Green
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 727299 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-08-01 18:37 UTC by Ankur Sinha (FranciscoD)
Modified: 2019-05-21 11:12 UTC (History)
6 users (show)

Fixed In Version: libffi-3.0.13-4.fc19
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-06-01 03:17:54 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Ankur Sinha (FranciscoD) 2011-08-01 18:37:00 UTC
Description of problem:
The headers are stored in %{_libdir}/%{name}-%{version}/include/

This is wrong. They should be included in %{_includedir}.

Version-Release number of selected component (if applicable):
[root@ankur ~]# repoquery libffi-devel 
libffi-devel-0:3.0.9-2.fc15.i686
libffi-devel-0:3.0.9-2.fc15.x86_64

I'm guessing this is the same in other fedora versions as well. 


[root@ankur ~]# repoquery -l libffi-devel
/usr/lib/libffi-3.0.9
/usr/lib/libffi-3.0.9/include
/usr/lib/libffi-3.0.9/include/ffi.h
/usr/lib/libffi-3.0.9/include/ffitarget.h
/usr/lib/libffi.so
/usr/lib/pkgconfig/libffi.pc
/usr/share/info/libffi.info.gz
/usr/share/man/man3/ffi.3.gz
/usr/share/man/man3/ffi_call.3.gz
/usr/share/man/man3/ffi_prep_cif.3.gz
/usr/lib64/libffi-3.0.9
/usr/lib64/libffi-3.0.9/include
/usr/lib64/libffi-3.0.9/include/ffi.h
/usr/lib64/libffi-3.0.9/include/ffitarget.h
/usr/lib64/libffi.so
/usr/lib64/pkgconfig/libffi.pc
/usr/share/info/libffi.info.gz
/usr/share/man/man3/ffi.3.gz
/usr/share/man/man3/ffi_call.3.gz
/usr/share/man/man3/ffi_prep_cif.3.gz

Comment 1 Anthony Green 2011-08-04 03:48:46 UTC
This isn't a bug.  Use pkg-config --cflags libffi.

Comment 2 Ankur Sinha (FranciscoD) 2011-08-04 04:23:49 UTC
Hi Anthony,

According the the FHS, all headers *must* go in /usr/include. %{_libdir} is not the correct location for them. 

Using pkg-config is a work around, but the location of files is still wrong, isn't it?

Please reconsider looking into this. I'm building a package that uses cmake, and I have no clue how one makes use of pkg-config here.

Thanks,
Ankur


http://www.pathname.com/fhs/pub/fhs-2.3.html#USRINCLUDEDIRECTORYFORSTANDARDINCLU

http://www.pathname.com/fhs/pub/fhs-2.3.html#LIBESSENTIALSHAREDLIBRARIESANDKERN

Comment 3 Ankur Sinha (FranciscoD) 2011-08-04 04:24:26 UTC
*** Bug 727299 has been marked as a duplicate of this bug. ***

Comment 4 Ankur Sinha (FranciscoD) 2011-08-04 04:26:18 UTC
Reopening.

Comment 5 Fedora End Of Life 2012-08-07 19:51:17 UTC
This message is a notice that Fedora 15 is now at end of life. Fedora
has stopped maintaining and issuing updates for Fedora 15. It is
Fedora's policy to close all bug reports from releases that are no
longer maintained. At this time, all open bugs with a Fedora 'version'
of '15' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this
occurring, but we forgot to do that. A thousand apologies.)

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, feel free to reopen
this bug and simply change the 'version' to a later Fedora version.

Bug Reporter: Thank you for reporting this issue and we are sorry that
we were unable to fix it before Fedora 15 reached end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora, you are encouraged to click on
"Clone This Bug" (top right of this page) and open it against that
version of Fedora.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

The process we are following is described here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 6 Simone Caronni 2012-08-08 08:59:04 UTC
This is definitely a bug, headers should be moved and "pkg-config --cflags libffi" should return the new path under %{_includedir}.

Comment 7 Fedora End Of Life 2013-04-03 19:22:05 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19

Comment 8 Ankur Sinha (FranciscoD) 2013-05-19 12:36:54 UTC
Still persists in 3.0.13

[ankur@ankur-pc  ~]$ rpm -q libffi
libffi-3.0.13-1.fc19.x86_64
libffi-3.0.13-1.fc19.i686
[ankur@ankur-pc  ~]$

[ankur@ankur-pc  ~]$ sudo repoquery -l libffi-devel
[sudo] password for ankur:
/usr/lib/libffi-3.0.13
/usr/lib/libffi-3.0.13/include
/usr/lib/libffi-3.0.13/include/ffi.h
/usr/lib/libffi-3.0.13/include/ffitarget.h
/usr/lib/libffi.so
/usr/lib/pkgconfig/libffi.pc
/usr/share/info/libffi.info.gz
/usr/share/man/man3/ffi.3.gz
/usr/share/man/man3/ffi_call.3.gz
/usr/share/man/man3/ffi_prep_cif.3.gz
/usr/share/man/man3/ffi_prep_cif_var.3.gz
/usr/lib64/libffi-3.0.13
/usr/lib64/libffi-3.0.13/include
/usr/lib64/libffi-3.0.13/include/ffi.h
/usr/lib64/libffi-3.0.13/include/ffitarget.h
/usr/lib64/libffi.so
/usr/lib64/pkgconfig/libffi.pc
/usr/share/info/libffi.info.gz
/usr/share/man/man3/ffi.3.gz
/usr/share/man/man3/ffi_call.3.gz
/usr/share/man/man3/ffi_prep_cif.3.gz
/usr/share/man/man3/ffi_prep_cif_var.3.gz

Comment 9 Fedora Update System 2013-05-26 02:26:20 UTC
libffi-3.0.13-2.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/libffi-3.0.13-2.fc19

Comment 10 Fedora Update System 2013-05-26 16:59:36 UTC
Package libffi-3.0.13-2.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing libffi-3.0.13-2.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-9286/libffi-3.0.13-2.fc19
then log in and leave karma (feedback).

Comment 11 Anthony Green 2013-05-27 19:27:04 UTC
I think that this was fixed the wrong way.  The libffi headers are currently generated at build time for the target system.  It was way more common to do this many years ago (eg. /usr/lib/gtk-2.0/include).  But even today we see platform specific headers under /usr/lib (see /usr/lib/grub/i386-pc/config.h for instance).

A real problem with this fix, for instance, is that 32 and 64-bit x86 headers are different.  You can't simply copy them from /usr/lib[64] to /usr/include because they aren't the same.

I agree that long term these headers should move to /usr/include.  This can be done by carefully recoding them to use compiler built-in #defines, but I've tried it once and it's quite complicated (on the PPC side in particular).  I'm hoping to finally get this done for libffi-3.0.14, but I don't know when that will be.

AG

Comment 12 Tom "spot" Callaway 2013-05-27 19:55:15 UTC
If these two headers are arch specific, rather than recoding them to use #defines, you can simply have an arch specific conditionalized header file, e.g.:

/* This file is here to prevent a file conflict on multiarch systems. */
#ifdef ffi_wrapper_h
#error "Do not define ffi_wrapper_h!"
#endif
#define ffi_wrapper_h

#elif defined(__i386__)
#include "ffi-i386.h"
#elif defined(__powerpc64__)
#include "ffi-ppc64.h"
#elif defined(__powerpc__)
#include "ffi-ppc.h"
#elif defined(__s390x__)
#include "ffi-s390x.h"
#elif defined(__s390__)
#include "ffi-s390.h"
#elif defined(__x86_64__)
#include "ffi-x86_64.h"
#else
#error "The libffi-devel package is not usable with the architecture."
#endif

#undef ffi_wrapper_h

This is how libunwind, openssl work, for example. I've done this fix for 3.0.13-3.

Comment 13 Fedora Update System 2013-05-28 16:17:39 UTC
Package libffi-3.0.13-3.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing libffi-3.0.13-3.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-9286/libffi-3.0.13-3.fc19
then log in and leave karma (feedback).

Comment 14 Daniel Narvaez 2013-05-29 11:52:11 UTC
This seems broken

[osbuild gobject-introspection]$ cpp /usr/include/ffi.h 
# 1 "/usr/include/ffi.h"
# 1 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 1 "<command-line>" 2
# 1 "/usr/include/ffi.h"
/usr/include/ffi.h:7:2: error: #elif without #if
 #elif defined(__i386__)
  ^
/usr/include/ffi.h:8:22: fatal error: ffi-i386.h: No such file or directory
 #include "ffi-i386.h"
                      ^
compilation terminated.


I suspect you meant #if defined(__i386__), if I change that both in ffi.h and in ffitarget.h then it works.

Comment 15 Daniel Narvaez 2013-05-29 11:57:42 UTC
(That was on x86 64)

Comment 16 Daniel Narvaez 2013-05-29 12:04:43 UTC
Looks like this has been already fixed in libffi-devel-3.0.13-4, sorry for the noise.

Comment 17 Fedora Update System 2013-05-29 17:45:29 UTC
Package libffi-3.0.13-4.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing libffi-3.0.13-4.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-9286/libffi-3.0.13-4.fc19
then log in and leave karma (feedback).

Comment 18 Fedora Update System 2013-06-01 03:17:54 UTC
libffi-3.0.13-4.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.