nuttx/tools/Zig.defs
Yanfeng Liu 4c41d84d21 tools/export: add hello_zig support in kernel mode for linux host
Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-01-19 01:09:46 -08:00

45 lines
1.5 KiB
Plaintext

############################################################################
# tools/Zig.defs
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
ZIG := zig
ifeq ($(CONFIG_ARCH_ARM),y)
ifeq ($(CONFIG_ARM_THUMB),y)
ZIGFLAGS := -target thumb-freestanding-$(LLVM_ABITYPE)
else
ZIGFLAGS := -target arm-freestanding-$(LLVM_ABITYPE)
endif
else ifeq ($(CONFIG_ARCH_RISCV),y)
ZIGFLAGS := -target $(LLVM_ARCHTYPE)-freestanding-none
ZIGFLAGS += -mcmodel=medium
else
ZIGFLAGS := -target $(LLVM_ARCHTYPE)-freestanding-$(LLVM_ABITYPE)
endif
# Convert cortex-xxx/sifive-exx to cortex_xxx/sifive_exx
ifneq ($(LLVM_CPUTYPE),)
ZIGFLAGS += -mcpu $(subst -,_,$(LLVM_CPUTYPE))
endif