NaClPM
NaClPM

Reputation: 131

Can't build NaCl examples in Cygwin

I am still struggling to build the examples. The clang process always fails and returns 127.

/home/ned/nacl_sdk/pepper_canary/toolchain/win_pnacl/host_x86_32/bin/clang.exe \
    -c testing.cc -Wall \
    -I/home/ned/nacl_sdk/pepper_canary/include \
    -I/home/ned/nacl_sdk/pepper_canary/include/pnacl

This produces no diagnostics and does not create any output.

I am running in Cygwin.

The above is simplified example. If add diagnostics to driver_tools.py, I see the args show below when I run the top-level Makefile in examples. If I run this full command, it still fails silently.

ARGS[0]:  /cygdrive/c/cygwin/home/ned/nacl_sdk/pepper_canary/toolchain/win_pnacl/host_x86_32/bin/clang.exe
ARGS[1:] -ccc-cxx \
-help \
-emit-llvm \
-c -O2 \
-fno-vectorize \
-fno-slp-vectorize \
-fno-common \
-pthread \
-nostdinc \
-target \
le32-unknown-nacl \
-g -MMD \
-DNDEBUG \
-Wall \
-Wno-sign-compare \
-I/home/ned/nacl_sdk/pepper_canary/include \
-I/home/ned/nacl_sdk/pepper_canary/include/pnacl \
-Wno-long-long \
-Werror \
-isystem \
/home/ned/nacl_sdk/pepper_canary/toolchain/win_pnacl/usr/local/include \
-isystem \
/home/ned/nacl_sdk/pepper_canary/toolchain/win_pnacl/host_x86_32/lib/clang/3.3/include \
-isystem \
/home/ned/nacl_sdk/pepper_canary/toolchain/win_pnacl/usr/include/c++/v1 \
-isystem \
/home/ned/nacl_sdk/pepper_canary/toolchain/win_pnacl/usr/include/c++/v1/arm-none-linux-gnueabi \
-isystem \
/home/ned/nacl_sdk/pepper_canary/toolchain/win_pnacl/usr/include/c++/v1/backward \
-isystem \
/home/ned/nacl_sdk/pepper_canary/toolchain/win_pnacl/usr/include \
-isystem \
/home/ned/nacl_sdk/pepper_canary/toolchain/win_pnacl/sdk/include \
-xc++ \
testing.cc \
-o pnacl/Release/testing.o
Return Code: 127

Upvotes: 0

Views: 358

Answers (1)

NaClPM
NaClPM

Reputation: 131

The PNaCl toolchain already includes bits and pieces of cygwin and different versions of cygwin are incompatible.

You can find and remove cygwin1.dll from the PNaCl SDK, but in general Cygwin is not supported. You should either use normal Windows tools or Mac/Linux. I traced it back to the wrong version of cygstdc++-6.dll.

What worked for me was: using cygwin make and python, but building in the DOS cmd shell. I added %NACL_SDK_ROOT%/toolchain/win_pnacl/bin to the PATH before C:/cygwin/bin so the the pnacl dll's (like cygstdc++-6.dll) were used with clang. The cygwin versions of these dll's caused clang to fail.

I hacked driver_tools.py because the tools to set DRIVER_BIN were failing. They produced a path that was the concatenation of two full paths. I didn't try to fix these functions. I just set DRIVER_BIN/DRIVER_PATH explicitly in my environment, and I referenced these variable in driver_tools.py.

PATH=${PATH}:/cygdrive/c/cygwin/home/ned/nacl_sdk/pepper_31/toolchain/win_pnacl/bin:/cygdrive/c/cygwin/bin

NACL_SDK_ROOT=C:/cygwin/home/ned/nacl_sdk/pepper_31

DRIVER_BIN=C:/cygwin/home/ned/nacl_sdk/pepper_31/toolchain/win_pnacl/bin/

DRIVER_PATH=C:/cygwin/home/ned/nacl_sdk/pepper_31/toolchain/win_pnacl/bin/

NACL_ARCH=pnacl

TOOLCHAIN=pnacl

Upvotes: 2

Related Questions