Skip to content

Commit 75a842f

Browse files
xclaessejpakkane
authored andcommitted
Add libffi 3.4.4
This is a rebase of https://gitlab.freedesktop.org/gstreamer/meson-ports/libffi onto 3.4.4 release. It has been submitted upstream: libffi/libffi#746
1 parent afb1994 commit 75a842f

15 files changed

+1103
-0
lines changed

releases.json

+8
Original file line numberDiff line numberDiff line change
@@ -975,6 +975,14 @@
975975
"0.6.22-1"
976976
]
977977
},
978+
"libffi": {
979+
"dependency_names": [
980+
"libffi"
981+
],
982+
"versions": [
983+
"3.4.4-1"
984+
]
985+
},
978986
"libffmpegthumbnailer": {
979987
"dependency_names": [
980988
"libffmpegthumbnailer"

subprojects/libffi.wrap

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[wrap-file]
2+
directory = libffi-3.4.4
3+
source_url = https://github.com/libffi/libffi/releases/download/v3.4.4/libffi-3.4.4.tar.gz
4+
source_filename = libffi-3.4.4.tar.gz
5+
source_hash = d66c56ad259a82cf2a9dfc408b32bf5da52371500b84745f7fb8b645712df676
6+
patch_directory = libffi
7+
8+
[provide]
9+
dependency_names = libffi
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
custom_target(
2+
input: 'libffi.texi',
3+
output: 'libffi.info',
4+
depend_files: 'version.texi',
5+
command: [find_program('makeinfo'),
6+
'-I', meson.current_source_dir(),
7+
'-o', '@OUTPUT@',
8+
'@INPUT@'
9+
],
10+
build_by_default: true,
11+
install: true,
12+
install_dir: get_option('datadir') / 'info',
13+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
/* fficonfig.h.in. Generated from configure.ac by autoheader. */
2+
3+
/* Define if building universal (internal helper macro) */
4+
#mesondefine AC_APPLE_UNIVERSAL_BUILD
5+
6+
/* Define to the flags needed for the .section .eh_frame directive. */
7+
#mesondefine EH_FRAME_FLAGS
8+
9+
/* Define this if you want extra debugging. */
10+
#mesondefine FFI_DEBUG
11+
12+
/* Define this if you want statically defined trampolines */
13+
#mesondefine FFI_EXEC_STATIC_TRAMP
14+
15+
/* Cannot use PROT_EXEC on this target, so, we revert to alternative means */
16+
#mesondefine FFI_EXEC_TRAMPOLINE_TABLE
17+
18+
/* Define this if you want to enable pax emulated trampolines (experimental)
19+
*/
20+
#mesondefine FFI_MMAP_EXEC_EMUTRAMP_PAX
21+
22+
/* Cannot use malloc on this target, so, we revert to alternative means */
23+
#mesondefine FFI_MMAP_EXEC_WRIT
24+
25+
/* Define this if you do not want support for the raw API. */
26+
#mesondefine FFI_NO_RAW_API
27+
28+
/* Define this if you do not want support for aggregate types. */
29+
#mesondefine FFI_NO_STRUCTS
30+
31+
/* Define to 1 if you have the <alloca.h> header file. */
32+
#mesondefine HAVE_ALLOCA_H
33+
34+
/* Define if your assembler supports .cfi_* directives. */
35+
#mesondefine HAVE_AS_CFI_PSEUDO_OP
36+
37+
/* Define if your assembler supports .register. */
38+
#mesondefine HAVE_AS_REGISTER_PSEUDO_OP
39+
40+
/* Define if the compiler uses zarch features. */
41+
#mesondefine HAVE_AS_S390_ZARCH
42+
43+
/* Define if your assembler and linker support unaligned PC relative relocs.
44+
*/
45+
#mesondefine HAVE_AS_SPARC_UA_PCREL
46+
47+
/* Define if your assembler supports unwind section type. */
48+
#mesondefine HAVE_AS_X86_64_UNWIND_SECTION_TYPE
49+
50+
/* Define if your assembler supports PC relative relocs. */
51+
#mesondefine HAVE_AS_X86_PCREL
52+
53+
/* Define to 1 if you have the <dlfcn.h> header file. */
54+
#mesondefine HAVE_DLFCN_H
55+
56+
/* Define if __attribute__((visibility("hidden"))) is supported. */
57+
#mesondefine HAVE_HIDDEN_VISIBILITY_ATTRIBUTE
58+
59+
/* Define to 1 if you have the <inttypes.h> header file. */
60+
#mesondefine HAVE_INTTYPES_H
61+
62+
/* Define if you have the long double type and it is bigger than a double */
63+
#mesondefine HAVE_LONG_DOUBLE
64+
65+
/* Define if you support more than one size of the long double type */
66+
#mesondefine HAVE_LONG_DOUBLE_VARIANT
67+
68+
/* Define to 1 if you have the `memcpy' function. */
69+
#mesondefine HAVE_MEMCPY
70+
71+
/* Define to 1 if you have the `memfd_create' function. */
72+
#mesondefine HAVE_MEMFD_CREATE
73+
74+
/* Define if your compiler supports pointer authentication. */
75+
#mesondefine HAVE_PTRAUTH
76+
77+
/* Define if .eh_frame sections should be read-only. */
78+
#mesondefine HAVE_RO_EH_FRAME
79+
80+
/* Define to 1 if you have the <stdint.h> header file. */
81+
#mesondefine HAVE_STDINT_H
82+
83+
/* Define to 1 if you have the <stdio.h> header file. */
84+
#mesondefine HAVE_STDIO_H
85+
86+
/* Define to 1 if you have the <stdlib.h> header file. */
87+
#mesondefine HAVE_STDLIB_H
88+
89+
/* Define to 1 if you have the <strings.h> header file. */
90+
#mesondefine HAVE_STRINGS_H
91+
92+
/* Define to 1 if you have the <string.h> header file. */
93+
#mesondefine HAVE_STRING_H
94+
95+
/* Define to 1 if you have the <sys/memfd.h> header file. */
96+
#mesondefine HAVE_SYS_MEMFD_H
97+
98+
/* Define to 1 if you have the <sys/stat.h> header file. */
99+
#mesondefine HAVE_SYS_STAT_H
100+
101+
/* Define to 1 if you have the <sys/types.h> header file. */
102+
#mesondefine HAVE_SYS_TYPES_H
103+
104+
/* Define to 1 if you have the <unistd.h> header file. */
105+
#mesondefine HAVE_UNISTD_H
106+
107+
/* The size of `double', as computed by sizeof. */
108+
#mesondefine SIZEOF_DOUBLE
109+
110+
/* The size of `long double', as computed by sizeof. */
111+
#mesondefine SIZEOF_LONG_DOUBLE
112+
113+
/* The size of `size_t', as computed by sizeof. */
114+
#mesondefine SIZEOF_SIZE_T
115+
116+
/* Define to 1 if all of the C90 standard headers exist (not just the ones
117+
required in a freestanding environment). This macro is provided for
118+
backward compatibility; new code need not use it. */
119+
#mesondefine STDC_HEADERS
120+
121+
/* Define if symbols are underscored. */
122+
#mesondefine SYMBOL_UNDERSCORE
123+
124+
/* Define this if you are using Purify and want to suppress spurious messages.
125+
*/
126+
#mesondefine USING_PURIFY
127+
128+
/* Version number of package */
129+
#mesondefine VERSION
130+
131+
132+
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
133+
significant byte first (like Motorola and SPARC, unlike Intel). */
134+
#if defined AC_APPLE_UNIVERSAL_BUILD
135+
# if defined __BIG_ENDIAN__
136+
# define WORDS_BIGENDIAN 1
137+
# endif
138+
#else
139+
# ifndef WORDS_BIGENDIAN
140+
#mesondefine WORDS_BIGENDIAN
141+
# endif
142+
#endif
143+
144+
145+
#ifdef HAVE_HIDDEN_VISIBILITY_ATTRIBUTE
146+
#ifdef LIBFFI_ASM
147+
#ifdef __APPLE__
148+
#define FFI_HIDDEN(name) .private_extern name
149+
#else
150+
#define FFI_HIDDEN(name) .hidden name
151+
#endif
152+
#else
153+
#define FFI_HIDDEN __attribute__ ((visibility ("hidden")))
154+
#endif
155+
#else
156+
#ifdef LIBFFI_ASM
157+
#define FFI_HIDDEN(name)
158+
#else
159+
#define FFI_HIDDEN
160+
#endif
161+
#endif
162+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
ffi_h_conf = configuration_data()
2+
ffi_h_conf.set('VERSION', meson.project_version())
3+
ffi_h_conf.set('FFI_EXEC_TRAMPOLINE_TABLE', ffi_conf.get('FFI_EXEC_TRAMPOLINE_TABLE', 0))
4+
ffi_h_conf.set('HAVE_LONG_DOUBLE', ffi_conf.get('HAVE_LONG_DOUBLE', 0))
5+
ffi_h_conf.set('TARGET', target)
6+
7+
configure_file(input : 'ffi.h.in',
8+
output : 'ffi.h',
9+
configuration : ffi_h_conf,
10+
install_dir : get_option('includedir'))
11+
12+
install_headers(f'../src/@targetdir@/ffitarget.h')
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env python3
2+
3+
import sys
4+
5+
with open(sys.argv[1], 'r') as f:
6+
for line in f.readlines():
7+
line = line.strip()
8+
if line and not line.startswith('#'):
9+
print(line)
10+
sys.exit(0)
11+
12+
sys.exit(1)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env python3
2+
3+
import os
4+
import re
5+
import sys
6+
import subprocess
7+
8+
# Put output files in the builddir
9+
os.chdir(os.environ['MESON_BUILD_ROOT'])
10+
11+
infile = 'visibility-conftest.c'
12+
outfile = 'visibility-conftest.S'
13+
14+
with open(infile, 'w') as f:
15+
f.write('int __attribute__ ((visibility ("hidden"))) foo (void) { return 1; }')
16+
17+
args = sys.argv[1:]
18+
args += ['-Werror', '-S', infile, '-o', outfile]
19+
res = subprocess.run(args, stdout=subprocess.PIPE, universal_newlines=True, check=True)
20+
21+
with open(outfile, 'r') as f:
22+
if re.search('\.hidden.*foo', f.read()):
23+
sys.exit(0)
24+
print('.hidden not found in the outputted assembly')
25+
sys.exit(1)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env python3
2+
3+
import os
4+
import sys
5+
import subprocess
6+
7+
# Put output files in the builddir
8+
os.chdir(os.environ['MESON_BUILD_ROOT'])
9+
10+
infile = 'zarch-conftest.c'
11+
outfile = 'zarch-conftest.S'
12+
13+
with open(infile, 'w') as f:
14+
f.write('void foo(void) { bar(); bar(); }')
15+
16+
args = sys.argv[1:]
17+
args += ['-S', infile, '-o', outfile]
18+
res = subprocess.run(args, stdout=subprocess.PIPE, universal_newlines=True, check=True)
19+
20+
with open(outfile, 'r') as f:
21+
if 'brasl' in f.read():
22+
sys.exit(0)
23+
24+
sys.exit(1)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env python3
2+
3+
import os
4+
import sys
5+
import re
6+
import subprocess
7+
8+
# Put output files in the builddir
9+
os.chdir(os.environ['MESON_BUILD_ROOT'])
10+
11+
infile = 'ro-eh-frame-conftest.c'
12+
outfile = 'ro-eh-frame-conftest.o'
13+
14+
with open(infile, 'w') as f:
15+
f.write('extern void foo (void); void bar (void) { foo (); foo (); }')
16+
17+
args = sys.argv[1:]
18+
args += ['-c', infile, '-o', outfile]
19+
res = subprocess.run(args, stdout=subprocess.PIPE, universal_newlines=True, check=True)
20+
21+
stdout = subprocess.check_output(['readelf', '-WS', outfile], stdout=subprocess.PIPE, universal_newlines=True)
22+
if re.search('eh_frame .* WA', stdout):
23+
sys.exit(0)
24+
25+
sys.exit(1)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/env python3
2+
3+
import os
4+
import sys
5+
import re
6+
import subprocess
7+
8+
# Put output files in the builddir
9+
os.chdir(os.environ['MESON_BUILD_ROOT'])
10+
11+
infile1 = 'unwind-section-conftest.s'
12+
outfile1 = 'unwind-section-conftest.o'
13+
infile2 = 'unwind-section-conftest.c'
14+
15+
with open(infile1, 'w') as f:
16+
f.write('''
17+
.text
18+
.globl foo
19+
foo:
20+
jmp bar
21+
.section .eh_frame,"a",@unwind
22+
bar:
23+
''')
24+
25+
with open(infile2, 'w') as f:
26+
f.write('''
27+
extern void foo();
28+
int main(){foo();}
29+
''')
30+
31+
args = sys.argv[1:]
32+
subprocess.check_call(args + ['-Wa,--fatal-warnings', '-c', infile1, '-o', outfile1],
33+
stdout=subprocess.PIPE, universal_newlines=True)
34+
subprocess.check_call(args + [infile2, outfile1], stdout=subprocess.PIPE, universal_newlines=True)
35+
36+
sys.exit(0)

0 commit comments

Comments
 (0)