Merge pull request #20731 from pprindeville/isc-dhcp-update-4.4.3-P1
[feed/packages.git] / lang / rust / rust-values.mk
1 # SPDX-License-Identifier: GPL-2.0-only
2 #
3 # Copyright (C) 2023 Luca Barbato and Donald Hoskins
4
5 # Rust Environmental Vars
6 CONFIG_HOST_SUFFIX:=$(word 4, $(subst -, ,$(GNU_HOST_NAME)))
7 RUSTC_HOST_ARCH:=$(HOST_ARCH)-unknown-linux-$(CONFIG_HOST_SUFFIX)
8 CARGO_HOME:=$(STAGING_DIR_HOSTPKG)/cargo
9 CARGO_VARS:=
10
11 ifeq ($(CONFIG_USE_MUSL),y)
12 # Force linking of the SSP library for musl
13 ifdef CONFIG_PKG_CC_STACKPROTECTOR_REGULAR
14 ifeq ($(strip $(PKG_SSP)),1)
15 RUSTC_LDFLAGS += -lssp_nonshared
16 endif
17 endif
18 ifdef CONFIG_PKG_CC_STACKPROTECTOR_STRONG
19 ifeq ($(strip $(PKG_SSP)),1)
20 TARGET_CFLAGS += -lssp_nonshared
21 endif
22 endif
23 endif
24
25 # mips64 openwrt has a specific targed in rustc
26 ifeq ($(ARCH),mips64)
27 RUSTC_TARGET_ARCH:=$(REAL_GNU_TARGET_NAME)
28 else
29 RUSTC_TARGET_ARCH:=$(subst openwrt,unknown,$(REAL_GNU_TARGET_NAME))
30 endif
31
32 RUSTC_TARGET_ARCH:=$(subst muslgnueabi,musleabi,$(RUSTC_TARGET_ARCH))
33
34 ifeq ($(ARCH),i386)
35 RUSTC_TARGET_ARCH:=$(subst i486,i586,$(RUSTC_TARGET_ARCH))
36 endif
37
38 # ARM Logic
39 ifeq ($(ARCH),arm)
40 ifeq ($(CONFIG_arm_v7),y)
41 RUSTC_TARGET_ARCH:=$(subst arm,armv7,$(RUSTC_TARGET_ARCH))
42 endif
43
44 ifeq ($(CONFIG_HAS_FPU),y)
45 RUSTC_TARGET_ARCH:=$(subst musleabi,musleabihf,$(RUSTC_TARGET_ARCH))
46 endif
47 endif
48
49 ifeq ($(ARCH),aarch64)
50 RUST_CFLAGS:=-mno-outline-atomics
51 endif