Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8280840: Update libFFI to 3.4.2
Reviewed-by: kcr, sykora
  • Loading branch information
Alexander Matveev committed Mar 8, 2022
1 parent ae419d7 commit 1beb323
Show file tree
Hide file tree
Showing 34 changed files with 3,437 additions and 2,548 deletions.
4 changes: 2 additions & 2 deletions modules/javafx.media/src/main/legal/libffi.md
@@ -1,9 +1,9 @@
## LibFFI v3.3
## LibFFI v3.4.2

### LibFFI License
```
libffi - Copyright (c) 1996-2019 Anthony Green, Red Hat, Inc and others.
libffi - Copyright (c) 1996-2021 Anthony Green, Red Hat, Inc and others.
See source files for details.
Permission is hereby granted, free of charge, to any person obtaining
Expand Down
@@ -1,4 +1,4 @@
libffi - Copyright (c) 1996-2019 Anthony Green, Red Hat, Inc and others.
libffi - Copyright (c) 1996-2021 Anthony Green, Red Hat, Inc and others.
See source files for details.

Permission is hereby granted, free of charge, to any person obtaining
Expand Down
Expand Up @@ -2,15 +2,36 @@
ffi_cfi.h - Copyright (c) 2014 Red Hat, Inc.
Conditionally assemble cfi directives. Only necessary for building libffi.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the ``Software''), to deal in the Software without
restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
----------------------------------------------------------------------- */

#ifndef FFI_CFI_H
#define FFI_CFI_H

#ifdef HAVE_AS_CFI_PSEUDO_OP

# define cfi_startproc .cfi_startproc
# define cfi_endproc .cfi_endproc
# define cfi_startproc .cfi_startproc
# define cfi_endproc .cfi_endproc
# define cfi_def_cfa(reg, off) .cfi_def_cfa reg, off
# define cfi_def_cfa_register(reg) .cfi_def_cfa_register reg
# define cfi_def_cfa_offset(off) .cfi_def_cfa_offset off
Expand All @@ -19,15 +40,15 @@
# define cfi_rel_offset(reg, off) .cfi_rel_offset reg, off
# define cfi_register(r1, r2) .cfi_register r1, r2
# define cfi_return_column(reg) .cfi_return_column reg
# define cfi_restore(reg) .cfi_restore reg
# define cfi_restore(reg) .cfi_restore reg
# define cfi_same_value(reg) .cfi_same_value reg
# define cfi_undefined(reg) .cfi_undefined reg
# define cfi_remember_state .cfi_remember_state
# define cfi_restore_state .cfi_restore_state
# define cfi_window_save .cfi_window_save
# define cfi_undefined(reg) .cfi_undefined reg
# define cfi_remember_state .cfi_remember_state
# define cfi_restore_state .cfi_restore_state
# define cfi_window_save .cfi_window_save
# define cfi_personality(enc, exp) .cfi_personality enc, exp
# define cfi_lsda(enc, exp) .cfi_lsda enc, exp
# define cfi_escape(...) .cfi_escape __VA_ARGS__
# define cfi_lsda(enc, exp) .cfi_lsda enc, exp
# define cfi_escape(...) .cfi_escape __VA_ARGS__

#else

Expand Down
Expand Up @@ -5,6 +5,27 @@
Common internal definitions and macros. Only necessary for building
libffi.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the ``Software''), to deal in the Software without
restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
----------------------------------------------------------------------- */

#ifndef FFI_COMMON_H
Expand Down Expand Up @@ -103,6 +124,10 @@ ffi_status ffi_prep_cif_core(ffi_cif *cif,
some targets. */
void *ffi_data_to_code_pointer (void *data) FFI_HIDDEN;

/* The arch code calls this to determine if a given closure has a
static trampoline. */
int ffi_tramp_is_present (void *closure) FFI_HIDDEN;

/* Extended cif, used in callback from assembly routine */
typedef struct
{
Expand Down
@@ -1,6 +1,7 @@
/* -----------------------------------------------------------------*-C-*-
libffi 3.3 - Copyright (c) 2011, 2014, 2019 Anthony Green
- Copyright (c) 1996-2003, 2007, 2008 Red Hat, Inc.
libffi 3.4.2
- Copyright (c) 2011, 2014, 2019, 2021 Anthony Green
- Copyright (c) 1996-2003, 2007, 2008 Red Hat, Inc.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
Expand Down Expand Up @@ -217,7 +218,8 @@ FFI_EXTERN ffi_type ffi_type_complex_longdouble;
typedef enum {
FFI_OK = 0,
FFI_BAD_TYPEDEF,
FFI_BAD_ABI
FFI_BAD_ABI,
FFI_BAD_ARGTYPE
} ffi_status;

typedef struct {
Expand Down Expand Up @@ -260,9 +262,9 @@ typedef union {
typedef union {
signed int sint;
unsigned int uint;
float flt;
char data[FFI_SIZEOF_JAVA_RAW];
void* ptr;
float flt;
char data[FFI_SIZEOF_JAVA_RAW];
void* ptr;
} ffi_java_raw;
#else
typedef ffi_raw ffi_java_raw;
Expand Down Expand Up @@ -310,7 +312,10 @@ typedef struct {
void *trampoline_table;
void *trampoline_table_entry;
#else
char tramp[FFI_TRAMPOLINE_SIZE];
union {
char tramp[FFI_TRAMPOLINE_SIZE];
void *ftramp;
};
#endif
ffi_cif *cif;
void (*fun)(ffi_cif*,void*,void**,void*);
Expand All @@ -330,6 +335,14 @@ typedef struct {
FFI_API void *ffi_closure_alloc (size_t size, void **code);
FFI_API void ffi_closure_free (void *);

#if defined(PA_LINUX) || defined(PA_HPUX)
#define FFI_CLOSURE_PTR(X) ((void *)((unsigned int)(X) | 2))
#define FFI_RESTORE_PTR(X) ((void *)((unsigned int)(X) & ~3))
#else
#define FFI_CLOSURE_PTR(X) (X)
#define FFI_RESTORE_PTR(X) (X)
#endif

FFI_API ffi_status
ffi_prep_closure (ffi_closure*,
ffi_cif *,
Expand Down
Expand Up @@ -18,6 +18,9 @@
/* Define this if you want extra debugging. */
/* #undef FFI_DEBUG */

/* Define this if you want statically defined trampolines */
/* #undef FFI_EXEC_STATIC_TRAMP */

/* Cannot use PROT_EXEC on this target, so, we revert to alternative means */
#define FFI_EXEC_TRAMPOLINE_TABLE 1

Expand Down Expand Up @@ -77,12 +80,18 @@
/* Define to 1 if you have the `memcpy' function. */
#define HAVE_MEMCPY 1

/* Define to 1 if you have the `memfd_create' function. */
/* #undef HAVE_MEMFD_CREATE */

/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1

/* Define to 1 if you have the `mkostemp' function. */
#define HAVE_MKOSTEMP 1

/* Define to 1 if you have the `mkstemp' function. */
/* #undef HAVE_MKSTEMP */

/* Define to 1 if you have the `mmap' function. */
#define HAVE_MMAP 1

Expand All @@ -95,6 +104,9 @@
/* Define if read-only mmap of a plain file works. */
#define HAVE_MMAP_FILE 1

/* Define if your compiler supports pointer authentication. */
/* #undef HAVE_PTRAUTH */

/* Define if .eh_frame sections should be read-only. */
/* #undef HAVE_RO_EH_FRAME */

Expand All @@ -110,6 +122,9 @@
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1

/* Define to 1 if you have the <sys/memfd.h> header file. */
/* #undef HAVE_SYS_MEMFD_H */

/* Define to 1 if you have the <sys/mman.h> header file. */
#define HAVE_SYS_MMAN_H 1

Expand Down Expand Up @@ -138,7 +153,7 @@
#define PACKAGE_NAME "libffi"

/* Define to the full name and version of this package. */
#define PACKAGE_STRING "libffi 3.3"
#define PACKAGE_STRING "libffi 3.4.2"

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "libffi"
Expand All @@ -147,7 +162,7 @@
#define PACKAGE_URL ""

/* Define to the version of this package. */
#define PACKAGE_VERSION "3.3"
#define PACKAGE_VERSION "3.4.2"

/* The size of `double', as computed by sizeof. */
#define SIZEOF_DOUBLE 8
Expand Down Expand Up @@ -177,7 +192,7 @@
/* #undef USING_PURIFY */

/* Version number of package */
#define VERSION "3.3"
#define VERSION "3.4.2"

/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
Expand Down
@@ -1,6 +1,7 @@
/* -----------------------------------------------------------------*-C-*-
libffi 3.3 - Copyright (c) 2011, 2014, 2019 Anthony Green
- Copyright (c) 1996-2003, 2007, 2008 Red Hat, Inc.
libffi 3.4.2
- Copyright (c) 2011, 2014, 2019, 2021 Anthony Green
- Copyright (c) 1996-2003, 2007, 2008 Red Hat, Inc.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
Expand Down Expand Up @@ -217,7 +218,8 @@ FFI_EXTERN ffi_type ffi_type_complex_longdouble;
typedef enum {
FFI_OK = 0,
FFI_BAD_TYPEDEF,
FFI_BAD_ABI
FFI_BAD_ABI,
FFI_BAD_ARGTYPE
} ffi_status;

typedef struct {
Expand Down Expand Up @@ -260,9 +262,9 @@ typedef union {
typedef union {
signed int sint;
unsigned int uint;
float flt;
char data[FFI_SIZEOF_JAVA_RAW];
void* ptr;
float flt;
char data[FFI_SIZEOF_JAVA_RAW];
void* ptr;
} ffi_java_raw;
#else
typedef ffi_raw ffi_java_raw;
Expand Down Expand Up @@ -310,7 +312,10 @@ typedef struct {
void *trampoline_table;
void *trampoline_table_entry;
#else
char tramp[FFI_TRAMPOLINE_SIZE];
union {
char tramp[FFI_TRAMPOLINE_SIZE];
void *ftramp;
};
#endif
ffi_cif *cif;
void (*fun)(ffi_cif*,void*,void**,void*);
Expand All @@ -330,6 +335,14 @@ typedef struct {
FFI_API void *ffi_closure_alloc (size_t size, void **code);
FFI_API void ffi_closure_free (void *);

#if defined(PA_LINUX) || defined(PA_HPUX)
#define FFI_CLOSURE_PTR(X) ((void *)((unsigned int)(X) | 2))
#define FFI_RESTORE_PTR(X) ((void *)((unsigned int)(X) & ~3))
#else
#define FFI_CLOSURE_PTR(X) (X)
#define FFI_RESTORE_PTR(X) (X)
#endif

FFI_API ffi_status
ffi_prep_closure (ffi_closure*,
ffi_cif *,
Expand Down
Expand Up @@ -18,6 +18,9 @@
/* Define this if you want extra debugging. */
/* #undef FFI_DEBUG */

/* Define this if you want statically defined trampolines */
/* #undef FFI_EXEC_STATIC_TRAMP */

/* Cannot use PROT_EXEC on this target, so, we revert to alternative means */
/* #undef FFI_EXEC_TRAMPOLINE_TABLE */

Expand Down Expand Up @@ -77,12 +80,18 @@
/* Define to 1 if you have the `memcpy' function. */
#define HAVE_MEMCPY 1

/* Define to 1 if you have the `memfd_create' function. */
/* #undef HAVE_MEMFD_CREATE */

/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1

/* Define to 1 if you have the `mkostemp' function. */
#define HAVE_MKOSTEMP 1

/* Define to 1 if you have the `mkstemp' function. */
/* #undef HAVE_MKSTEMP */

/* Define to 1 if you have the `mmap' function. */
#define HAVE_MMAP 1

Expand All @@ -95,6 +104,9 @@
/* Define if read-only mmap of a plain file works. */
#define HAVE_MMAP_FILE 1

/* Define if your compiler supports pointer authentication. */
/* #undef HAVE_PTRAUTH */

/* Define if .eh_frame sections should be read-only. */
/* #undef HAVE_RO_EH_FRAME */

Expand All @@ -110,6 +122,9 @@
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1

/* Define to 1 if you have the <sys/memfd.h> header file. */
/* #undef HAVE_SYS_MEMFD_H */

/* Define to 1 if you have the <sys/mman.h> header file. */
#define HAVE_SYS_MMAN_H 1

Expand Down Expand Up @@ -138,7 +153,7 @@
#define PACKAGE_NAME "libffi"

/* Define to the full name and version of this package. */
#define PACKAGE_STRING "libffi 3.3"
#define PACKAGE_STRING "libffi 3.4.2"

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "libffi"
Expand All @@ -147,7 +162,7 @@
#define PACKAGE_URL ""

/* Define to the version of this package. */
#define PACKAGE_VERSION "3.3"
#define PACKAGE_VERSION "3.4.2"

/* The size of `double', as computed by sizeof. */
#define SIZEOF_DOUBLE 8
Expand Down Expand Up @@ -177,7 +192,7 @@
/* #undef USING_PURIFY */

/* Version number of package */
#define VERSION "3.3"
#define VERSION "3.4.2"

/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
Expand Down

1 comment on commit 1beb323

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.