From 8ce194450d1fd3e2dcd9eb53daec248a76ce1d83 Mon Sep 17 00:00:00 2001
From: thomasl <thomasl@eurecom.fr>
Date: Tue, 9 Dec 2014 14:04:56 +0000
Subject: [PATCH] fixed build modules issues I created, hope it is ok now

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6207 818b1a75-f10b-46b9-bf7c-635c3b92a50f
---
 common/utils/Makefile.inc         | 13 ++++++++-----
 openair2/NAS/DRIVER/MESH/Makefile |  5 ++++-
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/common/utils/Makefile.inc b/common/utils/Makefile.inc
index 0a62f1b260..e804f88772 100644
--- a/common/utils/Makefile.inc
+++ b/common/utils/Makefile.inc
@@ -1,12 +1,15 @@
 export KERNEL_DIR=/lib/modules/$(shell uname -r)/
-CC=gcc-4.8
-CCC=gcc-4.8
+CC=gcc
+CCC=gcc
 linux := $(shell if [ `uname` = "Linux" ] ; then echo "1" ; else echo "0" ; fi)
 
 #CFLAGS += -std=gnu99 
-CFLAGS += -Wall -g -ggdb -Wstrict-prototypes -fno-strict-aliasing
+CFLAGS += -Wall -g -ggdb -Wstrict-prototypes -fno-strict-aliasing  -rdynamic
 
-#For performance
+# Need to force this option because default kernel module builder is wrong
+CFLAGS += $(call cc-option,-mpreferred-stack-boundary=4)
+
+#For performance, if some option doesn't exist in all gcc versions, use $(call cc-option,MY_OPTION)
 CFLAGS += -O3 -funroll-loops 
 CFLAGS += -Wno-packed-bitfield-compat 
 
@@ -24,7 +27,7 @@ endif
 
 ifeq ($(linux),1)
 CFLAGS += 
-LDFLAGS += -rdynamic
+LDFLAGS += 
 endif
 
 ITTI_DIR = $(COMMON_UTILS_DIR)/itti
diff --git a/openair2/NAS/DRIVER/MESH/Makefile b/openair2/NAS/DRIVER/MESH/Makefile
index f79cd212fa..bd91c08de2 100755
--- a/openair2/NAS/DRIVER/MESH/Makefile
+++ b/openair2/NAS/DRIVER/MESH/Makefile
@@ -15,7 +15,7 @@ NAS_UPDIR	:= $(shell /bin/pwd)
 ####################################################
 #      EXTRA COMPILER FLAGS
 ####################################################
-EXTRA_CFLAGS = -fno-common -fno-stack-protector -mpreferred-stack-boundary=4 $(if $(SET_X64),-DARCH_64,) $(if $(SET_X64),-mcmodel=kernel,) $(if $(SET_X64),-m64,) 
+#EXTRA_CFLAGS = -fno-common -fno-stack-protector -mpreferred-stack-boundary=4 $(if $(SET_X64),-DARCH_64,) $(if $(SET_X64),-mcmodel=kernel,) $(if $(SET_X64),-m64,) 
 EXTRA_CFLAGS += -I$(OPENAIR2_DIR)
 ifdef NAS_NETLINK
 EXTRA_CFLAGS += -DNAS_NETLINK
@@ -31,6 +31,9 @@ ifdef ADDRESS_FIX
 EXTRA_CFLAGS += -DNAS_ADDRESS_FIX
 endif
 
+ccflags-y := $(CFLAGS) $(EXTRA_CFLAGS)
+CFLAGS=
+
 ####################################################
 #      LOADABLE MODULE GOALS
 ####################################################
-- 
GitLab