- Status New
- Percent Complete
- Task Type Bug Report
- Category Packages
- Assigned To No-one
- Operating System pentium4
- Severity Low
- Priority Medium
- Reported Version
- Due in Version Undecided
-
Due Date
Undecided
- Votes
- Private
Attached to Project: Arch Linux 32
Opened by Andreas Baumann - 08.07.2022
Last edited by Andreas Baumann - 08.07.2022
Opened by Andreas Baumann - 08.07.2022
Last edited by Andreas Baumann - 08.07.2022
FS#275 - [protobuf] breaks heavily on 32-bit
/build/protobuf/src/protobuf-21.2/src/google/protobuf/repeated_field.h: In instantiation of ‘constexpr int google::protobuf::internal::RepeatedFieldLowerClampLimit() [with T = long long int; int kRepHeaderSize = 4]’:
/data/work/arch32/protobuf/src/protobuf-21.2/src/google/protobuf/repeated_field.h:81:27: note: the comparison reduces to ‘(8 ⇐ 4)’
/data/work/arch32/protobuf/src/protobuf-21.2/src/google/protobuf/extension_set_unittest.cc:881:3: required from here
/data/work/arch32/protobuf/src/protobuf-21.2/src/google/protobuf/extension_set_unittest.cc:873:3: required from here
/data/work/arch32/protobuf/src/protobuf-21.2/src/google/protobuf/extension_set_unittest.cc:871:3: required from here
So, this is a mixup with int64 definitions on 32-bit machines?
Or the header size is not computed correctly..
Mmh. In the worst case this is a compiler thing..
Tried all versions between 21.1 and 21.10, all of them fail the same way, so this
is likely a compiler issue..
tried clang, no success.. it insist on using GNU ld and fails with tons of linker
errors..
Building a gcc11 fails in:
So it might be easier to try to fix protobuf for gcc 12 than to try to
fix the old compiler to build on newer toolchains.
There is also the possibility that CFLAGS play bad tricks during toolchain
building..
I had a look into this.
This happens because the TEST_REPEATED_EXTENSIONS_SPACE_USED() macro calls
with sometimes sizeof(cpptype) > sizeof(void*), such as int64_t on 32 bit architectures, thus the 8 < = 4 fail.
This was introduced by commit ab4585a6956675ce14a1cba5d321fde980bbf12b, which replaced
with the new templated function RepeatedFieldLowerClampLimit() which has the problematic assert:
I got it to build by replacing that function in src/google/protobuf/repeated_field.h with just
as it used to be before.
8 tests fail on pentium4, however I don't know if they failed before or if they are caused by this change now. I haven't touched i686 yet.
Turns out this was fixed upstream, https://github.com/protocolbuffers/protobuf/pull/10589
Unfortunately, the fix relies on C++14 (while the current release is built as C++11), so a custom patch will need to be applied until it makes it into the next release.