Bug 59273 - fail to build mono with --enable-btls=yes
Summary: fail to build mono with --enable-btls=yes
Status: NEEDINFO
Alias: None
Product: Runtime
Classification: Mono
Component: Build ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Martin Baulig
URL:
Depends on:
Blocks:
 
Reported: 2017-09-06 21:27 UTC by irinel2k
Modified: 2018-04-05 19:54 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 59273 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
NEEDINFO

Description irinel2k 2017-09-06 21:27:48 UTC
I have an issue to build mono 5.0.0 with --enable-btls=yes
It stop at compiling boringssl with the following error:

[ 27%] Building C object boringssl/crypto/bio/CMakeFiles/bio.dir/socket.c.o
[ 27%] Building C object boringssl/crypto/bio/CMakeFiles/bio.dir/socket_helper.c.o
In file included from /data/x-tools/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sysroot/usr/include/fcntl.h:38:0,
                 from /develop/src/mono-5.0.0/external/boringssl/crypto/bio/socket_helper.c:21:
/data/x-tools/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sysroot/usr/include/sys/stat.h:372:56: error: array type has incomplete element type
 extern int futimens (int __fd, __const struct timespec __times[2]) __THROW;
                                                        ^
make[6]: *** [boringssl/crypto/bio/CMakeFiles/bio.dir/socket_helper.c.o] Error 1
make[6]: Leaving directory `/develop/src/mono-5.0.0/mono/btls/build-shared'
make[5]: *** [boringssl/crypto/bio/CMakeFiles/bio.dir/all] Error 2
make[5]: Leaving directory `/develop/src/mono-5.0.0/mono/btls/build-shared'
make[4]: *** [all] Error 2
make[4]: Leaving directory `/develop/src/mono-5.0.0/mono/btls/build-shared'
make[3]: *** [build-shared/libmono-btls-shared.so] Error 2
make[3]: Leaving directory `/develop/src/mono-5.0.0/mono/btls'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/develop/src/mono-5.0.0/mono'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/develop/src/mono-5.0.0'
make: *** [all] Error 2
root@debian:/develop/src/mono-5.0.0#

I am compiling for a NAS on Debian 7 with cross toolchain

root@debian:/develop/src/mono-5.0.0# x86_64-unknown-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=x86_64-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/data/x-tools/x86_64-unknown-linux-gnu/libexec/gcc/x86_64-unknown-linux-gnu/4.9.3/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /data/.build/src/gcc-4.9.3/configure --build=x86_64-build_pc-linux-gnu --host=x86_64-build_pc-linux-gnu --target=x86_64-unknown-linux-gnu --prefix=/data/x-tools/x86_64-unknown-linux-gnu --with-sysroot=/data/x-tools/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sysroot --enable-languages=c,c++ --with-pkgversion='crosstool-NG crosstool-ng-1.22.0' --enable-__cxa_atexit --disable-libmudflap --disable-libgomp --disable-libssp --disable-libquadmath --disable-libquadmath-support --disable-libsanitizer --with-gmp=/data/.build/x86_64-unknown-linux-gnu/buildtools --with-mpfr=/data/.build/x86_64-unknown-linux-gnu/buildtools --with-mpc=/data/.build/x86_64-unknown-linux-gnu/buildtools --with-isl=/data/.build/x86_64-unknown-linux-gnu/buildtools --with-cloog=/data/.build/x86_64-unknown-linux-gnu/buildtools --with-libelf=/data/.build/x86_64-unknown-linux-gnu/buildtools --enable-lto --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --enable-threads=posix --enable-target-optspace --with-linker-hash-style=both --enable-plugin --enable-gold --disable-nls --disable-multilib --with-local-prefix=/data/x-tools/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sysroot --enable-long-long
Thread model: posix
gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0)
Comment 1 Ludovic Henry 2017-09-21 19:26:37 UTC
Would it work if you include "time.h" before "fcntl.h" in "external/boringssl/crypto/bio/socket_helper.c:21"? Otherwise you can find more information at https://stackoverflow.com/questions/10003270/gcc-array-type-has-incomplete-element-type

martin, could you take a look?
Comment 2 irinel2k 2017-09-21 21:17:24 UTC
i was successfully avoid this error by adding time.h before sys/stat.h in my toolchain /data/x-tools/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sysroot/usr/include/fcntl.h.
I will test your option tomorrow.
Comment 3 Ludovic Henry 2018-01-24 16:39:44 UTC
Can you still reproduce with latest mono version? If so, Martin could you please take a look? Thank you.
Comment 4 irinel2k 2018-01-26 19:45:08 UTC
i still have this issue with latest stable 5.4.1.7

make[6]: Entering directory `/develop/src/mono-5.4.1.7/mono/btls/build-shared'
[ 26%] Building C object boringssl/crypto/bio/CMakeFiles/bio.dir/bio.c.o
[ 26%] Building C object boringssl/crypto/bio/CMakeFiles/bio.dir/bio_mem.c.o
[ 26%] Building C object boringssl/crypto/bio/CMakeFiles/bio.dir/buffer.c.o
[ 27%] Building C object boringssl/crypto/bio/CMakeFiles/bio.dir/connect.c.o
[ 27%] Building C object boringssl/crypto/bio/CMakeFiles/bio.dir/fd.c.o
[ 27%] Building C object boringssl/crypto/bio/CMakeFiles/bio.dir/file.c.o
[ 27%] Building C object boringssl/crypto/bio/CMakeFiles/bio.dir/hexdump.c.o
[ 28%] Building C object boringssl/crypto/bio/CMakeFiles/bio.dir/pair.c.o
[ 28%] Building C object boringssl/crypto/bio/CMakeFiles/bio.dir/printf.c.o
[ 28%] Building C object boringssl/crypto/bio/CMakeFiles/bio.dir/socket.c.o
[ 28%] Building C object boringssl/crypto/bio/CMakeFiles/bio.dir/socket_helper.c.o
In file included from /data/x-tools/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sysroot/usr/include/fcntl.h:38:0,
                 from /develop/src/mono-5.4.1.7/external/boringssl/crypto/bio/socket_helper.c:21:
/data/x-tools/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sysroot/usr/include/sys/stat.h:372:56: error: array type has incomplete element type
 extern int futimens (int __fd, __const struct timespec __times[2]) __THROW;
                                                        ^
make[6]: *** [boringssl/crypto/bio/CMakeFiles/bio.dir/socket_helper.c.o] Error 1
make[6]: Leaving directory `/develop/src/mono-5.4.1.7/mono/btls/build-shared'
make[5]: *** [boringssl/crypto/bio/CMakeFiles/bio.dir/all] Error 2
make[5]: Leaving directory `/develop/src/mono-5.4.1.7/mono/btls/build-shared'
make[4]: *** [all] Error 2
make[4]: Leaving directory `/develop/src/mono-5.4.1.7/mono/btls/build-shared'
make[3]: *** [build-shared/libmono-btls-shared.so] Error 2
make[3]: Leaving directory `/develop/src/mono-5.4.1.7/mono/btls'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/develop/src/mono-5.4.1.7/mono'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/develop/src/mono-5.4.1.7'
make: *** [all] Error 2
root@debian:/develop/src/mono-5.4.1.7#
Comment 5 Ludovic Henry 2018-04-05 19:54:56 UTC
It seems it's missing the definition for `struct timespec`. This structure should be defined in time.h which is included right before fcntl.h which itself includes sys/stat.h which is where the error occurs. This doesn't seem to have anything to do with mono, but more with either boringssl which doesn't include system headers in the right order, or with the system headers which have slightly different dependencies than on other platforms.

Can you reproduce with a simple hello world C file which includes the headers in the same order as in external/boringssl/crypto/bio/socket_helper.c?