Issue 8000 - Warnings building contrib overlay passwd/sha2
Summary: Warnings building contrib overlay passwd/sha2
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: contrib (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-10 15:09 UTC by Michael Ströder
Modified: 2015-07-02 17:44 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Michael Ströder 2014-12-10 15:09:04 UTC
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:

[  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
Comment 1 Howard Chu 2014-12-10 22:30:35 UTC
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
>
>


-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/

Comment 2 Howard Chu 2014-12-10 23:00:42 UTC
changed notes
changed state Open to Test
moved from Incoming to Contrib
Comment 3 Quanah Gibson-Mount 2014-12-11 00:36:18 UTC
changed notes
changed state Test to Release
Comment 4 OpenLDAP project 2015-07-02 17:44:14 UTC
fixed in master
fixed in RE25
fixed in RE24
Comment 5 Quanah Gibson-Mount 2015-07-02 17:44:14 UTC
changed notes
changed state Release to Closed