ResistancePlatform / resistance-miner

Resistance Miner
Other
13 stars 7 forks source link

compile warnings #8

Closed adrelanos closed 5 years ago

adrelanos commented 5 years ago
dpkg-source: info: building resistance-miner in resistance-miner_2.5.0.res3-1.dsc
 debian/rules build
dh build
   dh_update_autotools_config
   dh_autoreconf
        find ! -ipath "./debian/*" -a ! \( -path '*/.git/*' -o -path '*/.hg/*' -o -path '*/.bzr/*' -o -path '*/.svn/*' -o -path '*/CVS/*' \) -a  -type f -exec md5sum {} + -o -type l -printf "symlink  %p
" > debian/autoreconf.before
        grep -q ^XDT_ configure.ac
        autoreconf -f -i
configure.ac:15: installing './compile'
configure.ac:4: installing './config.guess'
configure.ac:4: installing './config.sub'
configure.ac:6: installing './install-sh'
configure.ac:6: installing './missing'
Makefile.am: installing './INSTALL'
Makefile.am: installing './depcomp'
        find ! -ipath "./debian/*" -a ! \( -path '*/.git/*' -o -path '*/.hg/*' -o -path '*/.bzr/*' -o -path '*/.svn/*' -o -path '*/CVS/*' \) -a  -type f -exec md5sum {} + -o -type l -printf "symlink  %p
" > debian/autoreconf.after
   dh_auto_configure
        ./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=\${prefix}/include --mandir=\${prefix}/share/man --infodir=\${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=\${prefix}/lib/x86_64-linux-gnu --runstatedir=/run --disable-maintainer-mode --disable-dependency-tracking
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether make supports the include directive... yes (GNU style)
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... none
checking for gcc option to accept ISO C99... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking whether gcc needs -traditional... no
checking dependency style of gcc... none
checking for ranlib... ranlib
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking sys/endian.h usability... no
checking sys/endian.h presence... no
checking for sys/endian.h... no
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking for sys/sysctl.h... yes
checking whether be32dec is declared... no
checking whether le32dec is declared... no
checking whether be32enc is declared... no
checking whether le32enc is declared... no
checking for size_t... yes
checking for working alloca.h... yes
checking for alloca... yes
checking for getopt_long... yes
checking for json_loads in -ljansson... no
checking for pthread_create in -lpthread... yes
checking for gawk... (cached) mawk
checking for curl-config... /usr/bin/curl-config
checking for the version of libcurl... 7.64.0
checking for libcurl >= version 7.15.2... yes
checking whether libcurl is usable... yes
checking for curl_free... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating compat/Makefile
config.status: creating compat/jansson/Makefile
config.status: creating cpuminer-config.h
config.status: executing depfiles commands
   dh_auto_build
        make -j8
make[1]: Entering directory '/build/resistance-miner-2.5.0.res3'
make  all-recursive
make[2]: Entering directory '/build/resistance-miner-2.5.0.res3'
Making all in compat
make[3]: Entering directory '/build/resistance-miner-2.5.0.res3/compat'
Making all in jansson
make[4]: Entering directory '/build/resistance-miner-2.5.0.res3/compat/jansson'
gcc -DHAVE_CONFIG_H -I. -I../..   -Wdate-time -D_FORTIFY_SOURCE=2  -g -O2 -fdebug-prefix-map=/build/resistance-miner-2.5.0.res3=. -fstack-protector-strong -Wformat -Werror=format-security -c -o dump.o dump.c
gcc -DHAVE_CONFIG_H -I. -I../..   -Wdate-time -D_FORTIFY_SOURCE=2  -g -O2 -fdebug-prefix-map=/build/resistance-miner-2.5.0.res3=. -fstack-protector-strong -Wformat -Werror=format-security -c -o hashtable.o hashtable.c
gcc -DHAVE_CONFIG_H -I. -I../..   -Wdate-time -D_FORTIFY_SOURCE=2  -g -O2 -fdebug-prefix-map=/build/resistance-miner-2.5.0.res3=. -fstack-protector-strong -Wformat -Werror=format-security -c -o load.o load.c
gcc -DHAVE_CONFIG_H -I. -I../..   -Wdate-time -D_FORTIFY_SOURCE=2  -g -O2 -fdebug-prefix-map=/build/resistance-miner-2.5.0.res3=. -fstack-protector-strong -Wformat -Werror=format-security -c -o strbuffer.o strbuffer.c
gcc -DHAVE_CONFIG_H -I. -I../..   -Wdate-time -D_FORTIFY_SOURCE=2  -g -O2 -fdebug-prefix-map=/build/resistance-miner-2.5.0.res3=. -fstack-protector-strong -Wformat -Werror=format-security -c -o utf.o utf.c
gcc -DHAVE_CONFIG_H -I. -I../..   -Wdate-time -D_FORTIFY_SOURCE=2  -g -O2 -fdebug-prefix-map=/build/resistance-miner-2.5.0.res3=. -fstack-protector-strong -Wformat -Werror=format-security -c -o value.o value.c
load.c: In function 'error_set':
load.c:95:29: warning: ' near '' directive output may be truncated writing 7 bytes into a region of size between 1 and 160 [-Wformat-truncation=]
                          "%s near '%s'", text, saved_text);
                             ^~~~~~~
In file included from /usr/include/stdio.h:873,
                 from load.c:12:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:10: note: '__builtin___snprintf_chk' output 9 or more bytes (assuming 168) into a destination of size 160
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
load.c:103:25: warning: ' near end of file' directive output may be truncated writing 17 bytes into a region of size between 1 and 160 [-Wformat-truncation=]
                      "%s near end of file", text);
                         ^~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:873,
                 from load.c:12:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:10: note: '__builtin___snprintf_chk' output between 18 and 177 bytes into a destination of size 160
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rm -f libjansson.a
ar cru libjansson.a dump.o hashtable.o load.o strbuffer.o utf.o value.o 
ar: `u' modifier ignored since `D' is the default (see `U')
ranlib libjansson.a
make[4]: Leaving directory '/build/resistance-miner-2.5.0.res3/compat/jansson'
make[4]: Entering directory '/build/resistance-miner-2.5.0.res3/compat'
make[4]: Nothing to be done for 'all-am'.
make[4]: Leaving directory '/build/resistance-miner-2.5.0.res3/compat'
make[3]: Leaving directory '/build/resistance-miner-2.5.0.res3/compat'
make[3]: Entering directory '/build/resistance-miner-2.5.0.res3'
gcc -DHAVE_CONFIG_H -I.  -I./compat/jansson -pthread -Wdate-time -D_FORTIFY_SOURCE=2  -g -O2 -fdebug-prefix-map=/build/resistance-miner-2.5.0.res3=. -fstack-protector-strong -Wformat -Werror=format-security -c -o minerd-cpu-miner.o `test -f 'cpu-miner.c' || echo './'`cpu-miner.c
gcc -DHAVE_CONFIG_H -I.  -I./compat/jansson -pthread -Wdate-time -D_FORTIFY_SOURCE=2  -g -O2 -fdebug-prefix-map=/build/resistance-miner-2.5.0.res3=. -fstack-protector-strong -Wformat -Werror=format-security -c -o minerd-util.o `test -f 'util.c' || echo './'`util.c
gcc -DHAVE_CONFIG_H -I.  -I./compat/jansson -pthread -Wdate-time -D_FORTIFY_SOURCE=2  -g -O2 -fdebug-prefix-map=/build/resistance-miner-2.5.0.res3=. -fstack-protector-strong -Wformat -Werror=format-security -c -o minerd-sha2.o `test -f 'sha2.c' || echo './'`sha2.c
gcc -DHAVE_CONFIG_H -I.  -I./compat/jansson -pthread -Wdate-time -D_FORTIFY_SOURCE=2  -g -O2 -fdebug-prefix-map=/build/resistance-miner-2.5.0.res3=. -fstack-protector-strong -Wformat -Werror=format-security -c -o minerd-random.o `test -f 'random.c' || echo './'`random.c
gcc -DHAVE_CONFIG_H -I.  -I./compat/jansson -pthread -Wdate-time -D_FORTIFY_SOURCE=2  -g -O2 -fdebug-prefix-map=/build/resistance-miner-2.5.0.res3=. -fstack-protector-strong -Wformat -Werror=format-security -c -o minerd-cpuinfo.o `test -f 'cpuinfo.c' || echo './'`cpuinfo.c
gcc -DHAVE_CONFIG_H -I.  -I./compat/jansson -pthread -Wdate-time -D_FORTIFY_SOURCE=2  -g -O2 -fdebug-prefix-map=/build/resistance-miner-2.5.0.res3=. -fstack-protector-strong -Wformat -Werror=format-security -c -o minerd-res-yespower.o `test -f 'res-yespower.c' || echo './'`res-yespower.c
gcc -DHAVE_CONFIG_H -I.  -I./compat/jansson -pthread -Wdate-time -D_FORTIFY_SOURCE=2  -g -O2 -fdebug-prefix-map=/build/resistance-miner-2.5.0.res3=. -fstack-protector-strong -Wformat -Werror=format-security -c -o yespower/minerd-sha256.o `test -f 'yespower/sha256.c' || echo './'`yespower/sha256.c
gcc -DHAVE_CONFIG_H -I.  -I./compat/jansson -pthread -Wdate-time -D_FORTIFY_SOURCE=2  -g -O2 -fdebug-prefix-map=/build/resistance-miner-2.5.0.res3=. -fstack-protector-strong -Wformat -Werror=format-security -c -o yespower/minerd-yespower-opt.o `test -f 'yespower/yespower-opt.c' || echo './'`yespower/yespower-opt.c
yespower/yespower-opt.c:57:2: warning: #warning "Note: AVX and XOP are not enabled.  That's OK." [-Wcpp]
 #warning "Note: AVX and XOP are not enabled.  That's OK."
  ^~~~~~~
yespower/yespower-opt.c:530:2: warning: #warning "Note: using x86-64 inline assembly for pwxform.  That's great." [-Wcpp]
 #warning "Note: using x86-64 inline assembly for pwxform.  That's great."
  ^~~~~~~
cpu-miner.c: In function 'show_version_and_exit':
cpu-miner.c:1542:39: warning: macro "__DATE__" might prevent reproducible builds [-Wdate-time]
  printf(PACKAGE_STRING "\n built on " __DATE__ "\n features:"
                                       ^~~~~~~~
gcc  -g -O2 -fdebug-prefix-map=/build/resistance-miner-2.5.0.res3=. -fstack-protector-strong -Wformat -Werror=format-security -pthread -Wl,-z,relro -Wl,-z,now -o minerd minerd-cpu-miner.o minerd-util.o minerd-sha2.o minerd-random.o minerd-cpuinfo.o yespower/minerd-sha256.o yespower/minerd-yespower-opt.o minerd-res-yespower.o -lcurl compat/jansson/libjansson.a -lpthread  
make[3]: Leaving directory '/build/resistance-miner-2.5.0.res3'
make[2]: Leaving directory '/build/resistance-miner-2.5.0.res3'
make[1]: Leaving directory '/build/resistance-miner-2.5.0.res3'
   dh_auto_test
        make -j8 check VERBOSE=1
make[1]: Entering directory '/build/resistance-miner-2.5.0.res3'
Making check in compat
make[2]: Entering directory '/build/resistance-miner-2.5.0.res3/compat'
Making check in jansson
make[3]: Entering directory '/build/resistance-miner-2.5.0.res3/compat/jansson'
make[3]: Nothing to be done for 'check'.
make[3]: Leaving directory '/build/resistance-miner-2.5.0.res3/compat/jansson'
make[3]: Entering directory '/build/resistance-miner-2.5.0.res3/compat'
make[3]: Nothing to be done for 'check-am'.
make[3]: Leaving directory '/build/resistance-miner-2.5.0.res3/compat'
make[2]: Leaving directory '/build/resistance-miner-2.5.0.res3/compat'
make[2]: Entering directory '/build/resistance-miner-2.5.0.res3'
make[2]: Leaving directory '/build/resistance-miner-2.5.0.res3'
make[1]: Leaving directory '/build/resistance-miner-2.5.0.res3'

Real warnings or noise? Worth fixing? Priority? Dunno. You tell me.

solardiz commented 5 years ago

Thanks for reporting. The worst thing we see here isn't the warnings, but that your build overrides our CFLAGS. This is the miner, it is highly performance-critical. Our default CFLAGS are just -O2 -fomit-frame-pointer. It should be OK to add -D_FORTIFY_SOURCE=2 - the miner's performance isn't dependent on the library functions. Stack protector might or might not have significant performance impact - we need to test this. Maybe we can selectively disable it just for yespower-opt.c. And we should keep -fomit-frame-pointer and not enable debugging.

The warnings are benign, but we may address them separately. Thank you for reporting!

solardiz commented 5 years ago

Fixed in 2.5.0-res4.