zig-build added

zig install added on CI - fixed

Docker - zig install

parent 5d2e3573c25b48ba7c3d697de11e64896e818aea
author Matheus Catarino França <matheus-catarino@hotmail.com> 1647344723 -0300
committer Matheus Catarino França <matheus-catarino@hotmail.com> 1647344723 -0300

zig-build added

zig install added on CI - fixed

Docker - zig install

CI - replace wget2curl

rm bloat curl command & zig latest version

ZIG_ENV - rm bin folder

ident format

Apply suggestions from code review

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>

rm arch-zigoptimization

rm arch-zigoptimization ref
This commit is contained in:
Matheus Catarino França 2022-03-13 11:43:32 -03:00 committed by Xiang Xiao
parent 6ad06b0c2b
commit 4880613b26
5 changed files with 116 additions and 0 deletions

View file

@ -0,0 +1,66 @@
#
# This file is autogenerated: PLEASE DO NOT EDIT IT.
#
# You can use "make menuconfig" to make any modifications to the installed .config file.
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
# modifications.
#
# CONFIG_NSH_CMDOPT_HEXDUMP is not set
CONFIG_ARCH="sim"
CONFIG_ARCH_BOARD="sim"
CONFIG_ARCH_BOARD_SIM=y
CONFIG_ARCH_CHIP="sim"
CONFIG_ARCH_SIM=y
CONFIG_BOARDCTL_APP_SYMTAB=y
CONFIG_BOARDCTL_POWEROFF=y
CONFIG_BOARD_LOOPSPERMSEC=0
CONFIG_BOOT_RUNFROMEXTSRAM=y
CONFIG_BUILTIN=y
CONFIG_DEBUG_SYMBOLS=y
CONFIG_DEV_GPIO=y
CONFIG_DEV_LOOP=y
CONFIG_DEV_ZERO=y
CONFIG_EXAMPLES_GPIO=y
CONFIG_EXAMPLES_HELLO_ZIG=y
CONFIG_FAT_LCNAMES=y
CONFIG_FAT_LFN=y
CONFIG_FSUTILS_PASSWD=y
CONFIG_FSUTILS_PASSWD_READONLY=y
CONFIG_FS_BINFS=y
CONFIG_FS_FAT=y
CONFIG_FS_PROCFS=y
CONFIG_FS_RAMMAP=y
CONFIG_FS_ROMFS=y
CONFIG_GPIO_LOWER_HALF=y
CONFIG_IDLETHREAD_STACKSIZE=4096
CONFIG_INIT_ENTRYPOINT="nsh_main"
CONFIG_IOEXPANDER=y
CONFIG_IOEXPANDER_DUMMY=y
CONFIG_LIBC_ENVPATH=y
CONFIG_LIBC_EXECFUNCS=y
CONFIG_LIBC_LOCALE=y
CONFIG_LIBC_LOCALE_CATALOG=y
CONFIG_LIBC_LOCALE_GETTEXT=y
CONFIG_NSH_ARCHINIT=y
CONFIG_NSH_ARCHROMFS=y
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_CONSOLE_LOGIN=y
CONFIG_NSH_FATDEVNO=2
CONFIG_NSH_FILE_APPS=y
CONFIG_NSH_MOTD=y
CONFIG_NSH_MOTD_STRING="MOTD: username=admin password=Administrator"
CONFIG_NSH_READLINE=y
CONFIG_NSH_ROMFSDEVNO=1
CONFIG_NSH_ROMFSETC=y
CONFIG_PATH_INITIAL="/bin"
CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=2048
CONFIG_PSEUDOFS_ATTRIBUTES=y
CONFIG_PSEUDOFS_SOFTLINKS=y
CONFIG_READLINE_TABCOMPLETION=y
CONFIG_SCHED_HAVE_PARENT=y
CONFIG_SCHED_HPWORK=y
CONFIG_SCHED_ONEXIT=y
CONFIG_SCHED_WAITPID=y
CONFIG_START_MONTH=6
CONFIG_START_YEAR=2008
CONFIG_SYSTEM_NSH=y

View file

@ -103,6 +103,9 @@ NM = $(CROSSDEV)nm
OBJCOPY = $(CROSSDEV)objcopy
OBJDUMP = $(CROSSDEV)objdump
RUSTC = rustc --edition 2021
ZIG = zig
ZCC = zig cc
ZCXX = zig c++
CFLAGS := $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
$(ARCHCFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe

View file

@ -312,6 +312,24 @@ define COMPILERUST
$(Q) $(RUSTC) --emit obj $(RUSTFLAGS) $($(strip $1)_RUSTFLAGS) $1 -o $2
endef
# COMPILEZIG - Default macro to compile one Zig file
# Example: $(call COMPILEZIG, in-file, out-file)
#
# Depends on these settings defined in board-specific Make.defs file
# installed at $(TOPDIR)/Make.defs:
#
# ZIG - The command to invoke the Zig compiler
# ZIGFLAGS - Options to pass to the Zig compiler
#
# '<filename>.zig_ZIGFLAGS += <options>' may also be used, as an example, to
# change the options used with the single file <filename>.zig. The same
# applies mutatis mutandis.
define COMPILEZIG
@echo "ZIG: $1"
$(Q) $(ZIG) build-obj $(ZIGFLAGS) $($(strip $1)_ZIGFLAGS) $1 --name $2
endef
# ASSEMBLE - Default macro to assemble one assembly language file
# Example: $(call ASSEMBLE, in-file, out-file)
#

View file

@ -381,6 +381,24 @@ function rust {
fi
}
function zig {
mkdir -p "${prebuilt}"/zig
add_path "${prebuilt}"/zig
if ! type zig &> /dev/null; then
case ${os} in
Darwin)
brew install zig
;;
Linux)
# Currently Debian don't install zig (only built)
export ZIG_HOME=${prebuilt}/zig
curl -sL https://ziglang.org/download/0.9.1/zig-linux-x86_64-0.9.1.tar.xz | tar -xJC "${prebuilt}"/zig --strip-components=1
;;
esac
fi
}
function usage {
echo ""
echo "USAGE: $0 [-i] [-s] [-c] [-*] <testlist>"

View file

@ -34,6 +34,7 @@ RUN apt-get update -qq && DEBIAN_FRONTEND="noninteractive" apt-get install -y -q
cmake \
g++ \
gawk \
jq \
git
RUN mkdir /tools
@ -68,6 +69,12 @@ RUN mkdir -p $CARGO_HOME \
&& $CARGO_HOME/bin/rustup target add thumbv6m-none-eabi \
&& $CARGO_HOME/bin/rustup target add thumbv7m-none-eabi
# Install Zig from NuttX
ENV ZIG_HOME=/tools/zig
RUN mkdir -p $ZIG_HOME \
&& curl -sL https://ziglang.org/download/0.9.1/zig-linux-x86_64-0.9.1.tar.xz | tar -xJC $ZIG_HOME --strip-components=1
CMD [ "/bin/bash" ]
###############################################################################
@ -269,6 +276,10 @@ ENV CARGO_HOME=/tools/rust/cargo
ENV RUSTUP_HOME=/tools/rust/rustup
ENV PATH="/tools/rust/cargo/bin:$PATH"
# Zig toolchain
COPY --from=nuttx-tools /tools/zig/ /tools/zig/
ENV PATH="/tools/zig:$PATH"
# ARM toolchain
COPY --from=nuttx-toolchain-arm /tools/gcc-arm-none-eabi/ gcc-arm-none-eabi/
ENV PATH="/tools/gcc-arm-none-eabi/bin:$PATH"