Crypto: use VC_INLINE for the ARM CPU_Query helpers - #1886
Conversation
|
@idrassi sorry to bother you, but would you mind to take a look? |
3dbee95 to
151b246
Compare
|
Rebased onto current master (after #1896); still a one-line-per-function change in Reproduction on master a15c996 with the OpenWrt aarch64 toolchain (gcc 14.4, musl): Same at |
| volatile int g_hasSHA256ARM = 0; | ||
|
|
||
| inline int CPU_QueryAES() | ||
| static inline int CPU_QueryAES() |
There was a problem hiding this comment.
Please use VC_INLINE for both CPU_QueryAES and CPU_QuerySHA2, following the existing helpers in cpu.c. This resolves the linkage problem while preserving our established portability macro.
There was a problem hiding this comment.
Done, both now use VC_INLINE (c06d745, rebased on current master). Checked with the OpenWrt aarch64 toolchain at -O0, -Os and -O2: no undefined CPU_Query* references and no warnings.
|
@flatstik After the |
C99 inline without static does not emit a function body, so aarch64 builds at -O0/-Os fail to link DetectArmFeatures (undefined reference to CPU_QueryAES / CPU_QuerySHA2). Use VC_INLINE like the other helpers in cpu.c. Signed-off-by: Ville Takio <ville+git@takio.fi>
151b246 to
c06d745
Compare
idrassi
left a comment
There was a problem hiding this comment.
Thank you for your contribution.
C99
inlinewithoutstaticdoes not emit a function body. On aarch64 at-O0/-Os,DetectArmFeatures()then fails to link:This showed up building VeraCrypt 1.26.29 as an OpenWrt package for
aarch64_generic(OpenWrt builds with-Os). The helpers now useVC_INLINE, like the other helpers incpu.c(IsIntel,IsAMD,IsHygon).Signed-off-by: Ville Takio ville+git@takio.fi