summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools
diff options
context:
space:
mode:
authorChristopher Larson <chris_larson@mentor.com>2016-05-20 10:04:20 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-21 22:24:56 +0100
commitfe70c063c5d468bf9ddadebafe709b4c21f49100 (patch)
tree2cb11a52625bfcead13e1a65eaf8937185aa1039 /meta/recipes-devtools
parentd61d4ba6ca656ec8eef2b9147434a6187bbcb475 (diff)
downloadpoky-fe70c063c5d468bf9ddadebafe709b4c21f49100.tar.gz
mkelfimage: obey LDFLAGS, sort out HOST_ flags
We weren't consistent in the HOST_ (aka BUILD_) and non-HOST_ flags, so we were using BUILD_CPPFLAGS to compile target stuff, for example. Sort that out, and make sure we obey LDFLAGS. (From OE-Core rev: 3ba4fd81f99b5479830d1fb18e6b8f2f6edb7839) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r--meta/recipes-devtools/mkelfimage/mkelfimage/cross-compile.patch85
-rw-r--r--meta/recipes-devtools/mkelfimage/mkelfimage_git.bb4
2 files changed, 62 insertions, 27 deletions
diff --git a/meta/recipes-devtools/mkelfimage/mkelfimage/cross-compile.patch b/meta/recipes-devtools/mkelfimage/mkelfimage/cross-compile.patch
index 7692709724..2ae9fb50aa 100644
--- a/meta/recipes-devtools/mkelfimage/mkelfimage/cross-compile.patch
+++ b/meta/recipes-devtools/mkelfimage/mkelfimage/cross-compile.patch
@@ -1,13 +1,43 @@
1make the tool to be cross compilable. 1From dc2712119d6832e24a9b7bed9ed4ce5ae03ce0a3 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 14 Jul 2012 14:14:07 -0700
4Subject: [PATCH] mkelfimage: Fix cross build
5
6Make the tool to be cross compilable, by separating the variables for build
7tools from those for the target. Also modified to obey LDFLAGS.
2 8
3Signed-off-by: Khem Raj <raj.khem@gmail.com> 9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10Signed-off-by: Christopher Larson <chris_larson@mentor.com>
11
4Upstream-Status: Pending 12Upstream-Status: Pending
5 13
6Index: mkelfImage/configure.ac 14---
7=================================================================== 15 Makefile.conf.in | 3 +++
8--- mkelfImage.orig/configure.ac 2012-07-14 14:04:48.964898667 -0700 16 configure.ac | 7 +++++--
9+++ mkelfImage/configure.ac 2012-07-14 14:10:47.800916083 -0700 17 linux-i386/Makefile | 2 +-
10@@ -70,6 +70,9 @@ 18 linux-ia64/Makefile | 2 +-
19 main/Makefile | 4 ++--
20 5 files changed, 12 insertions(+), 6 deletions(-)
21
22diff --git a/Makefile.conf.in b/Makefile.conf.in
23index 4645e44..dcb6cf2 100644
24--- a/Makefile.conf.in
25+++ b/Makefile.conf.in
26@@ -17,6 +17,9 @@ DEFS=@DEFS@
27 LIBS=@LIBS@
28 HOST_CC=@HOST_CC@
29 HOST_CFLAGS=@HOST_CFLAGS@ $(DEFS)
30+CC=@CC@
31+CFLAGS=@CFLAGS@ $(DEFS)
32+LDFLAGS=@LDFLAGS@
33
34 I386_CC =@I386_CC@
35 I386_LD =@I386_LD@
36diff --git a/configure.ac b/configure.ac
37index 652b952..0f2ac72 100644
38--- a/configure.ac
39+++ b/configure.ac
40@@ -70,6 +70,9 @@ if test "with_default" != no ; then
11 AC_MSG_ERROR([cc not found]) 41 AC_MSG_ERROR([cc not found])
12 fi 42 fi
13 eval "${with_default}_CC='$CC'" 43 eval "${with_default}_CC='$CC'"
@@ -17,19 +47,22 @@ Index: mkelfImage/configure.ac
17 AC_PROG_CPP 47 AC_PROG_CPP
18 if test "$CPP" = no; then 48 if test "$CPP" = no; then
19 AC_MSG_ERROR([cpp not found]) 49 AC_MSG_ERROR([cpp not found])
20@@ -172,7 +175,6 @@ 50@@ -172,8 +175,8 @@ fi
21 51
22 dnl ---Output variables... 52 dnl ---Output variables...
23 53
24-HOST_CC=$CC 54-HOST_CC=$CC
25 HOST_CFLAGS="$HOST_CFLAGS -O2 -Wall \$(HOST_CPPFLAGS)" 55-HOST_CFLAGS="$HOST_CFLAGS -O2 -Wall \$(HOST_CPPFLAGS)"
56+CFLAGS="${CFLAGS:--O2} -Wall \$(CPPFLAGS)"
57+HOST_CFLAGS="${HOST_CFLAGS:--O2} -Wall \$(HOST_CPPFLAGS)"
26 58
27 dnl TODO: figure out how to set these appropriately for compilers other than gcc 59 dnl TODO: figure out how to set these appropriately for compilers other than gcc
28Index: mkelfImage/linux-i386/Makefile 60 I386_CFLAGS="$I386_CFLAGS -Os -ffreestanding -Wall -W -Wno-format \$(I386_CPPFLAGS)"
29=================================================================== 61diff --git a/linux-i386/Makefile b/linux-i386/Makefile
30--- mkelfImage.orig/linux-i386/Makefile 2012-07-14 14:04:48.964898667 -0700 62index 51531d6..7e8aa3c 100644
31+++ mkelfImage/linux-i386/Makefile 2012-07-14 14:04:49.032898671 -0700 63--- a/linux-i386/Makefile
32@@ -4,7 +4,7 @@ 64+++ b/linux-i386/Makefile
65@@ -4,7 +4,7 @@ LI386_DEP=Makefile Makefile.conf $(LI386_DIR)/Makefile
33 66
34 $(LI386_OBJ)/mkelf-linux-i386.o: $(LI386_DIR)/mkelf-linux-i386.c $(LI386_DIR)/convert.bin.c $(LI386_DEP) 67 $(LI386_OBJ)/mkelf-linux-i386.o: $(LI386_DIR)/mkelf-linux-i386.c $(LI386_DIR)/convert.bin.c $(LI386_DEP)
35 $(MKDIR) -p $(@D) 68 $(MKDIR) -p $(@D)
@@ -38,11 +71,11 @@ Index: mkelfImage/linux-i386/Makefile
38 71
39 72
40 ifdef I386_CC 73 ifdef I386_CC
41Index: mkelfImage/linux-ia64/Makefile 74diff --git a/linux-ia64/Makefile b/linux-ia64/Makefile
42=================================================================== 75index 38f5d8c..5df8870 100644
43--- mkelfImage.orig/linux-ia64/Makefile 2012-07-14 14:04:48.964898667 -0700 76--- a/linux-ia64/Makefile
44+++ mkelfImage/linux-ia64/Makefile 2012-07-14 14:04:49.032898671 -0700 77+++ b/linux-ia64/Makefile
45@@ -4,7 +4,7 @@ 78@@ -4,7 +4,7 @@ LIA64_DEP=Makefile Makefile.conf $(LIA64_DIR)/Makefile
46 79
47 $(LIA64_OBJ)/mkelf-linux-ia64.o: $(LIA64_DIR)/mkelf-linux-ia64.c $(LIA64_DIR)/convert.bin.c $(LIA64_DEP) 80 $(LIA64_OBJ)/mkelf-linux-ia64.o: $(LIA64_DIR)/mkelf-linux-ia64.c $(LIA64_DIR)/convert.bin.c $(LIA64_DEP)
48 $(MKDIR) -p $(@D) 81 $(MKDIR) -p $(@D)
@@ -51,21 +84,23 @@ Index: mkelfImage/linux-ia64/Makefile
51 84
52 ifdef IA64_CC 85 ifdef IA64_CC
53 86
54Index: mkelfImage/main/Makefile 87diff --git a/main/Makefile b/main/Makefile
55=================================================================== 88index 403b0a4..cd53613 100644
56--- mkelfImage.orig/main/Makefile 2012-07-14 14:04:48.964898667 -0700 89--- a/main/Makefile
57+++ mkelfImage/main/Makefile 2012-07-14 14:04:49.032898671 -0700 90+++ b/main/Makefile
58@@ -4,11 +4,11 @@ 91@@ -4,11 +4,11 @@ MKELF_OBJS=$(OBJDIR)/main/mkelfImage.o \
59 92
60 $(OBJDIR)/sbin/mkelfImage: $(MKELF_OBJS) $(DEPS) 93 $(OBJDIR)/sbin/mkelfImage: $(MKELF_OBJS) $(DEPS)
61 $(MKDIR) -p $(@D) 94 $(MKDIR) -p $(@D)
62- $(HOST_CC) $(HOST_CFLAGS) $(MKELF_OBJS) -o $@ $(LIBS) 95- $(HOST_CC) $(HOST_CFLAGS) $(MKELF_OBJS) -o $@ $(LIBS)
63+ $(CC) $(HOST_CFLAGS) $(MKELF_OBJS) -o $@ $(LIBS) 96+ $(CC) $(CFLAGS) $(LDFLAGS) $(MKELF_OBJS) -o $@ $(LIBS)
64 97
65 $(OBJDIR)/main/mkelfImage.o: main/mkelfImage.c include/mkelfImage.h $(DEPS) 98 $(OBJDIR)/main/mkelfImage.o: main/mkelfImage.c include/mkelfImage.h $(DEPS)
66 $(MKDIR) -p $(@D) 99 $(MKDIR) -p $(@D)
67- $(HOST_CC) $(HOST_CFLAGS) -c $< -o $@ 100- $(HOST_CC) $(HOST_CFLAGS) -c $< -o $@
68+ $(CC) $(HOST_CFLAGS) -c $< -o $@ 101+ $(CC) $(CFLAGS) -c $< -o $@
69 102
70 $(OBJDIR)/man/man8/mkelfImage.8: main/mkelfImage.man 103 $(OBJDIR)/man/man8/mkelfImage.8: main/mkelfImage.man
71 $(MKDIR) -p $(@D) 104 $(MKDIR) -p $(@D)
105--
1062.8.0
diff --git a/meta/recipes-devtools/mkelfimage/mkelfimage_git.bb b/meta/recipes-devtools/mkelfimage/mkelfimage_git.bb
index 92435cd1c0..d7a4429fb8 100644
--- a/meta/recipes-devtools/mkelfimage/mkelfimage_git.bb
+++ b/meta/recipes-devtools/mkelfimage/mkelfimage_git.bb
@@ -13,8 +13,8 @@ http://review.coreboot.org/gitweb?p=coreboot.git;a=commit;h=34fc4ab80b507739e258
13DEPENDS += "zlib" 13DEPENDS += "zlib"
14 14
15SRC_URI = "git://review.coreboot.org/p/coreboot;protocol=http \ 15SRC_URI = "git://review.coreboot.org/p/coreboot;protocol=http \
16 file://cross-compile.patch \ 16 file://cross-compile.patch \
17 " 17 "
18SRC_URI_append_class-native = " \ 18SRC_URI_append_class-native = " \
19 file://fix-makefile-to-find-libz.patch \ 19 file://fix-makefile-to-find-libz.patch \
20" 20"