riscv-android-src / manifest

3 stars 4 forks source link

riscv-android-src-ndk-10 build fail #1

Open luxufan opened 3 years ago

luxufan commented 3 years ago

Build instructions:

mkdir ~/riscv-android-src-ndk-10 && cd ~/riscv-android-src-ndk-10
repo init -u git@...:riscv-android-src/manifest.git -b riscv-ndk-r20_dev
repo sync
cd ~/riscv-android-src-ndk-10/prebuilts/clang/host/darwin-x86 && ln -s ../linux-x86/clang-dev clang-dev
cd ~/riscv-android-src-ndk-10/prebuilts/clang/host/windows-x86_32 && ln -s ../linux-x86/clang-dev clang-dev
cd ~/riscv-android-src-ndk-10/prebuilts/clang/host/windows-x86 && ln -s ../linux-x86/clang-dev clang-dev
cd ~/riscv-android-src-ndk-10 && ./ndk/checkbuild.py

Errors:

/home/luxufan/llvm/build/bin/clang  -O2 -s   -o make  ar.o arscan.o commands.o default.o dir.o expand.o file.o function.o getopt.o getopt1.o implicit.o job.o main.o misc.o read.o remake.o remote-stub.o rule.o signame.o strcache.o variable.o version.o vpath.o hash.o glob/libglob.a  
glob/libglob.a(glob.o): In function `glob':
glob.c:(.text+0x363): undefined reference to `__alloca'
glob.c:(.text+0x4d8): undefined reference to `__alloca'
glob.c:(.text+0x5a1): undefined reference to `__alloca'
glob.c:(.text+0x5ea): undefined reference to `__alloca'
glob/libglob.a(glob.o): In function `glob_in_dir':
glob.c:(.text+0x10ee): undefined reference to `__alloca'
glob/libglob.a(glob.o):glob.c:(.text+0x1186): more undefined references to `__alloca' follow
clang-13: error: linker command failed with exit code 1 (use -v to see invocation)
Makefile:410: recipe for target 'make' failed
luxufan commented 3 years ago

I'm confused that why the build process depends on my own clang which is /home/luxufan/llvm/build/bin/clang ?

luxufan commented 3 years ago

And the directory /home/luxufan/llvm/build/bin is not in my PATH environment variable.

luxufan commented 3 years ago

https://stackoverflow.com/questions/51675200/install-older-version-of-gnu-make-in-ubuntu-18-04 This solution solves my preblem undefined reference to __alloca. But new problem arised:

Machine has 52 CPUs
Building modules: adb.py base-toolchain binutils canary-readme changelog clang cpufeatures gtest host-tools libandroid_support libc++ libc++abi libshaderc lit meta native_app_glue ndk-build ndk-build-shortcut ndk-stack ndk-stack-shortcut ndk-which-shortcut ndk.py ndk_helper platforms python-packages readme renderscript-libs renderscript-toolchain simpleperf source.properties sysroot system-stl toolchain vulkan wrap.sh
Build failed: libc++
Running: bash /home/luxufan/riscv-android-src-ndk-10/out/linux/android-ndk-r20/build/ndk-build -j104 V=1 'APP_ABI=armeabi-v7a arm64-v8a x86 x86_64 riscv64' 'APP_MODULES=c++_shared c++_static' BIONIC_PATH=/home/luxufan/riscv-android-src-ndk-10/bionic NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=/home/luxufan/riscv-android-src-ndk-10/external/libcxx/Android.mk NDK_APPLICATION_MK=/home/luxufan/riscv-android-src-ndk-10/external/libcxx/Application.mk NDK_OUT=/home/luxufan/riscv-android-src-ndk-10/out/libcxx/obj NDK_LIBS_OUT=/home/luxufan/riscv-android-src-ndk-10/out/libcxx/libs LIBCXX_FORCE_REBUILD=true
/home/luxufan/riscv-android-src-ndk-10/out/linux/android-ndk-r20/build/ndk-build: line 289: 38471 Segmentation fault      $GNUMAKE -f $PROGDIR/core/build-local.mk "$@"
Traceback (most recent call last):
  File "/home/luxufan/riscv-android-src-ndk-10/ndk/ndk/checkbuild.py", line 2147, in do_build
    module.build()
  File "/home/luxufan/riscv-android-src-ndk-10/ndk/ndk/checkbuild.py", line 763, in build
    subprocess.check_call(build_cmd)
  File "/home/luxufan/riscv-android-src-ndk-10/out/bootstrap/lib/python3.6/subprocess.py", line 291, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['bash', '/home/luxufan/riscv-android-src-ndk-10/out/linux/android-ndk-r20/build/ndk-build', '-j104', 'V=1', 'APP_ABI=armeabi-v7a arm64-v8a x86 x86_64 riscv64', 'APP_MODULES=c++_shared c++_static', 'BIONIC_PATH=/home/luxufan/riscv-android-src-ndk-10/bionic', 'NDK_PROJECT_PATH=null', 'APP_BUILD_SCRIPT=/home/luxufan/riscv-android-src-ndk-10/external/libcxx/Android.mk', 'NDK_APPLICATION_MK=/home/luxufan/riscv-android-src-ndk-10/external/libcxx/Application.mk', 'NDK_OUT=/home/luxufan/riscv-android-src-ndk-10/out/libcxx/obj', 'NDK_LIBS_OUT=/home/luxufan/riscv-android-src-ndk-10/out/libcxx/libs', 'LIBCXX_FORCE_REBUILD=true']' returned non-zero exit status 139.

Traceback (most recent call last):
  File "./ndk/checkbuild.py", line 65, in <module>
    main()
  File "./ndk/checkbuild.py", line 61, in main
    ['python3', os.path.join(THIS_DIR, 'do_checkbuild.py')] + sys.argv[1:])
  File "/usr/lib/python2.7/subprocess.py", line 190, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['python3', '/home/luxufan/riscv-android-src-ndk-10/ndk/do_checkbuild.py']' returned non-zero exit status 1