nss 3.71 fails to build with llvm 13
Categories
(NSS :: Build, defect, P5)
Tracking
(Not tracked)
People
(Reporter: gaston, Assigned: jschanck)
Details
(Whiteboard: [nss-fx])
Attachments
(1 file)
while testing llvm 13 on OpenBSD, it seems nss last release fails to build on https://hg.mozilla.org/projects/nss/file/tip/lib/certhigh/certvfypkix.c#l819:
cc -o OpenBSD7.0_64_OPT.OBJ/certvfypkix.o -c -std=c99 -O -fPIC -DPIC -Wall -Wno-switch -pipe -DOPENBSD -Wall -Ws hadow -Qunused-arguments -Wno-parentheses-equality -Wno-array-bounds -Wno-unevaluated-expression -Werror -DXP_UNIX -UDEBUG -DNDEBUG -pthread -DNSS_DISABLE_AVX2 -DNSS_NO_INIT_SUPPORT -DSEED_ONLY_DEV_URANDOM -DUSE_UTIL_DIRECTLY -DNO _NSPR_10_SUPPORT -DSSL_DISABLE_DEPRECATED_CIPHER_SUITE_NAMES -I/usr/local/include/nspr -I../../../dist/OpenBSD7.0_6 4_OPT.OBJ/include -I../../../dist/public/nss -I../../../dist/private/nss -I/usr/local/include -O2 -pipe certvfypkix.c
certvfypkix.c:819:9: error: variable 'errLevel' set but not used [-Werror,-Wunused-but-set-variable]
int errLevel = 0;
^
1 error generated.
it seems like a wrong false positive from llvm, as the var seems used afterwards. strange ?
Assignee | ||
Comment 1•3 years ago
|
||
Assignee | ||
Comment 2•3 years ago
|
||
I reproduced this with llvm main by building with ./build.sh --clang --enable-libpkix --opt
. The errLevel variable actually is unused with this configuration, as the later PR_LOG
calls are ifdef'd out.
:gaston, could you confirm that the attached patch fixes the issue?
Reporter | ||
Comment 3•3 years ago
|
||
what's strange to me is that some lines below errLevel
is incremented, but i guess that's optimized out by the compiler since no tests are done on the value itself...
Reporter | ||
Comment 4•3 years ago
|
||
testing this commit, the build fails layer on with:
lib/freebl/shvfy.c:blapi_SHVerifyFile(), shvfy.c:337:9: error: variable 'count' set but not used
at which point you start wondering if it wouldnt make sense to use -Wno-unused-but-set-variable
if we want to keep -Werror
Updated•3 years ago
|
Reporter | ||
Comment 5•3 years ago
|
||
those were the only two errors for set but unused vars, nss 3.71 built with a similar fix applied for the count
variable
Assignee | ||
Comment 6•3 years ago
|
||
Ah, yeah, that file is only built in FIPS mode. I've updated the patch, and we'll look into building with a more recent clang in CI.
Comment 7•3 years ago
|
||
There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:jschanck, could you have a look please?
For more information, please visit auto_nag documentation.
Assignee | ||
Updated•3 years ago
|
Comment 8•3 years ago
|
||
Description
•