From e3cb8d48f78686c374e3d25c2b4613bd94e60705 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Fri, 1 May 2015 18:14:38 +0200 Subject: [PATCH] sel4: never compile syscall-using code with -fPIC --- repos/base-sel4/lib/import/import-syscall.mk | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/repos/base-sel4/lib/import/import-syscall.mk b/repos/base-sel4/lib/import/import-syscall.mk index 812245d94..e3407c6c2 100644 --- a/repos/base-sel4/lib/import/import-syscall.mk +++ b/repos/base-sel4/lib/import/import-syscall.mk @@ -8,3 +8,17 @@ INC_DIR += $(BUILD_BASE_DIR)/include # Access to other sel4-specific headers such as 'autoconf.h'. # REP_INC_DIR += include/sel4 + +# +# Compile code that uses the system-call bindings without -fPIC. Otherwise, +# the compiler would complain with the following error: +# +# error: inconsistent operand constraints in an ‘asm’ +# +# XXX avoid mixing PIC with non-PIC code +# +# The lack of PIC support in the seL4 system bindings ultimately results in +# a mix of PIC and non-PIC code within a single binary. This may become a +# problem when using shared libraries. +# +CC_OPT_PIC =