Skip to content

Commit c9a6760

Browse files
nbyavuzCommitfest Bot
authored and
Commitfest Bot
committed
meson: Add LLVM bitcode emissions for contrib libraries
The libraries which the bitcode files will be generated in are selected manually. Author: Andres Freund <andres@anarazel.de> Author: Nazir Bilal Yavuz <byavuz81@gmail.com> Author: Diego Fronza <diego.fronza@percona.com> Reviewed-by: Diego Fronza <diego.fronza@percona.com> Discussion: https://postgr.es/m/206b001d-1884-4081-bd02-bed5c92f02ba%40eisentraut.org
1 parent 0fe8795 commit c9a6760

File tree

40 files changed

+256
-0
lines changed

40 files changed

+256
-0
lines changed

contrib/bloom/meson.build

+5
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ install_data(
2828
kwargs: contrib_data_args,
2929
)
3030

31+
bitcode_modules += {
32+
'target': bloom,
33+
'srcfiles': bloom_sources,
34+
}
35+
3136
tests += {
3237
'name': 'bloom',
3338
'sd': meson.current_source_dir(),

contrib/bool_plperl/meson.build

+9
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@ install_data(
3737
kwargs: contrib_data_args,
3838
)
3939

40+
bitcode_modules += {
41+
'target': bool_plperl,
42+
'srcfiles': bool_plperl_sources,
43+
'additional_flags': [
44+
'-I@0@'.format(plperl_dir),
45+
perl_ccflags
46+
]
47+
}
48+
4049
tests += {
4150
'name': 'bool_plperl',
4251
'sd': meson.current_source_dir(),

contrib/btree_gin/meson.build

+5
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ install_data(
2525
kwargs: contrib_data_args,
2626
)
2727

28+
bitcode_modules += {
29+
'target': btree_gin,
30+
'srcfiles': btree_gin_sources,
31+
}
32+
2833
tests += {
2934
'name': 'btree_gin',
3035
'sd': meson.current_source_dir(),

contrib/btree_gist/meson.build

+5
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ install_data(
5555
kwargs: contrib_data_args,
5656
)
5757

58+
bitcode_modules += {
59+
'target': btree_gist,
60+
'srcfiles': btree_gist_sources,
61+
}
62+
5863
tests += {
5964
'name': 'btree_gist',
6065
'sd': meson.current_source_dir(),

contrib/citext/meson.build

+5
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ install_data(
3030
kwargs: contrib_data_args,
3131
)
3232

33+
bitcode_modules += {
34+
'target': citext,
35+
'srcfiles': citext_sources,
36+
}
37+
3338
tests += {
3439
'name': 'citext',
3540
'sd': meson.current_source_dir(),

contrib/cube/meson.build

+13
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
cube_sources = files(
44
'cube.c',
55
)
6+
bc_cube_sources = cube_sources
67

78
cube_scan = custom_target('cubescan',
89
input: 'cubescan.l',
@@ -11,13 +12,15 @@ cube_scan = custom_target('cubescan',
1112
)
1213
generated_sources += cube_scan
1314
cube_sources += cube_scan
15+
bc_cube_gen_sources = [{'srcfiles': [cube_scan]}]
1416

1517
cube_parse = custom_target('cubeparse',
1618
input: 'cubeparse.y',
1719
kwargs: bison_kw,
1820
)
1921
generated_sources += cube_parse.to_list()
2022
cube_sources += cube_parse
23+
bc_cube_gen_sources += {'srcfiles': [cube_parse[0]]}
2124

2225
if host_system == 'windows'
2326
cube_sources += rc_lib_gen.process(win32ver_rc, extra_args: [
@@ -48,6 +51,16 @@ install_headers(
4851
install_dir: dir_include_extension / 'cube',
4952
)
5053

54+
cube_dir = meson.current_source_dir()
55+
bitcode_modules += {
56+
'target': cube,
57+
'srcfiles': bc_cube_sources,
58+
'gen_sources': bc_cube_gen_sources,
59+
'additional_flags': [
60+
'-I@0@'.format(cube_dir),
61+
]
62+
}
63+
5164
tests += {
5265
'name': 'cube',
5366
'sd': meson.current_source_dir(),

contrib/dict_int/meson.build

+5
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ install_data(
2222
kwargs: contrib_data_args,
2323
)
2424

25+
bitcode_modules += {
26+
'target': dict_int,
27+
'srcfiles': dict_int_sources,
28+
}
29+
2530
tests += {
2631
'name': 'dict_int',
2732
'sd': meson.current_source_dir(),

contrib/dict_xsyn/meson.build

+5
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ install_data(
2929
}
3030
)
3131

32+
bitcode_modules += {
33+
'target': dict_xsyn,
34+
'srcfiles': dict_xsyn_sources,
35+
}
36+
3237
tests += {
3338
'name': 'dict_xsyn',
3439
'sd': meson.current_source_dir(),

contrib/earthdistance/meson.build

+6
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ install_data(
2424
kwargs: contrib_data_args,
2525
)
2626

27+
bitcode_modules += {
28+
'target': earthdistance,
29+
'srcfiles': earthdistance_sources,
30+
}
31+
32+
2733
tests += {
2834
'name': 'earthdistance',
2935
'sd': meson.current_source_dir(),

contrib/fuzzystrmatch/meson.build

+9
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ fuzzystrmatch_sources = files(
55
'dmetaphone.c',
66
'fuzzystrmatch.c',
77
)
8+
bc_fuzzystrmatch_sources = fuzzystrmatch_sources
89

910
daitch_mokotoff_h = custom_target('daitch_mokotoff',
1011
input: 'daitch_mokotoff_header.pl',
@@ -35,6 +36,14 @@ install_data(
3536
kwargs: contrib_data_args,
3637
)
3738

39+
bitcode_modules += {
40+
'target': fuzzystrmatch,
41+
'srcfiles': bc_fuzzystrmatch_sources,
42+
'additional_flags': [
43+
'-I@0@'.format(meson.current_build_dir())
44+
]
45+
}
46+
3847
tests += {
3948
'name': 'fuzzystrmatch',
4049
'sd': meson.current_source_dir(),

contrib/hstore/meson.build

+7
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ install_headers(
4343
install_dir: dir_include_extension / 'hstore',
4444
)
4545

46+
# some libraries include "hstore/hstore.h" instead of "hstore.h"
47+
hstore_dir_up = join_paths(meson.current_source_dir(), '..')
48+
bitcode_modules += {
49+
'target': hstore,
50+
'srcfiles': hstore_sources,
51+
}
52+
4653
tests += {
4754
'name': 'hstore',
4855
'sd': meson.current_source_dir(),

contrib/hstore_plperl/meson.build

+10
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@ install_data(
3737
kwargs: contrib_data_args,
3838
)
3939

40+
bitcode_modules += {
41+
'target': hstore_plperl,
42+
'srcfiles': hstore_plperl_sources,
43+
'additional_flags': [
44+
'-I@0@'.format(hstore_dir_up),
45+
'-I@0@'.format(plperl_dir),
46+
perl_ccflags,
47+
]
48+
}
49+
4050
tests += {
4151
'name': 'hstore_plperl',
4252
'sd': meson.current_source_dir(),

contrib/hstore_plpython/meson.build

+12
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,18 @@ install_data(
3030
kwargs: contrib_data_args,
3131
)
3232

33+
bitcode_modules += {
34+
'target': hstore_plpython,
35+
'srcfiles': hstore_plpython_sources,
36+
'additional_flags': [
37+
'-I@0@'.format(hstore_dir_up),
38+
'-DPLPYTHON_LIBNAME="plpython3"',
39+
'-I@0@'.format(python3_inc_dir),
40+
'-I@0@'.format(plpython_dir),
41+
perl_ccflags,
42+
]
43+
}
44+
3345
hstore_plpython_regress = [
3446
'hstore_plpython'
3547
]

contrib/intarray/meson.build

+5
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ install_data(
3333
kwargs: contrib_data_args,
3434
)
3535

36+
bitcode_modules += {
37+
'target': intarray,
38+
'srcfiles': intarray_sources,
39+
}
40+
3641
tests += {
3742
'name': 'intarray',
3843
'sd': meson.current_source_dir(),

contrib/isn/meson.build

+5
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ install_headers(
3030
install_dir: dir_include_extension / 'isn',
3131
)
3232

33+
bitcode_modules += {
34+
'target': isn,
35+
'srcfiles': isn_sources,
36+
}
37+
3338
tests += {
3439
'name': 'isn',
3540
'sd': meson.current_source_dir(),

contrib/jsonb_plperl/meson.build

+8
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ install_data(
3737
kwargs: contrib_data_args,
3838
)
3939

40+
bitcode_modules += {
41+
'target': jsonb_plperl,
42+
'srcfiles': jsonb_plperl_sources,
43+
'additional_flags': [
44+
'-I@0@'.format(plperl_dir),
45+
perl_ccflags,
46+
]
47+
}
4048

4149
tests += {
4250
'name': 'jsonb_plperl',

contrib/jsonb_plpython/meson.build

+10
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@ install_data(
3030
kwargs: contrib_data_args,
3131
)
3232

33+
bitcode_modules += {
34+
'target': jsonb_plpython,
35+
'srcfiles': jsonb_plpython_sources,
36+
'additional_flags': [
37+
'-DPLPYTHON_LIBNAME="plpython3"',
38+
'-I@0@'.format(python3_inc_dir),
39+
'-I@0@'.format(plpython_dir),
40+
]
41+
}
42+
3343
jsonb_plpython_regress = [
3444
'jsonb_plpython'
3545
]

contrib/lo/meson.build

+5
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ install_data(
2424
kwargs: contrib_data_args,
2525
)
2626

27+
bitcode_modules += {
28+
'target': lo,
29+
'srcfiles': lo_sources,
30+
}
31+
2732
tests += {
2833
'name': 'lo',
2934
'sd': meson.current_source_dir(),

contrib/ltree/meson.build

+10
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,16 @@ install_headers(
4141
install_dir: dir_include_extension / 'ltree',
4242
)
4343

44+
ltree_dir = meson.current_source_dir()
45+
ltree_dir_up = join_paths(ltree_dir, '..')
46+
bitcode_modules += {
47+
'target': ltree,
48+
'srcfiles': ltree_sources,
49+
'additional_flags': [
50+
'-I@0@'.format(ltree_dir)
51+
]
52+
}
53+
4454
tests += {
4555
'name': 'ltree',
4656
'sd': meson.current_source_dir(),

contrib/ltree_plpython/meson.build

+11
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,17 @@ install_data(
3030
kwargs: contrib_data_args,
3131
)
3232

33+
bitcode_modules += {
34+
'target': ltree_plpython,
35+
'srcfiles': ltree_plpython_sources,
36+
'additional_flags': [
37+
'-I@0@'.format(ltree_dir_up),
38+
'-DPLPYTHON_LIBNAME="plpython3"',
39+
'-I@0@'.format(python3_inc_dir),
40+
'-I@0@'.format(plpython_dir),
41+
]
42+
}
43+
3344
ltree_plpython_regress = [
3445
'ltree_plpython'
3546
]

contrib/pg_buffercache/meson.build

+5
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ install_data(
2828
kwargs: contrib_data_args,
2929
)
3030

31+
bitcode_modules += {
32+
'target': pg_buffercache,
33+
'srcfiles': pg_buffercache_sources,
34+
}
35+
3136
tests += {
3237
'name': 'pg_buffercache',
3338
'sd': meson.current_source_dir(),

contrib/pg_freespacemap/meson.build

+5
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ install_data(
2525
kwargs: contrib_data_args,
2626
)
2727

28+
bitcode_modules += {
29+
'target': pg_freespacemap,
30+
'srcfiles': pg_freespacemap_sources,
31+
}
32+
2833
tests += {
2934
'name': 'pg_freespacemap',
3035
'sd': meson.current_source_dir(),

contrib/pg_logicalinspect/meson.build

+5
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ install_data(
2222
kwargs: contrib_data_args,
2323
)
2424

25+
bitcode_modules += {
26+
'target': pg_logicalinspect,
27+
'srcfiles': pg_logicalinspect_sources,
28+
}
29+
2530
tests += {
2631
'name': 'pg_logicalinspect',
2732
'sd': meson.current_source_dir(),

contrib/pg_surgery/meson.build

+4
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ install_data(
2222
kwargs: contrib_data_args,
2323
)
2424

25+
bitcode_modules += {
26+
'target': pg_surgery,
27+
'srcfiles': pg_surgery_sources,
28+
}
2529

2630
tests += {
2731
'name': 'pg_surgery',

contrib/pg_trgm/meson.build

+5
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ install_data(
3232
kwargs: contrib_data_args,
3333
)
3434

35+
bitcode_modules += {
36+
'target': pg_trgm,
37+
'srcfiles': pg_trgm_sources,
38+
}
39+
3540
tests += {
3641
'name': 'pg_trgm',
3742
'sd': meson.current_source_dir(),

contrib/pgcrypto/meson.build

+4
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ install_data(
100100
kwargs: contrib_data_args,
101101
)
102102

103+
bitcode_modules += {
104+
'target': pgcrypto,
105+
'srcfiles': pgcrypto_sources,
106+
}
103107

104108
tests += {
105109
'name': 'pgcrypto',

0 commit comments

Comments
 (0)