Build failure on Windows through cygwin

267 views
Skip to first unread message

ARaj

unread,
Jan 8, 2015, 7:51:52 AM1/8/15
to native-cli...@googlegroups.com
Hi,
I am trying to build glibc-compat(which is a dependency to build curl) from naclports in a Windows environment.
I downloaded depot_tools, naclports and nacl sdk and chose pepper version to be 40. I am doing this in cygwin like mentioned in the home page of naclports.
My build fails with the following error:
$ NACL_ARCH=pnacl make glibc-compat
bin/naclports install glibc-compat -v --verbose-build
IsInstalled: glibc-compat -> False
Prebuilt package was built with different SDK version: 38 vs 40
mkdir: /home/arajp/naclports/src/out/logs
*** Building 'glibc-compat' [pnacl/newlib/release]
Skipping extract; No upstream archive: 'glibc-compat' [pnacl/newlib/release]
######################################################################
Configuring glibc-compat
######################################################################
chdir /home/arajp/naclports/src/out/build/glibc-compat/glibc-compat-0.1
cp -rf /home/arajp/naclports/src/ports/glibc-compat/build.sh /home/arajp/naclports/src/ports/glibc-compat/include /home/arajp/naclports/src/ports/glibc-compat/Makefile /home/arajp/naclports/src/ports/glibc-compat/pkg_info /home/arajp/naclports/src/ports/glibc-compat/README /home/arajp/naclports/src/ports/glibc-compat/src .
rm -rf out
######################################################################
Building glibc-compat
######################################################################
chdir /home/arajp/naclports/src/out/build/glibc-compat/glibc-compat-0.1
make -j1 VERBOSE=1 V=1
make[1]: Entering directory '/home/arajp/naclports/src/out/build/glibc-compat/glibc-compat-0.1'
/home/arajp/nacl_sdk/pepper_40//toolchain/win_pnacl/bin/pnacl-clang -o out/getprotobyname_r.o -c src/getprotobyname_r.c -Wno-implicit-function-declaration -Werror -Wno-unused-value -pthread -Iinclude -Isrc -D_LIBC -DNACL_SDK_VERSION=40 -I/home/arajp/nacl_sdk/pepper_40//include -I/home/arajp/nacl_sdk/pepper_40//include/pnacl
In file included from src/getprotobyname_r.c:6:
include\netdb.h:18:15: fatal error: 'netdb.h' file not found
#include_next <netdb.h>
              ^
1 error generated.
Makefile:49: recipe for target 'out/getprotobyname_r.o' failed
make[1]: *** [out/getprotobyname_r.o] Error 1
make[1]: Leaving directory '/home/arajp/naclports/src/out/build/glibc-compat/glibc-compat-0.1'
naclports: Building glibc-compat: failed.
Makefile:88: recipe for target 'glibc-compat' failed
make: *** [glibc-compat] Error 1
I do have netdb.h at /home/arajp/nacl_sdk/pepper_40//include/pnacl/netdb.h which is mentioned as an include directory in the command, but the command still fails.
Can someone help me in resolving this issue?

Sam Clegg

unread,
Jan 8, 2015, 1:22:55 PM1/8/15
to native-cli...@googlegroups.com
Hi Araj,


I don't see anything obviously wrong here. Can you try running the
highlighted comment from within the directory mentioned right about
it, but add a -v to the end of the command? This should show the
include paths actually arguments to clang.

Does the package build with newlib toolchain (simply remove
NACL_ARCH=pnacl from your commandline)?

cheers,
sam
> --
> You received this message because you are subscribed to the Google Groups
> "Native-Client-Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to native-client-di...@googlegroups.com.
> To post to this group, send email to native-cli...@googlegroups.com.
> Visit this group at http://groups.google.com/group/native-client-discuss.
> For more options, visit https://groups.google.com/d/optout.

ARaj

unread,
Jan 8, 2015, 10:26:53 PM1/8/15
to native-cli...@googlegroups.com
Here is the output.

arajp@ARAJP-LT ~/naclports/src/out/build/glibc-compat/glibc-compat-0.1
$ /home/arajp/nacl_sdk/pepper_40//toolchain/win_pnacl/bin/pnacl-clang -o out/getprotobyname_r.o -c src/getprotobyname_r.c -Wno-implicit-function-declaration -Werror -Wno-unused-value -pthread -Iinclude -Isrc -D_LIBC -DNACL_SDK_VERSION=40 -I/home/arajp/nacl_sdk/pepper_40/include -I/home/arajp/nacl_sdk/pepper_40/include/pnacl -v
clang version 3.4 (https://chromium.googlesource.com/a/native_client/pnacl-clang.git d267e1b5f1901aa53f827ecfe6a6b32a57d9198e) (https://chromium.googlesource.com/a/native_client/pnacl-llvm.git 85fd7c7fa77dde0df38e9d7c72897c139f966db7)
Target: le32-unknown-nacl
Thread model: posix
Selected GCC installation:
 "C:\cygwin64\home\arajp\nacl_sdk\pepper_40\toolchain\win_pnacl\bin\clang.exe" -cc1 -triple le32-unknown-nacl -emit-llvm-bc -disable-free -disable-llvm-verifier -main-file-name getprotobyname_r.c -mrelocation-model static -mdisable-fp-elim -fmath-errno -mconstructor-aliases -target-linker-version 2.23.2 -v -coverage-file "C:\\cygwin64\\home\\arajp\\naclports\\src\\out\\build\\glibc-compat\\glibc-compat-0.1\\out/getprotobyname_r.o" -nostdsysteminc -nobuiltininc -resource-dir "C:\\cygwin64\\home\\arajp\\nacl_sdk\\pepper_40\\toolchain\\win_pnacl\\bin\\..\\lib\\clang\\3.4" -isystem /home/arajp/nacl_sdk/pepper_40/toolchain/win_pnacl/le32-nacl/usr/include -isystem /home/arajp/nacl_sdk/pepper_40/toolchain/win_pnacl/lib/clang/3.4/include -isystem /home/arajp/nacl_sdk/pepper_40/toolchain/win_pnacl/le32-nacl/include -isystem /home/arajp/nacl_sdk/pepper_40/toolchain/win_pnacl/sdk/include -D _LIBC -D NACL_SDK_VERSION=40 -I include -I src -I /home/arajp/nacl_sdk/pepper_40/include -I /home/arajp/nacl_sdk/pepper_40/include/pnacl -c-isystem /home/arajp/nacl_sdk/pepper_40/include/pnacl -cxx-isystem /home/arajp/nacl_sdk/pepper_40/include/pnacl -O0 -Wno-implicit-function-declaration -Werror -Wno-unused-value -fno-dwarf-directory-asm -fdebug-compilation-dir "C:\\cygwin64\\home\\arajp\\naclports\\src\\out\\build\\glibc-compat\\glibc-compat-0.1" -ferror-limit 19 -fmessage-length 0 -pthread -mstackrealign -fobjc-runtime=gcc -fno-common -fdiagnostics-show-option -fno-math-builtin -o out/getprotobyname_r.o -x c src/getprotobyname_r.c
clang -cc1 version 3.4 based upon LLVM 3.4svn default target i686-pc-mingw32
ignoring nonexistent directory "/home/arajp/nacl_sdk/pepper_40/include"
ignoring nonexistent directory "/home/arajp/nacl_sdk/pepper_40/include/pnacl"
ignoring nonexistent directory "/home/arajp/nacl_sdk/pepper_40/toolchain/win_pnacl/le32-nacl/usr/include"
ignoring nonexistent directory "/home/arajp/nacl_sdk/pepper_40/toolchain/win_pnacl/lib/clang/3.4/include"
ignoring nonexistent directory "/home/arajp/nacl_sdk/pepper_40/toolchain/win_pnacl/le32-nacl/include"
ignoring nonexistent directory "/home/arajp/nacl_sdk/pepper_40/toolchain/win_pnacl/sdk/include"
ignoring nonexistent directory "/home/arajp/nacl_sdk/pepper_40/include/pnacl"
ignoring nonexistent directory "/home/arajp/nacl_sdk/pepper_40/include/pnacl"
#include "..." search starts here:
#include <...> search starts here:
 include
 src
End of search list.
In file included from src/getprotobyname_r.c:6:
include\netdb.h:18:15: fatal error: 'netdb.h' file not found
#include_next <netdb.h>
              ^
1 error generated.


I isolated the problem a little more. It appears to me that the compiler has problems with filenames given as absolute paths. For eg.
/home/arajp/nacl_sdk/pepper_canary/toolchain/win_pnacl/bin/pnacl-clang -c /home/arajp/test.c doesn't work but
cd /home/ && /home/arajp/nacl_sdk/pepper_canary/toolchain/win_pnacl/bin/pnacl-clang -c arajp/test.c works


In the failure case it reports errors like:
clang.exe: error: no such file or directory: '/home/arajp/test.c'
clang.exe: error: no input files

It is the same behavior with pepper_canary as well as pepper_40. Please note that I am doing this in cygwin environment.

ARaj

unread,
Jan 8, 2015, 10:36:50 PM1/8/15
to native-cli...@googlegroups.com
It is the same problem with newlib toolchain as well.

arajp@ARAJP-LT ~/naclports/src/out/build/glibc-compat/glibc-compat-0.1
$ /home/arajp/nacl_sdk/pepper_40//toolchain/win_x86_newlib/bin/x86_64-nacl-gcc -o out/getprotobyname_r.o -c src/getprotobyname_r.c -Wno-implicit-function-declaration -Werror -Wno-unused-value -pthread -Iinclude -Isrc -D_LIBC -DNACL_SDK_VERSION=40 -I/home/arajp/nacl_sdk/pepper_40//include -I/home/arajp/nacl_sdk/pepper_40//include/pnacl -v
Reading specs from /libexec/../lib/gcc/x86_64-nacl/4.4.3/specs
Target: x86_64-nacl
Configured with: /cygdrive/c/b/build/slave/nacl-toolchain/build/native_client/tools/SRC/gcc/configure CC='gcc -m32' CFLAGS='-O2 -g -Dinhibit_libc  -D__gthr_posix_h' LDFLAGS=-s 'CFLAGS_FOR_TARGET=-O2 -g -I/cygdrive/c/b/build/slave/nacl-toolchain/build/native_client/tools/BUILD/headers_for_build' 'CXXFLAGS_FOR_TARGET=-O2 -g -I/cygdrive/c/b/build/slave/nacl-toolchain/build/native_client/tools/BUILD/headers_for_build' --prefix=/cygdrive/c/b/build/slave/nacl-toolchain/build/native_client/tools/sdk/nacl-sdk --disable-decimal-float --disable-libgomp --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --target=x86_64-nacl --enable-linker-build-id --with-gmp=/cygdrive/c/b/build/slave/nacl-toolchain/build/native_client/tools/BUILD/.gcc-extra-install-gmp --with-mpfr=/cygdrive/c/b/build/slave/nacl-toolchain/build/native_client/tools/BUILD/.gcc-extra-install-mpfr --with-ppl=/cygdrive/c/b/build/slave/nacl-toolchain/build/native_client/tools/BUILD/.gcc-extra-install-ppl --with-host-libstdcxx='-lpwl -lstdc++ -lm' --with-cloog=/cygdrive/c/b/build/slave/nacl-toolchain/build/native_client/tools/BUILD/.gcc-extra-install-cloog-ppl --disable-ppl-version-check --disable-shared --enable-languages=c,c++,objc --enable-threads=nacl --enable-tls --with-newlib
Thread model: nacl
gcc version 4.4.3 20141015 (Native Client r13917, Git Commit 7faaabb9f10e6dcae5f2b799da43e236e65cda95) (GCC)
COLLECT_GCC_OPTIONS='-m64' '-o' 'out/getprotobyname_r.o' '-c' '-Wno-implicit-function-declaration' '-Werror' '-Wno-unused-value' '-pthread' '-Iinclude' '-Isrc' '-D_LIBC' '-DNACL_SDK_VERSION=40' '-I/home/arajp/nacl_sdk/pepper_40//include' '-I/home/arajp/nacl_sdk/pepper_40//include/pnacl' '-v' '-mtune=generic'
 /libexec/../libexec/gcc/x86_64-nacl/4.4.3/cc1.exe -quiet -v -Iinclude -Isrc -I/home/arajp/nacl_sdk/pepper_40//include -I/home/arajp/nacl_sdk/pepper_40//include/pnacl -iprefix /libexec/../lib/gcc/x86_64-nacl/4.4.3/ -isystem /home/arajp/nacl_sdk/pepper_40//toolchain/win_x86_newlib/x86_64-nacl/usr/include -D_LIBC -DNACL_SDK_VERSION=40 src/getprotobyname_r.c -quiet -dumpbase getprotobyname_r.c -m64 -mtune=generic -auxbase-strip out/getprotobyname_r.o -Wno-implicit-function-declaration -Werror -Wno-unused-value -version -o /cygdrive/c/cygwin64/tmp/ccXJuJMA.s
ignoring nonexistent directory "/home/arajp/nacl_sdk/pepper_40//toolchain/win_x86_newlib/x86_64-nacl/usr/include"
ignoring nonexistent directory "/home/arajp/nacl_sdk/pepper_40/include/pnacl"
ignoring nonexistent directory "/libexec/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/sys-include"
ignoring duplicate directory "/libexec/../lib/gcc/../../lib/gcc/x86_64-nacl/4.4.3/include"
ignoring duplicate directory "/libexec/../lib/gcc/../../lib/gcc/x86_64-nacl/4.4.3/include-fixed"
ignoring nonexistent directory "/libexec/../lib/gcc/../../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/sys-include"
ignoring duplicate directory "/libexec/../lib/gcc/../../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/include"
ignoring nonexistent directory "/home/arajp/nacl_sdk/pepper_40//include"
ignoring nonexistent directory "/home/arajp/nacl_sdk/pepper_40//include/pnacl"
#include "..." search starts here:
#include <...> search starts here:
 include
 src
 /libexec/../lib/gcc/x86_64-nacl/4.4.3/include
 /libexec/../lib/gcc/x86_64-nacl/4.4.3/include-fixed
 /libexec/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/include
End of search list.
GNU C (GCC) version 4.4.3 20141015 (Native Client r13917, Git Commit 7faaabb9f10e6dcae5f2b799da43e236e65cda95) (x86_64-nacl)
        compiled by GNU C version 4.7.3, GMP version 5.0.2, MPFR version 3.0.1.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: b9cae3cb88657414fac1ee99add1bac9
In file included from src/getprotobyname_r.c:6:
include/netdb.h:18:24: error: netdb.h: No such file or directory
In file included from src/getprotobyname_r.c:6:
include/netdb.h:29: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
cc1: warnings being treated as errors
include/netdb.h:34: error: ‘struct addrinfo’ declared inside parameter list
include/netdb.h:34: error: its scope is only this definition or declaration, which is probably not what you want
include/netdb.h:35: error: expected declaration specifiers or ‘...’ before ‘socklen_t’
include/netdb.h:36: error: expected declaration specifiers or ‘...’ before ‘socklen_t’
include/netdb.h:36: error: expected declaration specifiers or ‘...’ before ‘socklen_t’
include/netdb.h:36: error: ‘struct sockaddr’ declared inside parameter list
src/getprotobyname_r.c:8: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘struct’
src/getprotobyname_r.c:14: error: expected declaration specifiers or ‘...’ before ‘size_t’
src/getprotobyname_r.c: In function ‘__getprotobyname_r’:
src/getprotobyname_r.c:16: error: ‘NULL’ undeclared (first use in this function)
src/getprotobyname_r.c:16: error: (Each undeclared identifier is reported only once
src/getprotobyname_r.c:16: error: for each function it appears in.)



And

arajp@ARAJP-LT ~/naclports/src
$ /home/arajp/nacl_sdk/pepper_40/toolchain/win_x86_newlib/bin/x86_64-nacl-gcc -c /home/arajp/test.c
x86_64-nacl-gcc: /home/arajp/test.c: No such file or directory
x86_64-nacl-gcc: no input files

arajp@ARAJP-LT ~/naclports/src
$ cd /home/ && /home/arajp/nacl_sdk/pepper_40/toolchain/win_x86_newlib/bin/x86_64-nacl-gcc -c arajp/test.c   ---> Works

arajp@ARAJP-LT /home

ARaj

unread,
Jan 19, 2015, 7:18:29 AM1/19/15
to native-cli...@googlegroups.com, s...@chromium.org
Can someone help me in resolving this issue? Is the compiler win_pnacl/bin/pnacl-clang compiled for working with Cygwin? Is Cygwin the right environment to compile naclports on Windows?

Any inputs are highly appreciated.

Victor Khimenko

unread,
Jan 19, 2015, 3:19:57 PM1/19/15
to Native Client Discuss, Sam Clegg
On Mon, Jan 19, 2015 at 3:18 PM, ARaj <araj...@gmail.com> wrote:
Can someone help me in resolving this issue? Is the compiler win_pnacl/bin/pnacl-clang compiled for working with Cygwin? Is Cygwin the right environment to compile naclports on Windows?

Windows is not the right environment to compile naclports period. Once upon time we've tried to make naclports compatible with cygwin, but it was hard work for very little reward. Especially since "root" of cygwin keeps wandering around as described in the following document:
You can try to build naclports on cygwin and it may even work for some packages, but you are entirely on your own there. You'll need to create few symlinks to make sure all components will see all the files and then it kinda sorta works for some packages. Not for all, though, we've never had a situation where cygwin was suitable for more than a handful simplest packages.

It's much simpler and easier to build packages under Linux and then use artifacts in your Windows project rather than try and fight cygwin to build everything under Windows.
Reply all
Reply to author
Forward
0 new messages