0

I am using the Android NDK to build a project. This morning the output of ndk-build started displaying tons of output as if I had set a flag somewhere to debug the make process. Below is part of the log, showing where this output starts. The lines I want to get rid of begin with a plus '+' in column 1.

make[1]: Entering directory `/Users/bgm/svn1.8-workspaces/cur-trunk/repo/trunk/coverage/android/Buckets/jni'
[arm64-v8a] Compile        : cover <= build_info.c
[arm64-v8a] Compile        : cover <= cover.c
/Users/bgm/svn1.8-workspaces/cur-trunk/repo/trunk/coverage/android/Buckets/jni/cover.c:314:9: note: #pragma message: __ANDROID_API__: 21
 #pragma message ("__ANDROID_API__: " STRINGIFY(__ANDROID_API__))
         ^
[arm64-v8a] SharedLibrary  : libcover.so
+ CC=/Users/bgm/download/google/ndk/android-ndk-r10d/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin/aarch64-linux-android-gcc
+ '[' -n /Users/bgm/download/google/ndk/android-ndk-r10d/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin/aarch64-linux-android-gcc ']'
+ '[' x-Wl,-soname,libcover.so '!=' x -a x-Wl,-soname,libcover.so '!=' x-c -a x-Wl,-soname,libcover.so '!=' x-E ']'
+ shift
+ '[' x-shared '!=' x -a x-shared '!=' x-c -a x-shared '!=' x-E ']'
+ shift
+ '[' x--sysroot=/Users/bgm/download/google/ndk/android-ndk-r10d/platforms/android-21/arch-arm64 '!=' x -a x--sysroot=/Users/bgm/download/google/ndk/android-ndk-r10d/platforms/android-21/arch-arm64 '!=' x-c -a x--sysroot=/Users/bgm/download/google/ndk/android-ndk-r10d/platforms/android-21/arch-arm64 '!=' x-E ']'
+ shift

... hundreds of lines like the above that start with '+'
Sam
  • 128
  • 9

1 Answers1

1

Are you running ndk-build manually in a terminal, or invoked from somewhere?

It seems like something has executed set -x in a parent process to the ndk-build command. To reverse it, run set +x in the same terminal.

mstorsjo
  • 12,983
  • 2
  • 39
  • 62
  • I'm invoking ndk-build from a Makefile: Here is what I tried based on your suggestion (I added the 'set +x;' That did not solve the problem: (cd jni; set +x; $(NDK_ROOT)/ndk-build) – Sam Mar 04 '15 at 22:44
  • When I run "ndk-build" directly from a terminal command line I also get that extra logging. I tried "set +x" before running ndk-build. That did not fix the problem. – Sam Mar 04 '15 at 23:03
  • "set -x" was the problem. Just before the logging output showed up, I'd modified some components of the build, including taking a new release of a library that included a required build script. The vendor had been debugging that script and put a "set -x" in it. – Sam Mar 05 '15 at 17:43