michael@stroeder.com wrote:
Full_Name: Version: RE24 OS: URL: Submission from: (NULL) (79.227.174.182)
HI!
I'm trying to package passwd/sha2 for openSUSE. The default compiler options in their build system results in these warnings:
Fixed in master. The note about compilers breaking this code is spurious. Any compiler that failed to properly compile the previous code would itself be broken.
[ 193s] + CFLAGS='-fomit-frame-pointer -fmessage-length=0 -grecord-gcc-switches -fstack-protector -O2 -Wall -D_FORTIFY_SOURCE=2 -funwind-tables -fasynchronous-unwind-tables -g -Wno-format-extra-args -fno-strict-aliasing' [ 193s] + make -j4 sysconfdir=/etc/openldap libdir=/usr/lib libexecdir=/usr/lib [ 193s] ../../../../libtool --mode=compile gcc -g -O2 -Wall -I..%2.%./../../include -I../../../../include -I../../../../servers/slapd -c slapd-sha2.c [ 193s] ../../../../libtool --mode=compile gcc -g -O2 -Wall -I../../../../include -I../../../../include -I../../../../servers/slapd -c sha2.c [ 193s] mkdir .libs [ 193s] mkdir .libs [ 193s] mkdir: cannot create directory '.libs': File exists [ 193s] gcc -g -O2 -Wall -I../../../../include -I../../../../include -I../../../../servers/slapd -c sha2.c -fPIC -DPIC -o .libs/sha2.o [ 193s] gcc -g -O2 -Wall -I../../../../include -I../../../../include -I../../../../servers/slapd -c slapd-sha2.c -fPIC -DPIC -o .libs/slapd-sha2.o [ 193s] sha2.c: In function 'SHA256_Final': [ 193s] sha2.c:608:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] [ 193s] *(sha2_word64*)&context->buffer[SHA256_SHORT_BLOCK_LENGTH] = context->bitcount; [ 193s] ^ [ 193s] sha2.c: In function 'SHA512_Last': [ 193s] sha2.c:925:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] [ 193s] *(sha2_word64*)&context->buffer[SHA512_SHORT_BLOCK_LENGTH] = context->bitcount[1]; [ 193s] ^ [ 193s] sha2.c:926:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] [ 193s] *(sha2_word64*)&context->buffer[SHA512_SHORT_BLOCK_LENGTH+8] = context->bitcount[0]; [ 193s] ^ [ 193s] gcc -g -O2 -Wall -I../../../../include -I../../../../include -I../../../../servers/slapd -c slapd-sha2.c -o slapd-sha2.o >/dev/null 2>&1 [ 193s] gcc -g -O2 -Wall -I../../../../include -I../../../../include -I../../../../servers/slapd -c sha2.c -o sha2.o >/dev/null 2>&1 [ 194s] ../../../../libtool --mode=link gcc -g -O2 -Wall -version-info 0:0:0 \ [ 194s] -rpath /usr/lib/openldap -module -o pw-sha2.la slapd-sha2.lo sha2.lo ../../../../libraries/libldap_r/libldap_r.la ../../../../libraries/liblber/liblber.la [ 194s] cc -shared .libs/slapd-sha2.o .libs/sha2.o -Wl,--rpath -Wl,/home/abuild/rpmbuild/BUILD/openldap-2.4.40/libraries/libldap_r/.libs -Wl,--rpath -Wl,/home/abuild/rpmbuild/BUILD/openldap-2.4.40/libraries/liblber/.libs -L/home/abuild/rpmbuild/BUILD/openldap-2.4.40/libraries/liblber/.libs ../../../../libraries/libldap_r/.libs/libldap_r.so ../../../../libraries/liblber/.libs/liblber.so -Wl,-soname -Wl,pw-sha2.so.0 -o .libs/pw-sha2.so.0.0.0 [ 194s] (cd .libs && rm -f pw-sha2.so.0 && ln -s pw-sha2.so.0.0.0 pw-sha2.so.0) [ 194s] (cd .libs && rm -f pw-sha2.so && ln -s pw-sha2.so.0.0.0 pw-sha2.so) [ 194s] ar cru .libs/pw-sha2.a slapd-sha2.o sha2.o [ 194s] ranlib .libs/pw-sha2.a [ 194s] creating pw-sha2.la
Overall RPM build fails with:
[ 262s] I: Program is likely to break with new gcc. Try -fno-strict-aliasing. [ 262s] W: openldap2 strict-aliasing-punning sha2.c:608, 925, 926