Skip to content

License issues in jna/native/libffi #1691

Open

Description

@albutzbdr

Hi, using your component I've performed a license scan an noticed that several files in jna/native/libffi come with a GPL, either 2.0 or 3.0. See the accompanying export from the license scanner. Could these files be replaced so copyleft is not triggered for the rest of the repo when distributing?

Cheers

jna_GPL export.txt

Activity

  1. JaredDavis22 commented on Oct 1, 2025

    @JaredDavis22

    Hi - Does the wording in the libffi license file for the build tools help?

    https://github.com/java-native-access/jna/blob/master/native/libffi/LICENSE-BUILDTOOLS

    "The libffi source distribution contains certain code that is not part
    of libffi, and is only used as tooling to assist with the building and
    testing of libffi. This includes the msvcc.sh script used to wrap the
    Microsoft compiler with GNU compatible command-line options,
    make_sunver.pl, and the libffi test code distributed in the
    testsuite/libffi.bhaible directory. This code is distributed with
    libffi for the purpose of convenience only, and libffi is in no way
    derived from this code.

    msvcc.sh an testsuite/libffi.bhaible are both distributed under the
    terms of the GNU GPL version 2, as below.
    "

  2. JaredDavis22 commented on Oct 1, 2025

    @JaredDavis22

    I just checked the first file in the list X.java. The report given shows X.java as GPL-2.0-only. The X.java file has this text:

    " * The contents of this file is dual-licensed under 2

    • alternative Open Source/Free licenses: LGPL 2.1 or later and
    • Apache License 2.0. (starting with JNA version 4.0.0).
      "

    ahh - but line 47 does have this...

    /**

    • Object oriented X window system.
    • Some code segments in this class are based on the code of the program
    • wmctrl (licensed under GPLv2) written by Tomas Styblo <[email protected]>.
    • Thanks a lot, Tomas!
    • @author Stefan Endrullis
      */

    I am not a lawyer...

    full header below.

    "/* Copyright (c) 2008 Stefan Endrullis, All Rights Reserved
    *

    • The contents of this file is dual-licensed under 2
    • alternative Open Source/Free licenses: LGPL 2.1 or later and
    • Apache License 2.0. (starting with JNA version 4.0.0).
    • You can freely decide which license you want to apply to
    • the project.
    • You may obtain a copy of the LGPL License at:
    • http://www.gnu.org/licenses/licenses.html
    • A copy is also included in the downloadable source code package
    • containing JNA, in file "LGPL2.1".
    • You may obtain a copy of the Apache License at:
    • http://www.apache.org/licenses/
    • A copy is also included in the downloadable source code package
    • containing JNA, in file "AL2.0".
      */"
  3. albutzbdr commented on Oct 1, 2025

    @albutzbdr
    Author

    Yes, X.java is the exception - with a bit of wiggle room interpretation-wise, certainly.
    On the wording you posted: Thanks for pointing this out, I actually did overlook this. Still tricky, though. The wording doesn't cover all assets that have the GPL applied to them.
    But maybe the solution lies elsewhere. I just checked the Maven package and it seems the files are not contained in there; which would make sense, as they're build tools. So the way I see it, the final artifacts don't contain the files. Meaning, the GPL would only be problematic when compiling all the source code from this Github repo here; but not when using the Maven package.

  4. atgreen commented on Oct 3, 2026

    @atgreen
    Contributor

    I wrote that libffi license explanation years ago when license scanners first started becoming popular. None of them could distinguish build-time software from run-time software. They probably still can't.

    Related to this, however, I just submitted #1739 because the JNA binary distributions should include the libffi copyright notice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions