Topic: Problem building latest from git

Hi,
I got this error (or warning) by compiling latest sources from git:

Configuration summary for cyassl version 2.3.1

   * Installation prefix:       /usr/local
   * System type:               unknown-linux-gnu
   * Host CPU:                  x86_64
   * C Compiler:                gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
   * C Flags:                     -O2 -Werror -Wall -Wextra -std=c99 -Wbad-function-cast -Wmissing-prototypes -Wnested-externs -Woverride-init -Wlogical-op -Wno-strict-aliasing -Wfloat-equal -Wundef -Wpointer-arith -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Wmissing-declarations -Wswitch-enum -Winit-self -Wmissing-field-initializers -Wdeclaration-after-statement -Waddress -Wmissing-noreturn -Wnormalized=id -Wstrict-overflow=1 -Wformat -Wformat-security -Wpointer-sign -Wshadow -Wswitch-default -Warray-bounds
   * C++ Compiler:              g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
   * C++ Flags:                 -g -O2 -D_FORTIFY_SOURCE=2 -Werror -Wall -Wextra -Wpragmas -Waddress -Warray-bounds -Wchar-subscripts -Wcomment -Wctor-dtor-privacy -Wfloat-equal -Wformat=2 -Wmissing-field-initializers -Wmissing-noreturn -Wlogical-op -Wnon-virtual-dtor -Wnormalized=id -Woverloaded-virtual -Wpointer-arith -Wredundant-decls -Wshadow -Wsign-compare -Wstrict-overflow=1 -Wswitch-enum -Wundef -Wunused-result -Wunused-variable -Wwrite-strings -floop-parallelize-all -fwrapv -ggdb
   * CPP Flags:                 
   * Assertions enabled:       
   * Debug enabled:             
   * Warnings as failure:       yes

---
make  all-am
make[1]: Entering directory `/home/luca/Work/phoenix/neteye/workspace/cyassl-git'
  CC     src/src_libcyassl_la-internal.lo
src/internal.c: In function 'Encrypt':
src/internal.c:2674:26: error: declaration of 'buffer' shadows a global declaration [-Werror=shadow]
./cyassl/internal.h:573:3: error: shadowed declaration is here [-Werror=shadow]
cc1: all warnings being treated as errors
make[1]: *** [src/src_libcyassl_la-internal.lo] Error 1
make[1]: Leaving directory `/home/luca/Work/phoenix/neteye/workspace/cyassl-git'
make: *** [all] Error 2

without flags:

make  all-am
make[1]: Entering directory `/home/luca/Work/phoenix/neteye/workspace/cyassl-git'
  CC     src/src_libcyassl_la-internal.lo
src/internal.c: In function 'ProcessReply':
src/internal.c:3182:24: error: 'ret' may be used uninitialized in this function [-Werror=uninitialized]
cc1: all warnings being treated as errors
make[1]: *** [src/src_libcyassl_la-internal.lo] Error 1
make[1]: Leaving directory `/home/luca/Work/phoenix/neteye/workspace/cyassl-git'
make: *** [all] Error 2

Share

Re: Problem building latest from git

Can you do a git pull

./autogen.sh
./configure
make clean
make
?

I just checked in some changes for the new build warnings/errors for linux64.

Share

Re: Problem building latest from git

now gives me
Configuration summary for cyassl embedded SSL version 2.3.1

   * Installation prefix:       /usr/local
   * System type:               unknown-linux-gnu
   * Host CPU:                  x86_64
   * C Compiler:                gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
   * C Flags:                      -Werror -Wall -Wextra -Wbad-function-cast -Wmissing-prototypes -Wnested-externs -Woverride-init -Wno-strict-aliasing -Wfloat-equal -Wundef -Wpointer-arith -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Wmissing-declarations -Wswitch-enum -Winit-self -Wmissing-field-initializers -Wdeclaration-after-statement -Waddress -Wmissing-noreturn -Wnormalized=id -Wstrict-overflow=1 -Wformat -Wformat-security -Wpointer-sign -Wshadow -Wswitch-default -Warray-bounds
   * C++ Compiler:              g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
   * C++ Flags:                 -g -O2 -D_FORTIFY_SOURCE=2 -Werror -Wall -Wextra -Wpragmas -Waddress -Warray-bounds -Wchar-subscripts -Wcomment -Wctor-dtor-privacy -Wfloat-equal -Wformat=2 -Wmissing-field-initializers -Wmissing-noreturn -Wnon-virtual-dtor -Wnormalized=id -Woverloaded-virtual -Wpointer-arith -Wredundant-decls -Wshadow -Wsign-compare -Wstrict-overflow=1 -Wswitch-enum -Wundef -Wunused-result -Wunused-variable -Wwrite-strings -floop-parallelize-all -fwrapv -ggdb
   * CPP Flags:                 
   * Assertions enabled:       
   * Debug enabled:             
   * Warnings as failure:       yes

---
make  all-am
make[1]: Entering directory `/home/luca/Work/phoenix/neteye/workspace/cyassl-git'
  CC     src/src_libcyassl_la-internal.lo
  CC     src/src_libcyassl_la-io.lo
  CC     src/src_libcyassl_la-keys.lo
  CC     src/src_libcyassl_la-ssl.lo
  CC     src/src_libcyassl_la-tls.lo
  CC     ctaocrypt/src/src_libcyassl_la-asn.lo
  CC     ctaocrypt/src/src_libcyassl_la-coding.lo
  CC     ctaocrypt/src/src_libcyassl_la-des3.lo
  CC     ctaocrypt/src/src_libcyassl_la-hmac.lo
  CC     ctaocrypt/src/src_libcyassl_la-md5.lo
  CC     ctaocrypt/src/src_libcyassl_la-md4.lo
  CC     ctaocrypt/src/src_libcyassl_la-random.lo
  CC     ctaocrypt/src/src_libcyassl_la-rsa.lo
  CC     ctaocrypt/src/src_libcyassl_la-sha.lo
  CC     ctaocrypt/src/src_libcyassl_la-aes.lo
ctaocrypt/src/aes.c:780:5: error: no previous prototype for 'AES_set_encrypt_key' [-Werror=missing-prototypes]
ctaocrypt/src/aes.c:802:5: error: no previous prototype for 'AES_set_decrypt_key' [-Werror=missing-prototypes]
cc1: all warnings being treated as errors
make[1]: *** [ctaocrypt/src/src_libcyassl_la-aes.lo] Error 1
make[1]: Leaving directory `/home/luca/Work/phoenix/neteye/workspace/cyassl-git'
make: *** [all] Error 2

Share

Re: Problem building latest from git

It looks like you're adding options, at least --enable-aesni.  What else are you adding?

I've checked in a fix for the new warning system with aesni.

Share

Re: Problem building latest from git

The options are: --enable-sniffer  --enable-sha512 --enable-aesgcm --enable-aesni --enable-ripemd --enable-hc128 --enable-fastmath

you know if sha512 aesgcm aesni ripemd hc128 are used in browsers like firefox/chrome/ie?

Share

Re: Problem building latest from git

ripemd and hc128 aren't used by browsers.  aesni is a way to process AES in hardware on a compatible Intel chipset, but it's still just normal AES to the browser.  aesgcm is starting to be used by browsers.

Share

Re: Problem building latest from git

thanks,
I will keep --enable-sniffer  --enable-sha512 --enable-aesgcm --enable-aesni --enable-fastmath

the hugecache option is used by sniffer or only by web server?

Share

Re: Problem building latest from git

I also have an issue building WolfSSL from git on Linux:

erc@pahdev1 wolfssl (master)$ make
make -j3  all-am
make[1]: Entering directory `/usr/local/src/wolfssl'
  CC     wolfcrypt/src/src_libwolfssl_la-integer.lo
  CC     src/src_libwolfssl_la-internal.lo
  CC     src/src_libwolfssl_la-io.lo
cc1: warnings being treated as errors
wolfcrypt/src/integer.c: In function 's_mp_add':
wolfcrypt/src/integer.c:1512: error: declaration of 'min' shadows a global declaration
./wolfcrypt/src/misc.c:224: error: shadowed declaration is here
wolfcrypt/src/integer.c: In function 's_mp_sub':
wolfcrypt/src/integer.c:1599: error: declaration of 'min' shadows a global declaration
./wolfcrypt/src/misc.c:224: error: shadowed declaration is here
make[1]: *** [wolfcrypt/src/src_libwolfssl_la-integer.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/usr/local/src/wolfssl'
make: *** [all] Error 2

Share

Re: Problem building latest from git

Hi n7ekg,

You are having a conflict between the min() function and the local variable called min inside integer.c.

I've submitted a patch for this, since min/max as a local variable name isn't ideal.
PR #747: https://github.com/wolfSSL/wolfssl/pull/747

However you could also try defining "WOLFSSSL_HAVE_MIN".
./configure CFLAGS="-DWOLFSSSL_HAVE_MIN"

Thanks, David Garske, wolfSSL

Share

10 (edited by n7ekg 2017-02-09 21:03:50)

Re: Problem building latest from git

dgarske wrote:

Hi n7ekg,

You are having a conflict between the min() function and the local variable called min inside integer.c.

I've submitted a patch for this, since min/max as a local variable name isn't ideal.
PR #747: https://github.com/wolfSSL/wolfssl/pull/747

However you could also try defining "WOLFSSSL_HAVE_MIN".
./configure CFLAGS="-DWOLFSSSL_HAVE_MIN"

Thanks, David Garske, wolfSSL

No workee sad

I blew away the wolfssl directory and did a git clone, then ran through autogen.sh, configure, and make:

erc@pahdev1 wolfssl (master)$ ./autogen.sh;./configure CFLAGS="-DWOLFSSSL_HAVE_M
IN";make clean;make

[...]

cc1: warnings being treated as errors
wolfcrypt/src/integer.c: In function 's_mp_add':
wolfcrypt/src/integer.c:1512: error: declaration of 'min' shadows a global declaration
./wolfcrypt/src/misc.c:224: error: shadowed declaration is here
wolfcrypt/src/integer.c: In function 's_mp_sub':
wolfcrypt/src/integer.c:1599: error: declaration of 'min' shadows a global declaration
./wolfcrypt/src/misc.c:224: error: shadowed declaration is here
  CC     src/src_libwolfssl_la-internal.lo
make[1]: *** [wolfcrypt/src/src_libwolfssl_la-integer.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/usr/local/src/wolfssl'
make: *** [all] Error 2

Share

11 (edited by n7ekg 2017-02-09 22:24:39)

Re: Problem building latest from git

I looked at the PR - the code fix looks good, but it looks like it hasn't been merged yet.

Share

Re: Problem building latest from git

Hi n7ekg,

That pull request is going through internal automated testing and peer review. Should get merged in shortly. You can pull those changes in locally until then.

To checkout a pull request you can use:
git fetch origin pull/747/head:int_min_max
git checkout int_min_max

Thanks, David Garske, wolfSSL

Share

Re: Problem building latest from git

Got it, thanks! Worked that time smile

Please let me know when the PR is merged, so I can go back to the master branch smile  Thanks!

Share