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

make build fails with error #4

Open
jbrunk1966 opened this issue May 9, 2023 · 5 comments
Open

make build fails with error #4

jbrunk1966 opened this issue May 9, 2023 · 5 comments

Comments

@jbrunk1966
Copy link

updated all build tools and source before

$ brew update; brew upgrade
$ cd xuantie-gnu-toolchain
$ git pull --force
$ git submodule update --remote  --force --recursive  
$ make distclean
$ ./configure --prefix=/opt/riscv-toolchain/xuantie --with-cmodel=medany --enable-multilib --disable-gdb
$ make newlib -j$(nproc)

but the build still fails somewhere

g++   -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -fno-strict-aliasing -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-error=format-diag -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H  -DGENERATOR_FILE -fno-PIE  -no-pie -o build/genautomata \
    build/genautomata.o build/rtl.o build/read-rtl.o build/ggc-none.o build/vec.o build/min-insn-modes.o build/gensupport.o build/print-rtl.o build/hash-table.o build/sort.o build/read-md.o build/errors.o ../build-arm-apple-darwin22.4.0/libiberty/libiberty.a -lm
clang: warning: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument]
ld: warning: -no_pie is deprecated when targeting new OS versions
ld: warning: -no_pie ignored for arm64
build/genautomata ../.././riscv-gcc/gcc/common.md ../.././riscv-gcc/gcc/config/riscv/riscv.md \
  insn-conditions.md > tmp-automata.c
/bin/sh ../.././riscv-gcc/gcc/../move-if-change tmp-automata.c insn-automata.c
automatav=$(echo $(LC_MESSAGES=C csplit insn-automata.c /parallel\ compilation/ -k -s {20} -f insn-automata -b "%d.c" 2>&1));\
[ ! "$automatav" ] || grep "match not found" <<< $automatav
make[2]: *** [Makefile:2411: s-automata] Error 1
make[2]: Leaving directory '/Users/jbrunk/Development/riscv/xuantie-gnu-toolchain/build-gcc-newlib-stage1/gcc'
make[1]: *** [Makefile:4429: all-gcc] Error 2
make[1]: Leaving directory '/Users/jbrunk/Development/riscv/xuantie-gnu-toolchain/build-gcc-newlib-stage1'
make: *** [Makefile:553: stamps/build-gcc-newlib-stage1] Error 2
@KenjutsuGH
Copy link

I get the same error. Has anyone been able to resolve this?

Alternatively, has anyone been able to successfully build the tool chain and if so, will you be willing to upload/share it?

@marchingband
Copy link

@p4ddy1 you must have built it successfully ... are you willing to upload/share for us?

@datp4ddy
Copy link
Owner

Did you install the GNU coreutils and included them in your PATH with export PATH=$(brew --prefix)/opt/coreutils/libexec/gnubin:$PATH before trying to compile the toolchain?

@flyingcys
Copy link

@p4ddy1 you must have built it successfully ... are you willing to upload/share for us?

You can download in https://github.com/flyingcys/xuantie-gnu-toolchain/releases

@marchingband
Copy link

@flyingcys Oh man, thank you!

Here are the steps I took to make it work:

  • download Xuantie-900-gcc-elf-newlib-v2.8.1-darwin-arm64.tar.gz, unpack, and move to /opt
  • run xattr -rd com.apple.quarantine /opt/Xuantie-900-gcc-elf-newlib-v2.8.1 because it is not signed and will not run
  • in the file bl_mcu_sdk/cmake/bflb_flash.cmake, at the very top, remove a bunch of if/else step to just set set(TOOL_SUFFIX "-macos")

make CHIP=bl616 BOARD=bl616dk now completes without errors.
make flash CHIP=bl616 COMX=/dev/cu.usbserial-A50285BI also runs.

This make process is fairly slow, taking about 20 seconds on my M1.
It produces:

  • helloworld_bl616.bin
  • boot2_bl616_release_v8.0.7.bin
  • mfg_bl616_gu_af8b0946f_v2.26.bin
  • helloworld_bl616.bin.ota
  • helloworld_bl616.xz
  • helloworld_bl616.xz.ota

Do i need all these? Is there any way to speed it up?
It is 10x slower then the similar process on my X86 machine, which is a far slower machine.

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

5 participants