Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0+ |
Alexey Brodkin | 3a59d91 | 2014-02-04 12:56:14 +0400 | [diff] [blame] | 2 | # |
3 | # Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved. | ||||
Alexey Brodkin | 3a59d91 | 2014-02-04 12:56:14 +0400 | [diff] [blame] | 4 | |
Alexey Brodkin | cbd76c3 | 2015-02-03 13:58:14 +0300 | [diff] [blame] | 5 | ifndef CONFIG_CPU_BIG_ENDIAN |
Alexey Brodkin | 3a59d91 | 2014-02-04 12:56:14 +0400 | [diff] [blame] | 6 | CONFIG_SYS_LITTLE_ENDIAN = 1 |
Alexey Brodkin | cbd76c3 | 2015-02-03 13:58:14 +0300 | [diff] [blame] | 7 | else |
8 | CONFIG_SYS_BIG_ENDIAN = 1 | ||||
Alexey Brodkin | 3a59d91 | 2014-02-04 12:56:14 +0400 | [diff] [blame] | 9 | endif |
10 | |||||
11 | ifdef CONFIG_SYS_LITTLE_ENDIAN | ||||
Masahiro Yamada | 4ec537a | 2015-05-13 18:49:31 +0900 | [diff] [blame] | 12 | ARC_CROSS_COMPILE := arc-linux- |
Alexey Brodkin | 93206d2 | 2015-02-03 13:58:20 +0300 | [diff] [blame] | 13 | PLATFORM_LDFLAGS += -EL |
14 | PLATFORM_CPPFLAGS += -mlittle-endian | ||||
Alexey Brodkin | 3a59d91 | 2014-02-04 12:56:14 +0400 | [diff] [blame] | 15 | endif |
16 | |||||
17 | ifdef CONFIG_SYS_BIG_ENDIAN | ||||
Masahiro Yamada | 4ec537a | 2015-05-13 18:49:31 +0900 | [diff] [blame] | 18 | ARC_CROSS_COMPILE := arceb-linux- |
Alexey Brodkin | 3a59d91 | 2014-02-04 12:56:14 +0400 | [diff] [blame] | 19 | PLATFORM_LDFLAGS += -EB |
Alexey Brodkin | 93206d2 | 2015-02-03 13:58:20 +0300 | [diff] [blame] | 20 | PLATFORM_CPPFLAGS += -mbig-endian |
Alexey Brodkin | 3a59d91 | 2014-02-04 12:56:14 +0400 | [diff] [blame] | 21 | endif |
22 | |||||
Masahiro Yamada | f0ac9e0 | 2014-02-28 14:33:30 +0900 | [diff] [blame] | 23 | ifeq ($(CROSS_COMPILE),) |
24 | CROSS_COMPILE := $(ARC_CROSS_COMPILE) | ||||
25 | endif | ||||
26 | |||||
Alexey Brodkin | 5e4931f | 2014-12-24 17:00:29 +0300 | [diff] [blame] | 27 | ifdef CONFIG_ARC_MMU_VER |
28 | CONFIG_MMU = 1 | ||||
29 | endif | ||||
30 | |||||
Alexey Brodkin | 2f02080 | 2015-02-03 13:58:19 +0300 | [diff] [blame] | 31 | ifdef CONFIG_CPU_ARC750D |
Alexey Brodkin | 2fcaf4f | 2016-09-16 12:12:26 +0300 | [diff] [blame] | 32 | PLATFORM_CPPFLAGS += -mcpu=arc700 |
Alexey Brodkin | 2f02080 | 2015-02-03 13:58:19 +0300 | [diff] [blame] | 33 | endif |
34 | |||||
Alexey Brodkin | f431e26 | 2015-02-03 13:58:11 +0300 | [diff] [blame] | 35 | ifdef CONFIG_CPU_ARC770D |
Alexey Brodkin | 2fcaf4f | 2016-09-16 12:12:26 +0300 | [diff] [blame] | 36 | PLATFORM_CPPFLAGS += -mcpu=arc700 -mlock -mswape |
Alexey Brodkin | f431e26 | 2015-02-03 13:58:11 +0300 | [diff] [blame] | 37 | endif |
38 | |||||
Alexey Brodkin | e41a3d5 | 2015-01-13 18:35:46 +0300 | [diff] [blame] | 39 | ifdef CONFIG_CPU_ARCEM6 |
Alexey Brodkin | 2fcaf4f | 2016-09-16 12:12:26 +0300 | [diff] [blame] | 40 | PLATFORM_CPPFLAGS += -mcpu=arcem |
Alexey Brodkin | e41a3d5 | 2015-01-13 18:35:46 +0300 | [diff] [blame] | 41 | endif |
42 | |||||
43 | ifdef CONFIG_CPU_ARCHS34 | ||||
Alexey Brodkin | 2e54197 | 2016-06-16 10:55:00 +0200 | [diff] [blame] | 44 | PLATFORM_CPPFLAGS += -mcpu=archs |
Alexey Brodkin | e41a3d5 | 2015-01-13 18:35:46 +0300 | [diff] [blame] | 45 | endif |
46 | |||||
47 | ifdef CONFIG_CPU_ARCHS38 | ||||
Alexey Brodkin | 2e54197 | 2016-06-16 10:55:00 +0200 | [diff] [blame] | 48 | PLATFORM_CPPFLAGS += -mcpu=archs |
Alexey Brodkin | e41a3d5 | 2015-01-13 18:35:46 +0300 | [diff] [blame] | 49 | endif |
50 | |||||
Alexey Brodkin | adb45be | 2018-02-15 15:34:58 +0300 | [diff] [blame] | 51 | PLATFORM_CPPFLAGS += -ffixed-r25 -D__ARC__ -gdwarf-2 -mno-sdata |
Alexey Brodkin | 887ca45 | 2018-01-25 00:25:12 +0300 | [diff] [blame] | 52 | PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections |
Alexey Brodkin | 3a59d91 | 2014-02-04 12:56:14 +0400 | [diff] [blame] | 53 | |
Alexey Brodkin | 3a59d91 | 2014-02-04 12:56:14 +0400 | [diff] [blame] | 54 | # Needed for relocation |
Alexey Brodkin | 887ca45 | 2018-01-25 00:25:12 +0300 | [diff] [blame] | 55 | LDFLAGS_FINAL += -pie --gc-sections |
Alexey Brodkin | 3a59d91 | 2014-02-04 12:56:14 +0400 | [diff] [blame] | 56 | |
57 | # Load address for standalone apps | ||||
58 | CONFIG_STANDALONE_LOAD_ADDR ?= 0x82000000 |