Bug 431633 - Review Request: libffi - High level programming interface to various calling conventions
Review Request: libffi - High level programming interface to various calling ...
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: Package Review (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Lillian Angel
Fedora Extras Quality Assurance
:
Depends On:
Blocks: 431098
  Show dependency treegraph
 
Reported: 2008-02-05 21:50 EST by Tom "spot" Callaway
Modified: 2012-08-16 15:09 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-02-15 12:59:42 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
green: fedora‑review+


Attachments (Terms of Use)

  None (edit)
Description Tom "spot" Callaway 2008-02-05 21:50:21 EST
Spec URL: http://www.auroralinux.org/people/spot/review/new/libffi.spec
SRPM URL: http://www.auroralinux.org/people/spot/review/new/libffi-2.1-0.1.20080129svn131943.fc9.src.rpm
Description:

Compilers for high level languages generate code that follows certain
conventions. These conventions are necessary, in part, for separate
compilation to work. One such convention is the "calling convention". The
"calling convention" is a set of assumptions made by the compiler about where
function arguments will be found on entry to a function. A "calling
convention" also specifies where the return value for a function is found.

Some programs may not know at the time of compilation what arguments are to
be passed to a function. For instance, an interpreter may be told at run-time
about the number and types of arguments used to call a given function. Libffi
can be used in such programs to provide a bridge from the interpreter program
to compiled code. The libffi library provides a portable, high level
programming interface to various calling conventions. This allows a programmer
to call any function specified by a call interface description at run-time.

Ffi stands for Foreign Function Interface. A foreign function interface is the
popular name for the interface that allows code written in one language to call
code written in another language. The libffi library really only provides the
lowest, machine dependent layer of a fully featured foreign function interface.
A layer must exist above libffi that handles type conversions for values passed
between the two languages.
Comment 1 Ralf Corsepius 2008-02-05 22:07:54 EST
Would you elaborate why you want to ship libffi as a separate package?

libffi is part of GCC, is being built when bootstrapping GCC, technically
closely tied to GCC ...

That said, IMO, libffi should not be shipped separately.
Comment 2 Bill Nottingham 2008-02-05 22:35:29 EST
Or, if it is shipped for systems to use, perhaps it should be built from GCC?

Note that there is precedence for apps shipping their own libffi in the absence
of a system one. See g-wrap.
Comment 3 Tom "spot" Callaway 2008-02-06 08:32:42 EST
GCC doesn't include a copy of libffi. See Bugzilla 190735 where Jakub explicitly
says "I think libffi should be just packaged separately from gcc for third party
package use.  Either package it in Fedora Extras, or convince somebody to do so."
Comment 4 Ralf Corsepius 2008-02-06 10:16:40 EST
(In reply to comment #3)
> GCC doesn't include a copy of libffi.
The sources are part of GCC. C.f. your spec file were you explicitly lift them
from there.

> See Bugzilla 190735 where Jakub explicitly
> says "I think libffi should be just packaged separately from gcc for third
> party package use.
"He thinks ... should" ...

In other words, _He_ doesn't package it, because _He_ and upstream-GCC doesn't
want to. (And there are good reasons not to do so.)

>  Either package it in Fedora Extras, or convince somebody to do so.
Or do not package it at all.

Trying to lift the code from GCC's source-tree and to package it separately to
me is nothing bug silly. Sorry, I am sure you will not like this, but this had
to be said.
Comment 5 Tom "spot" Callaway 2008-02-06 10:24:32 EST
One of my pending applications (gambas2) needs it. g-wrap needs it. That in and
of itself says that there is a need for this library to be packaged system-wide,
rather than buried in multiple copies of individual packages. The security
concerns around that are enough reason to separate it.

I would prefer to see this generated out of GCC, but barring that, I'll maintain
it myself. It builds fine (and works fine) as a standalone library.

Also, I think you're misinterpreting what Jakub said. He said that he believes
that libffi should be packaged separately from gcc for other packages to use,
which is precisely what I'm doing here. I'm adding Jakub to the CC on this bug,
so that he can either confirm or deny this. :)
Comment 6 Ralf Corsepius 2008-02-06 11:17:03 EST
(In reply to comment #5)
> Also, I think you're misinterpreting what Jakub said. He said that he believes
> that libffi should be packaged separately from gcc for other packages to use,
> which is precisely what I'm doing here. I'm adding Jakub to the CC on this bug,
> so that he can either confirm or deny this. :)
And I disagree with you both. 

I say: libffi's sources are part of GCC. i.e. if at all, it must be shipped as a
subpackage of GCC.

Comment 7 Tom "spot" Callaway 2008-02-06 14:35:35 EST
Paging Anthony Green (upstream maintainer) to this bug.
Comment 8 Anthony Green 2008-02-06 14:53:19 EST
libffi should be packaged separately from GCC, much like zlib is. (zlib is
bundled with the GCC sources, just like libffi).

I'm preparing a libffi 3.0 release right now, and would prefer that we ship this
version instead if that's OK.
  
Comment 9 Tom "spot" Callaway 2008-02-06 14:57:11 EST
This works for me. Please note that the headers (at least in what was in SVN)
aren't anywhere near multilib clean, and I conditionalized them with a dummy
header in my package.
Comment 10 Anthony Green 2008-02-06 17:05:30 EST
(In reply to comment #9)
> This works for me. Please note that the headers (at least in what was in SVN)
> aren't anywhere near multilib clean, and I conditionalized them with a dummy
> header in my package.

Yes, that's one of the things we're cleaning up for 3.0.  It probably won't be
ready for a couple of weeks at least.
Comment 11 Ralf Corsepius 2008-02-07 03:02:00 EST
(In reply to comment #8)
> libffi should be packaged separately from GCC, much like zlib is. (zlib is
> bundled with the GCC sources, just like libffi).
Unlike zlib, the upstream for libffi is in GCC - Otherwise Spot would not have
to lift the code from GCC's code base.
Comment 12 Anthony Green 2008-02-07 06:39:57 EST
(In reply to comment #11)
> Unlike zlib, the upstream for libffi is in GCC - Otherwise Spot would not have
> to lift the code from GCC's code base.

It's true that for the past 10 years virtually all development has happened
within the GCC project.  However, the FSF has always been clear that libffi is
not part of GCC.  It is just distributed along with GCC for convenience.  GCC
has never installed libffi as a user library.  It is only used to enable libgcj.
 Given libffi's continued use outside of the GCC project, I recently decided to
start making independent libffi releases again.  See this thread:
http://sourceware.org/ml/libffi-discuss/2008/msg00000.html
Comment 13 Ralf Corsepius 2008-02-07 07:05:44 EST
(In reply to comment #12)
> (In reply to comment #11)
> > Unlike zlib, the upstream for libffi is in GCC - Otherwise Spot would not have
> > to lift the code from GCC's code base.
> 
> It's true that for the past 10 years virtually all development has happened
> within the GCC project.  However, the FSF has always been clear that libffi is
> not part of GCC.
Can you provide any evidence for this statement?

Being a GCC developer myself I have never heard about any such statement, I knew
there had your libffi project before, .. it had been absorbed by GCC like many
other comparable projects, causing its former upstream to die.

>  It is just distributed along with GCC for convenience.  GCC
> has never installed libffi as a user library.
A fact which could easily be changed.

>  It is only used to enable libgcj.

Check libffi's ChangeLog and you will probably noticed that I know about this.

It's one reason why I think applications still using libffi outside of GCC
probably had been based on your ancient libffi-1.2 or have lifted the code from GCC.

>  Given libffi's continued use outside of the GCC project, I recently decided to
> start making independent libffi releases again.  See this thread:
> http://sourceware.org/ml/libffi-discuss/2008/msg00000.html
Of cause it's your liberty to resume the work you abandoned many years ago and
to launch a fork based on GCC's source.

I wonder if GCC-SC knows about your decision and what they think about it.
Comment 14 Anthony Green 2008-02-07 14:11:00 EST
(In reply to comment #13)
> (In reply to comment #12)
> > (In reply to comment #11)
> > > Unlike zlib, the upstream for libffi is in GCC - Otherwise Spot would not have
> > > to lift the code from GCC's code base.
> > 
> > It's true that for the past 10 years virtually all development has happened
> > within the GCC project.  However, the FSF has always been clear that libffi is
> > not part of GCC.
> Can you provide any evidence for this statement?

Not easily.  Most of this discussion was in private email with rms and one or
two of the SC members.  My email from those days is lost in an unsalvageable
Outlook folder.  If you check with rms he will verify my claim. 

> I wonder if GCC-SC knows about your decision and what they think about it.

I don't know, but it's certainly no secret.  Do you really think anybody would
have a problem with it?  I've certainly been encouraged to release a new
unbundled libffi release by GCC developers in the past.

I agree, however, that we wouldn't be having this conversation if the GCC
project installed libffi and supported the ffi.h interface for its users. 
AFAICT there are no plans to do this.   Even if there were, it certainly won't
happen in a timeframe that works for spot.
Comment 15 Bill Nottingham 2008-02-07 14:47:07 EST
I have no problems with shipping it separately if it does have separate releases. 
Do we need to wait for the 3.0 release to actually have this in Fedora, though?
Comment 16 Lillian Angel 2008-02-14 08:55:58 EST
Is there a way we can get this into F9 (in rawhide before March 4)? We need this for the java-1.7.0-icedtea  
ppc/64 package. It now includes a zero-assembler implementation.


Thx.
Comment 17 Andrew Haley 2008-02-14 09:45:29 EST
I agree with Anthony: libffi has never been part of gcc.

I agree with Anthony: libffi is not a part of gcc, and never has been.

We need a separate package because

1.  We need to decouple the release cycle of libffi from that of gcc.
Having to ask jakub to rebuild the whole gcc package for a small 
libffi change is a big nuisance.

2.  jakub has made it plain that he doesn't want to build a libffi
sub-package of gcc.
Comment 18 Ralf Corsepius 2008-02-14 10:21:40 EST
(In reply to comment #17)
> I agree with Anthony: libffi has never been part of gcc.
> 
> I agree with Anthony: libffi is not a part of gcc, and never has been.
I think you should communicate these claims to the GCS and the FSF.

> 1.  We need to decouple the release cycle of libffi from that of gcc.
> Having to ask jakub to rebuild the whole gcc package for a small 
> libffi change is a big nuisance.
> 
> 2.  jakub has made it plain that he doesn't want to build a libffi
> sub-package of gcc.
This is the point: Redhat has decided to fork.

May I ask Jacub to split out libiberty?

Comment 19 Andrew Haley 2008-02-14 11:02:47 EST
Red Hat has not decided to fork.  Red Hat is the original author of libffi,
and its upstream is where it has always been.  The only fork is in your head.

You think I should tell the SC that libffi is not part of gcc.  I have no
intention of doing that, because they already know.

libiberty is an FSF project; libffi is not.
Comment 20 Anthony Green 2008-02-14 11:47:07 EST
Here's a test release for review...

http://spindazzle.org/Fedora/libffi-2.99.2-1.fc8.src.rpm
http://spindazzle.org/Fedora/libffi.spec
Comment 21 Bill Nottingham 2008-02-14 12:09:52 EST
Is 2.99.2 going to be ABI compatible with 3.0?
Comment 22 Anthony Green 2008-02-14 12:33:59 EST
(In reply to comment #21)
> Is 2.99.2 going to be ABI compatible with 3.0?

Yes.
Comment 23 Anthony Green 2008-02-14 17:14:02 EST
Ok, we're getting close...

http://spindazzle.org/Fedora/libffi-2.99.3-1.fc8.src.rpm
http://spindazzle.org/Fedora/libffi.spec

I think this is ready for somebody to review.
Comment 24 Lillian Angel 2008-02-14 17:25:11 EST
Should we wait until you have 3 out?
Comment 25 Anthony Green 2008-02-14 17:37:48 EST
(In reply to comment #24)
> Should we wait until you have 3 out?

No.  There won't be any substantial changes -- mostly more testing on other
platforms and maybe cleaning up of the docs.  The 2.99.* to 3.0 change should be
seamless and I don't want to slow down the work depending on libffi in Fedora.
Comment 26 Anthony Green 2008-02-14 17:56:20 EST
This fixes a pkgconfig bug...

http://spindazzle.org/Fedora/libffi-2.99.4-1.fc8.src.rpm
http://spindazzle.org/Fedora/libffi.spec

spot: after installing this, I modified the g-wrap spec file like so...

-export CFLAGS="$RPM_OPT_FLAGS -fPIC"
+export CFLAGS="$RPM_OPT_FLAGS -fPIC `pkg-config libffi --cflags`"

...and it builds and installs fine with the system libffi package.
Comment 27 Lillian Angel 2008-02-15 09:48:08 EST
I will do the review now.
Comment 28 Anthony Green 2008-02-15 10:20:27 EST
Thanks Lillian.  FWIW, here's a new release with minor improvements...

http://spindazzle.org/Fedora/libffi-2.99.8-1.fc8.src.rpm
http://spindazzle.org/Fedora/libffi.spec
Comment 29 Lillian Angel 2008-02-15 10:33:01 EST
There are only a couple of issues I found. Please read the review below. With
these problems assessed/fixed, the package is approved.

Why are *.h files in /usr/lib/libffi-2.99.8/include and not /usr/include?


-------


rpmlint:

libffi-devel.i686: E: only-non-binary-in-usr-lib
Verify this is ok.

Packaging Guidelines

   1. Naming
	ok
   2. Legal
         1. Licensing
         2. Shareware
         3. Patents
         4. Emulators
         5. Binary Firmware
	ok

   3. No inclusion of pre-built binaries or libraries
	None.

   4. Writing a package from scratch
	Done.

   5. Modifying an existing package
	NA

   6. Filesystem Layout
         1. Libexecdir
	ok

   7. Use rpmlint
         1. Rpmlint Errors
	See above.

   8. Changelogs
	correct.

   9. Tags
	None.
	

  10. BuildRoot tag
         1. Prepping BuildRoot For %install
	Done.

  11. Requires
         1. PreReq
         2. File Dependencies
	ok.

  12. BuildRequires
        ok.

  13. Summary and description
	Can you add more to the summary?
	

  14. Encoding
         Fine.

  15. Documentation
	ok.
	
  16. Compiler flags
	ok.

  17. Debuginfo packages
	ok.

  18. Exclusion of Static Libraries
         .la's removed. good.

  19. Duplication of system libraries
	none.

  20. Beware of Rpath
  21. Configuration files
  22. Init Scripts
  23. Desktop files
  24. Macros
         ok
  25. Handling Locale Files
	NA
  26. Timestamps
  27. Parallel make
  28. Scriptlets requirements
  29. Running scriptlets only in certain situations
  30. Scriplets are only allowed to write in certain directories
  31. Conditional dependencies
	none.
  32. Build packages with separate user accounts
  33. Relocatable packages
  34. Code Vs Content
  35. File and Directory Ownership
	ok.
  36. Users and Groups
  37. Web Applications
  38. Conflicts
	none.
  39. No External Kernel Modules

      - MUST: rpmlint must be run on every package. The output should be posted
in the review.
      - MUST: The package must be named according to the Package Naming Guidelines.
      - MUST: The spec file name must match the base package %{name}, in the
format %{name}.spec unless your package has an exemption on Package Naming
Guidelines.
      - MUST: The package must meet the Packaging Guidelines.
      - MUST: The package must be licensed with a Fedora approved license and
meet the Licensing Guidelines.
      - MUST: The License field in the package spec file must match the actual
license.
      - MUST: If (and only if) the source package includes the text of the
license(s) in its own file, then that file, containing the text of the
license(s) for the package must be included in %doc.
      - MUST: The spec file must be written in American English.
      - MUST: The spec file for the package MUST be legible. If the reviewer is
unable to read the spec file, it will be impossible to perform a review. Fedora
is not the place for entries into the Obfuscated Code Contest
(http://www.ioccc.org/).
      - MUST: The sources used to build the package must match the upstream
source, as provided in the spec URL. Reviewers should use md5sum for this task.
If no upstream URL can be specified for this package, please see the Source URL
Guidelines for how to deal with this.

Done.

      - MUST: The package must successfully compile and build into binary rpms
on at least one supported architecture.
Works on i686.

      - MUST: All build dependencies must be listed in BuildRequires.
Done.

      
      - MUST: Every binary RPM package which stores shared library files (not
just symlinks) in any of the dynamic linker's default paths, must call ldconfig
in %post and %postun. 

Done.

      - MUST: If the package is designed to be relocatable, the packager must
state this fact in the request for review, along with the rationalization for
relocation of that specific package. 
      - MUST: A package must own all directories that it creates. If it does not
create a directory that it uses, then it should require a package which does
create that directory. Refer to the Guidelines for examples.
      - MUST: A package must not contain any duplicate files in the %files listing.
      - MUST: Permissions on files must be set properly. Executables should be
set with executable permissions, for example. Every %files section must include
a %defattr(...) line.
      - MUST: Each package must have a %clean section, which contains rm -rf
%{buildroot} (or $RPM_BUILD_ROOT).
      - MUST: Each package must consistently use macros, as described in the
macros section of Packaging Guidelines.
      - MUST: The package must contain code, or permissable content. This is
described in detail in the code vs. content section of Packaging Guidelines.
      - MUST: Large documentation files should go in a -doc subpackage. (The
definition of large is left up to the packager's best judgement, but is not
restricted to size. Large can refer to either size or quantity)
      - MUST: If a package includes something as %doc, it must not affect the
runtime of the application. To summarize: If it is in %doc, the program must run
properly if it is not present.
      - MUST: Header files must be in a -devel package.

/usr/lib/libffi-2.99.4/include/ffi.h
/usr/lib/libffi-2.99.4/include/ffitarget.h

Why aren't these headers installed in /usr/include/ ?


      - MUST: Static libraries must be in a -static package.
      - MUST: Packages containing pkgconfig(.pc) files must 'Requires:
pkgconfig' (for directory ownership and usability).

Must add Requires: pkgconfig 

      - MUST: If a package contains library files with a suffix (e.g.
libfoo.so.1.1), then library files that end in .so (without suffix) must go in a
-devel package.
      - MUST: In the vast majority of cases, devel packages must require the
base package using a fully versioned dependency: Requires: %{name} =
%{version}-%{release} 
      - MUST: Packages must NOT contain any .la libtool archives, these should
be removed in the spec.
done.
      - MUST: Packages containing GUI applications must include a
%{name}.desktop file, and that file must be properly installed with
desktop-file-install in the %install section. This is described in detail in the
desktop files section of Packaging Guidelines. If you feel that your packaged
GUI application does not need a .desktop file, you must put a comment in the
spec file with your explanation.
      - MUST: Packages must not own files or directories already owned by other
packages. The rule of thumb here is that the first package to be installed
should own the files or directories that other packages may rely upon. This
means, for example, that no package in Fedora should ever share ownership with
any of the files or directories owned by the filesystem or man package. If you
feel that you have a good reason to own a file or directory that another package
owns, then please present that at package review time.
      - MUST: At the beginning of %install, each package MUST run rm -rf
%{buildroot} (or $RPM_BUILD_ROOT). See Prepping BuildRoot For %install for details.
      - MUST: All filenames in rpm packages must be valid UTF-8.

      - SHOULD: If the source package does not include license text(s) as a
separate file from upstream, the packager SHOULD query upstream to include it.
      - SHOULD: The description and summary sections in the package spec file
should contain translations for supported Non-English languages, if available.
      - SHOULD: The package should compile and build into binary rpms on all
supported architectures.
      - SHOULD: The reviewer should test that the package functions as
described. A package should not segfault instead of running, for example.
      - SHOULD: If scriptlets are used, those scriptlets must be sane. This is
vague, and left up to the reviewers judgement to determine sanity.
      - SHOULD: Usually, subpackages other than devel should require the base
package using a fully versioned dependency.
      - SHOULD: The placement of pkgconfig(.pc) files depends on their usecase,
and this is usually for development purposes, so should be placed in a -devel
pkg. A reasonable exception is that the main pkg itself is a devel tool not
installed in a user runtime, e.g. gcc or gdb.

ok.
Comment 30 Anthony Green 2008-02-15 10:49:04 EST
(In reply to comment #29)
> Why are *.h files in /usr/lib/libffi-2.99.8/include and not /usr/include?

Because they are platform dependent, hence not-multilib clean.  The x86 headers
are different from the x86-64 headers.  People should use pkg-config to find the
right headers.
 
> libffi-devel.i686: E: only-non-binary-in-usr-lib
> Verify this is ok.

Yes, this is fine.  It's just the .so symlink and the header files.
 
>   13. Summary and description
> 	Can you add more to the summary?

Ok.
	
> Must add Requires: pkgconfig 

Ok.

Updated files here....
http://spindazzle.org/Fedora/libffi-2.99.9-1.fc8.src.rpm
http://spindazzle.org/Fedora/libffi.spec

Is this approved?

Spot - if it's OK with you, I would like to (co)maintain this package in Fedora.
Comment 31 Lillian Angel 2008-02-15 10:52:44 EST
APPROVED.
Comment 32 Jakub Jelinek 2008-02-15 10:58:11 EST
ffi.h still could go into /usr/include, just ffitarget.h is target specific, right?
Comment 33 Anthony Green 2008-02-15 11:05:26 EST
(In reply to comment #32)
> ffi.h still could go into /usr/include, just ffitarget.h is target specific,
right?

No, unfortunately that's not how it works today.  This could probably be changed
(like in spot's wrapper headers), but I'm not sure it's worth the effort. 
Comment 34 Anthony Green 2008-02-15 11:19:24 EST
New Package CVS Request
=======================
Package Name: libffi
Short Description: A portable foreign function interface library
Owners: green
Branches: F-8
InitialCC: 
Cvsextras Commits: yes
Comment 35 Kevin Fenzi 2008-02-15 12:24:05 EST
FYI, it's better if the reviewer sets the fedora-review flag to + to approve a
package so we can be sure who approved it, etc... No big deal since it's clear
this was approved, but please do keep it in mind moving forward. 

Also, should spot be listed as co-maintainer? I guess he can add himself when he
gets back... 

cvs done.
Comment 36 Anthony Green 2008-02-15 12:59:42 EST
(In reply to comment #35)
> Also, should spot be listed as co-maintainer? I guess he can add himself when he
> gets back... 

I would have done this , but I wasn't sure what his FAS account name was.  How
would I find something like that out?


> 
> cvs done.

Thanks

It's built for devel.

Comment 37 Kevin Fenzi 2008-02-15 13:07:45 EST
You can look for a maintainers FAS account name in: 
https://admin.fedoraproject.org/accounts/dump-group.cgi?group=cvsextras&format=plain
(note that you do need to use your account/password to access this list).
Comment 38 Lubomir Kundrak 2008-04-14 16:07:53 EDT
This is required for OpenJDK in EPEL to be build for ppc. I'd be very thankful
if you could maintain the EL-5 branch. In case you're not interested please let
me know and I'll request and maintain the branch myself.
Comment 39 Anthony Green 2008-04-14 16:28:20 EDT
(In reply to comment #38)
> This is required for OpenJDK in EPEL to be build for ppc. I'd be very thankful
> if you could maintain the EL-5 branch. In case you're not interested please let
> me know and I'll request and maintain the branch myself.

Please go ahead and do that.

Thanks!

AG
Comment 40 Lubomir Kundrak 2008-04-14 16:32:24 EDT
Package Change Request
======================
Package Name: libffi
New Branches: EL-5
New branch owner: lkundrak
New branch cvsextras commits: yes
Comment 41 Kevin Fenzi 2008-04-14 20:22:54 EDT
cvs done.
Comment 42 David Brown 2012-08-16 15:08:07 EDT
Package Change Request
======================
Package Name: libffi
New Branches: el6
Owners: dmlb2000
Comment 43 David Brown 2012-08-16 15:09:50 EDT
(In reply to comment #42)
> Package Change Request
> ======================
> Package Name: libffi
> New Branches: el6
> Owners: dmlb2000

Oopse its already in el6... ignore please

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