Closed
Description
Hi guys,
I was building all the projects to play with flutter.io on my new computer and found some problems following this page https://github.com/dart-lang/sdk/wiki/Building . There was 2 different problems, one of them I had to change the C Flags to remove Werror and the other one, it seems to be missing a define in the beginning of socket_helper.c . Below are some outputs about the 2 problems:
./tools/build.py -m release -a x64
make -j 8 BUILDTYPE=ReleaseX64 all
...
runtime/third_party/double-conversion/src/bignum.cc: In member function ‘void double_conversion::Bignum::AssignDecimalString(double_conversion::Vector<const char>)’:
runtime/third_party/double-conversion/src/bignum.cc:102:6: error: assuming signed overflow does not occur when assuming that (X + c) < X is always false [-Werror=strict-overflow]
void Bignum::AssignDecimalString(Vector<const char> value) {
^
CXX(host) out/ReleaseX64/obj.host/libdart_lib/runtime/lib/linked_hash_map.o
CXX(host) out/ReleaseX64/obj.host/libdart_lib/runtime/lib/array.o
CXX(host) out/ReleaseX64/obj.host/libdart_lib/runtime/lib/bool.o
CXX(host) out/ReleaseX64/obj.host/libdart_lib/runtime/lib/date.o
cc1plus: all warnings being treated as errors
runtime/libdouble_conversion.target.mk:1676: recipe for target 'out/ReleaseX64/obj.target/libdouble_conversion/runtime/third_party/double-conversion/src/bignum.o' failed
make: *** [out/ReleaseX64/obj.target/libdouble_conversion/runtime/third_party/double-conversion/src/bignum.o] Error 1
make: *** Waiting for unfinished jobs....
BUILD FAILED
So I removed -Werror flag from:
runtime/libdouble_conversion.host.mk
runtime/libdouble_conversion.target.mk
Then I found:
./tools/build.py -m release -a x64
make -j 8 BUILDTYPE=ReleaseX64 all
...
third_party/boringssl/src/crypto/bio/socket_helper.c: In function ‘bio_ip_and_port_to_socket_and_addr’:
third_party/boringssl/src/crypto/bio/socket_helper.c:42:19: error: storage size of ‘hint’ isn’t known
struct : hint, *result, *cur;
^
CC(host) out/ReleaseX64/obj.host/boringssl/third_party/boringssl/src/crypto/bn/bn.o
third_party/boringssl/src/crypto/bio/socket_helper.c:60:36: error: dereferencing pointer to incomplete type ‘struct addrinfo’
for (cur = result; cur; cur = cur->ai_next) {
^
CC(host) out/ReleaseX64/obj.host/boringssl/third_party/boringssl/src/crypto/bn/asm/x86_64-gcc.o
third_party/boringssl/boringssl.host.mk:1900: recipe for target 'out/ReleaseX64/obj.host/boringssl/third_party/boringssl/src/crypto/bio/socket_helper.o' failed
make: *** [out/ReleaseX64/obj.host/boringssl/third_party/boringssl/src/crypto/bio/socket_helper.o] Error 1
make: *** Waiting for unfinished jobs....
BUILD FAILED
So I placed "#define _POSIX_C_SOURCE 200112L" after the line "#define _POSIX_SOURCE"
About the gcc used to compile:
gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/5.3.1/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,objc,obj-c++,fortran,ada,go,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --disable-libgcj --with-isl --enable-libmpx --enable-gnu-indirect-function --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 5.3.1 20151207 (Red Hat 5.3.1-2) (GCC)
Thanks