Skip to content

Commit f943416

Browse files
committed
protobuf: fix compilation on armv6l (libatomic)
1 parent 4f99a88 commit f943416

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

releases.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3346,6 +3346,7 @@
33463346
"protoc"
33473347
],
33483348
"versions": [
3349+
"25.2-4",
33493350
"25.2-3",
33503351
"25.2-2",
33513352
"25.2-1",

subprojects/packagefiles/protobuf/meson.build

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,17 @@ absl_string_view_dep = dependency(
3737
default_options: ['cpp_std=c++17'],
3838
)
3939

40+
if meson.version().version_compare('>=1.7.0')
41+
atomic_dep = dependency('atomic')
42+
else
43+
# Try to pick up libatomic. If it isn't available, hope that the host machine doesn't require it for atomics
44+
# support. If it doesn't, protobuf will fail to compile.
45+
atomic_dep = cc.find_library(
46+
'atomic',
47+
required: false,
48+
)
49+
endif
50+
4051
deps = [
4152
dependency('absl_base'),
4253
dependency('absl_cord'),
@@ -58,6 +69,7 @@ deps = [
5869
'dbghelp',
5970
required: host_machine.system() == 'windows',
6071
),
72+
atomic_dep,
6173
]
6274

6375
incdir = include_directories('src')
@@ -136,6 +148,7 @@ protobuf_lite_dep = declare_dependency(
136148
compile_args: imp,
137149
link_with: libprotobuf_lite,
138150
include_directories: incdir,
151+
dependencies: atomic_dep,
139152
)
140153

141154
libprotobuf_src = files(
@@ -218,8 +231,8 @@ libprotobuf_src = files(
218231
'src/google/protobuf/wrappers.pb.cc',
219232
)
220233
libprotobuf_linker_args = (is_msvc ? [
221-
'/export:??$MergeFrom@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@RepeatedPtrFieldBase@internal@protobuf@google@@QEAAXAEBV0123@@Z',
222-
] : []
234+
'/export:??$MergeFrom@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@RepeatedPtrFieldBase@internal@protobuf@google@@QEAAXAEBV0123@@Z',
235+
] : []
223236
)
224237
libprotobuf = library(
225238
'protobuf',

0 commit comments

Comments
 (0)