1# Copyright (C) 2022 Huawei Technologies Co., Ltd. 2# Licensed under the Mulan PSL v2. 3# You can use this software according to the terms and conditions of the Mulan PSL v2. 4# You may obtain a copy of Mulan PSL v2 at: 5# http://license.coscl.org.cn/MulanPSL2 6# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR 7# IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR 8# PURPOSE. 9# See the Mulan PSL v2 for more details. 10 11# hm entrypoint 12ENTRY_POINT ?= _hm_start 13 14TARGET_IS_DRV := y 15# setup toolchain 16include $(BUILD_CONFIG)/cfg.mk 17include $(BUILD_CONFIG)/toolchain.mk 18 19inc-flags += $(INCLUDE_PATH:%=-I%) 20 21flags += -fdata-sections -ffunction-sections 22 23RUNTIME_LIB_FLAG := $(LIBCOMPILER_RT_BUILTINS) 24 25LDFLAGS += -u __vsyscall_ptr --gc-sections -pie -z relro -z now 26LDFLAGS += -L$(LIB_DIR) 27LDFLAGS += -L$(PREBUILD_ARCH_PLAT_LIBS) --start-group $(LIBS:%=-l%) $(RUNTIME_LIB_FLAG) --end-group 28LDFLAGS += -nostdlib -u $(ENTRY_POINT) -e $(ENTRY_POINT) -z max-page-size=0x1000 29 30flags += $(INCLUDES) 31 32include $(BUILD_CFI)/llvm-apps-cfi.mk 33