-
Bug
-
Resolution: Fixed
-
Severe (Ebuild)
-
None
-
None
-
emerge app-crypt/veracrypt
-
Blocks app-crypt/veracrypt-1.24_p7
-
Source code incompatible with C++17, which is the default for GCC>=11.
This was reported by kery on Discord.
Emerge fails at compile phase with the following error message:
/var/tmp/portage/app-crypt/veracrypt-1.24_p7/work/VeraCrypt-VeraCrypt_1.24-Update7/src/Crypto/Aes_hw_cpu.h:27:32: error: reference to ‘byte’ is ambiguous 27 | void aes_hw_cpu_decrypt (const byte *ks, byte *data); | ^~~~ In file included from /var/tmp/portage/app-crypt/veracrypt-1.24_p7/work/VeraCrypt-VeraCrypt_1.24-Update7/src/Platform/PlatformBase.h:16, from /var/tmp/portage/app-crypt/veracrypt-1.24_p7/work/VeraCrypt-VeraCrypt_1.24-Update7/src/Platform/Platform.h:16, from EncryptionAlgorithm.h:16, from EncryptionAlgorithm.cpp:13: /usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/include/g++-v11.3.0/cstddef:69:14: note: candidates are: ‘enum class std::byte’
See build.log for a complete build log.
This looks like a matter of missing header or maybe a using statement to make clear which namespace the type should be pulled from, but this is actually a C code section guarded by "extern_C".
I don't know how to solve this in the code because std::byte shouldn't even be accessible <cstddef> (which is where std::byte) is supposed to be defined wasn't even #included in this file. Upstream developers didn't bother to patch the code either (the Github master head still has the same code).
The fact is that std::byte only exists in C+17 upwards, so this is a problem that happens in systems with GCC>=11, which has -std=c17 by default. The solution they came up with was to patch their Makefile, so that if GCC>=11 is detected, it will add -std=gnu+14 to CXXFLAGS. That patch should be incorporated from v.1.25.4 on.
Therefore, there are 3 possible solutions to this issue, any of which will be enough to resolve this issue:
- - Simple add the following line to src_prepare():
append-cxxflags -std=gnu\+\+14
- - Apply this patch to change the Makefile.
- - Upgrade the package to a version >= 1.25.4 (and possibly autogen the package).