summaryrefslogtreecommitdiff
path: root/meta/recipes-core
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2011-05-26 22:42:51 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-05-27 16:54:45 +0100
commit7011d80c6cabc304e06237d167143d577fdd2570 (patch)
tree02b608b2b33451e105a354dc2d494d56da746ea3 /meta/recipes-core
parenta6a892f520d22ef8020c98528d38ee08f6cda034 (diff)
downloadopenembedded-core-7011d80c6cabc304e06237d167143d577fdd2570.tar.gz
openembedded-core-7011d80c6cabc304e06237d167143d577fdd2570.tar.bz2
openembedded-core-7011d80c6cabc304e06237d167143d577fdd2570.zip
uclibc_git.bb: Fix compilation on arm when using thumb instruction set
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta/recipes-core')
-rw-r--r--meta/recipes-core/uclibc/uclibc-git/append_UCLIBC_EXTRA_CFLAGS.patch33
-rw-r--r--meta/recipes-core/uclibc/uclibc-git/compile-arm-fork-with-O2.patch21
-rw-r--r--meta/recipes-core/uclibc/uclibc_git.bb4
3 files changed, 57 insertions, 1 deletions
diff --git a/meta/recipes-core/uclibc/uclibc-git/append_UCLIBC_EXTRA_CFLAGS.patch b/meta/recipes-core/uclibc/uclibc-git/append_UCLIBC_EXTRA_CFLAGS.patch
new file mode 100644
index 0000000000..edcb4e324b
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-git/append_UCLIBC_EXTRA_CFLAGS.patch
@@ -0,0 +1,33 @@
+UCLIBC_EXTRA_CFLAGS is currently added before the OPTIMIZATION flags
+and OPTIMIZATION is chosen to be Os by default. But in OE we pass the optimisation
+flags through UCLIBC_EXTRA_CFLAGS but they are not effective since -Os is
+specified at last. So we need to change the order of these option flags
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+
+diff --git a/Rules.mak b/Rules.mak
+index 65fe47c..eca7f40 100644
+--- a/Rules.mak
++++ b/Rules.mak
+@@ -585,9 +574,6 @@ CFLAGS := -include $(top_srcdir)include/libc-symbols.h \
+ -nostdinc -I$(top_builddir)include -I$(top_srcdir)include -I. \
+ -I$(top_srcdir)libc/sysdeps/linux \
+ -I$(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)
+-ifneq ($(strip $(UCLIBC_EXTRA_CFLAGS)),"")
+-CFLAGS += $(call qstrip,$(UCLIBC_EXTRA_CFLAGS))
+-endif
+
+ # We need this to be checked within libc-symbols.h
+ ifneq ($(HAVE_SHARED),y)
+@@ -633,6 +619,9 @@ LDFLAGS += -Wl,-s
+ else
+ STRIPTOOL := true -Stripping_disabled
+ endif
++ifneq ($(strip $(UCLIBC_EXTRA_CFLAGS)),"")
++CFLAGS += $(call qstrip,$(UCLIBC_EXTRA_CFLAGS))
++endif
+
+ ifeq ($(DOMULTI),y)
+ # we try to compile all sources at once into an object (IMA), but
diff --git a/meta/recipes-core/uclibc/uclibc-git/compile-arm-fork-with-O2.patch b/meta/recipes-core/uclibc/uclibc-git/compile-arm-fork-with-O2.patch
new file mode 100644
index 0000000000..429f27dfc4
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-git/compile-arm-fork-with-O2.patch
@@ -0,0 +1,21 @@
+When compiling in thumb mode for arm with -Os gcc gives up since it can not find registers
+to spill. So we use -O2 option for compiling fork.c It may be addressable is gcc.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+
+diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch
+index 329d8a9..41e3646 100644
+--- a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch
++++ b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch
+@@ -30,3 +30,9 @@ CFLAGS-OMIT-libc-lowlevellock.c = -DNOT_IN_libc -DIS_IN_libpthread
+ # This macro should be alternatively implemented in THUMB
+ # assembly.
+ ASFLAGS-vfork.S = -marm
++
++# For arm fork.c does not compile with -Os when in compiling
++# in thumb1 mode
++ifeq ($(COMPILE_IN_THUMB_MODE),y)
++CFLAGS-fork.c = -O2
++endif
diff --git a/meta/recipes-core/uclibc/uclibc_git.bb b/meta/recipes-core/uclibc/uclibc_git.bb
index 18619cd40f..3d5f7a717e 100644
--- a/meta/recipes-core/uclibc/uclibc_git.bb
+++ b/meta/recipes-core/uclibc/uclibc_git.bb
@@ -2,7 +2,7 @@ SRCREV="71d63ed75648da9b0b71afabb9c60aaad792c55c"
require uclibc.inc
PV = "0.9.31+0.9.32rc3"
-PR = "${INC_PR}.1"
+PR = "${INC_PR}.2"
PROVIDES += "virtual/${TARGET_PREFIX}libc-for-gcc"
#recent versions uclibc require real kernel headers
@@ -27,5 +27,7 @@ SRC_URI = "git://uclibc.org/uClibc.git;branch=master;protocol=git \
file://argp-support.patch \
file://argp-headers.patch \
file://remove_attribute_optimize_Os.patch \
+ file://uclibc-git/append_UCLIBC_EXTRA_CFLAGS.patch \
+ file://compile-arm-fork-with-O2.patch \
"
S = "${WORKDIR}/git"