summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/uclibc
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:55:16 +0100
commit7cab66c9d2863e47db29aa01c4023dd1c9879fa2 (patch)
tree550f45e555803db3d347b54a592ea1d30f32035c /meta/recipes-core/uclibc
parente94e86c2d7cc30943be8e46ee02270bfb732b485 (diff)
downloadpoky-7cab66c9d2863e47db29aa01c4023dd1c9879fa2.tar.gz
uclibc_git.bb: Fix compilation on arm when using thumb instruction set
(From OE-Core rev: 7011d80c6cabc304e06237d167143d577fdd2570) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/uclibc')
-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 @@
1UCLIBC_EXTRA_CFLAGS is currently added before the OPTIMIZATION flags
2and OPTIMIZATION is chosen to be Os by default. But in OE we pass the optimisation
3flags through UCLIBC_EXTRA_CFLAGS but they are not effective since -Os is
4specified at last. So we need to change the order of these option flags
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7
8Upstream-Status: Pending
9
10diff --git a/Rules.mak b/Rules.mak
11index 65fe47c..eca7f40 100644
12--- a/Rules.mak
13+++ b/Rules.mak
14@@ -585,9 +574,6 @@ CFLAGS := -include $(top_srcdir)include/libc-symbols.h \
15 -nostdinc -I$(top_builddir)include -I$(top_srcdir)include -I. \
16 -I$(top_srcdir)libc/sysdeps/linux \
17 -I$(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)
18-ifneq ($(strip $(UCLIBC_EXTRA_CFLAGS)),"")
19-CFLAGS += $(call qstrip,$(UCLIBC_EXTRA_CFLAGS))
20-endif
21
22 # We need this to be checked within libc-symbols.h
23 ifneq ($(HAVE_SHARED),y)
24@@ -633,6 +619,9 @@ LDFLAGS += -Wl,-s
25 else
26 STRIPTOOL := true -Stripping_disabled
27 endif
28+ifneq ($(strip $(UCLIBC_EXTRA_CFLAGS)),"")
29+CFLAGS += $(call qstrip,$(UCLIBC_EXTRA_CFLAGS))
30+endif
31
32 ifeq ($(DOMULTI),y)
33 # 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 @@
1When compiling in thumb mode for arm with -Os gcc gives up since it can not find registers
2to spill. So we use -O2 option for compiling fork.c It may be addressable is gcc.
3
4Signed-off-by: Khem Raj <raj.khem@gmail.com>
5
6Upstream-Status: Pending
7
8diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch
9index 329d8a9..41e3646 100644
10--- a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch
11+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch
12@@ -30,3 +30,9 @@ CFLAGS-OMIT-libc-lowlevellock.c = -DNOT_IN_libc -DIS_IN_libpthread
13 # This macro should be alternatively implemented in THUMB
14 # assembly.
15 ASFLAGS-vfork.S = -marm
16+
17+# For arm fork.c does not compile with -Os when in compiling
18+# in thumb1 mode
19+ifeq ($(COMPILE_IN_THUMB_MODE),y)
20+CFLAGS-fork.c = -O2
21+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"
2 2
3require uclibc.inc 3require uclibc.inc
4PV = "0.9.31+0.9.32rc3" 4PV = "0.9.31+0.9.32rc3"
5PR = "${INC_PR}.1" 5PR = "${INC_PR}.2"
6PROVIDES += "virtual/${TARGET_PREFIX}libc-for-gcc" 6PROVIDES += "virtual/${TARGET_PREFIX}libc-for-gcc"
7 7
8#recent versions uclibc require real kernel headers 8#recent versions uclibc require real kernel headers
@@ -27,5 +27,7 @@ SRC_URI = "git://uclibc.org/uClibc.git;branch=master;protocol=git \
27 file://argp-support.patch \ 27 file://argp-support.patch \
28 file://argp-headers.patch \ 28 file://argp-headers.patch \
29 file://remove_attribute_optimize_Os.patch \ 29 file://remove_attribute_optimize_Os.patch \
30 file://uclibc-git/append_UCLIBC_EXTRA_CFLAGS.patch \
31 file://compile-arm-fork-with-O2.patch \
30 " 32 "
31S = "${WORKDIR}/git" 33S = "${WORKDIR}/git"