Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
luxufan opened this issue Oct 27, 2021 · 4 comments
Open

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

luxufan opened this issue Oct 27, 2021 · 4 comments

Comments

@luxufan
Copy link

luxufan commented Oct 27, 2021

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
Copy link
Author

luxufan commented Oct 27, 2021

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

@luxufan
Copy link
Author

luxufan commented Oct 27, 2021

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

@luxufan
Copy link
Author

luxufan commented Oct 27, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@luxufan and others