From 9f192feb9c0a89bd20215a20554482df13ae5752 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=BB=84=E6=B6=9B?= Date: Wed, 26 Mar 2014 17:47:24 +0800 Subject: [PATCH] ARM: rockchip: fix build without pie --- arch/arm/mach-rockchip/common.c | 2 ++ arch/arm/mach-rockchip/sram.h | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/arch/arm/mach-rockchip/common.c b/arch/arm/mach-rockchip/common.c index 794b8b58b0b2..97d37532b5db 100755 --- a/arch/arm/mach-rockchip/common.c +++ b/arch/arm/mach-rockchip/common.c @@ -156,6 +156,7 @@ void *rockchip_sram_virt = NULL; size_t rockchip_sram_size = 0; char *rockchip_sram_stack = NULL; +#ifdef CONFIG_PIE int __init rockchip_pie_init(void) { struct device_node *np; @@ -173,6 +174,7 @@ int __init rockchip_pie_init(void) return 0; } +#endif static bool is_panic = false; diff --git a/arch/arm/mach-rockchip/sram.h b/arch/arm/mach-rockchip/sram.h index d4c7d7437921..91149ae23097 100644 --- a/arch/arm/mach-rockchip/sram.h +++ b/arch/arm/mach-rockchip/sram.h @@ -44,6 +44,11 @@ extern char __pie_data(rk3188) __pie_rk3188_sram_stack[1024]; #define __sramlocalfunc RK_PIE extern void call_with_stack(void (*fn)(void *), void *arg, void *sp); + +#ifdef CONFIG_PIE extern int __init rockchip_pie_init(void); +#else +static inline int rockchip_pie_init(void) { return -1; } +#endif #endif -- 2.34.1