summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/mkelfimage
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2012-07-14 14:14:07 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-07-17 10:54:02 +0100
commit85e5f2d8ac4e4096b5f4dbf4c5cb66680777d54d (patch)
treed65403c761fa668b6931f0060bd3005cfbde5f39 /meta/recipes-devtools/mkelfimage
parent0a925c9dcf0768ffa1d2dca2a8aaeee65919d52f (diff)
downloadpoky-85e5f2d8ac4e4096b5f4dbf4c5cb66680777d54d.tar.gz
mkelfimage: Fix cross build
This patch fixes building this tool in cross environment It uses tools such as CC, HOST_CC, I386_CC etc. and as long as you are building native it does not matter since they all are same namely 'gcc' but in cross compiling that wont work. So we make the makefiles and configure scripts aware of that fact Upstream hosts this program in a svn repo. So change the SRC_URI to official svn repo. With git we were checking out a lot more that just mkelfimage which is not required. There were unpackaged empty directories too so we make sure they are removed as well. Fixes Yocto bug# 2765 (From OE-Core rev: 0d828f19f7ef2d852bbe6da4510efea76a39b982) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/mkelfimage')
-rw-r--r--meta/recipes-devtools/mkelfimage/mkelfimage/cross-compile.patch71
-rw-r--r--meta/recipes-devtools/mkelfimage/mkelfimage_git.bb17
-rw-r--r--meta/recipes-devtools/mkelfimage/mkelfimage_svn.bb30
3 files changed, 101 insertions, 17 deletions
diff --git a/meta/recipes-devtools/mkelfimage/mkelfimage/cross-compile.patch b/meta/recipes-devtools/mkelfimage/mkelfimage/cross-compile.patch
new file mode 100644
index 0000000000..7692709724
--- /dev/null
+++ b/meta/recipes-devtools/mkelfimage/mkelfimage/cross-compile.patch
@@ -0,0 +1,71 @@
1make the tool to be cross compilable.
2
3Signed-off-by: Khem Raj <raj.khem@gmail.com>
4Upstream-Status: Pending
5
6Index: mkelfImage/configure.ac
7===================================================================
8--- mkelfImage.orig/configure.ac 2012-07-14 14:04:48.964898667 -0700
9+++ mkelfImage/configure.ac 2012-07-14 14:10:47.800916083 -0700
10@@ -70,6 +70,9 @@
11 AC_MSG_ERROR([cc not found])
12 fi
13 eval "${with_default}_CC='$CC'"
14+ if test "x$HOST_CC" = 'x'; then
15+ AC_CHECK_PROG([HOST_CC], [$CC], [$CC], [gcc], [$PATH])
16+ fi
17 AC_PROG_CPP
18 if test "$CPP" = no; then
19 AC_MSG_ERROR([cpp not found])
20@@ -172,7 +175,6 @@
21
22 dnl ---Output variables...
23
24-HOST_CC=$CC
25 HOST_CFLAGS="$HOST_CFLAGS -O2 -Wall \$(HOST_CPPFLAGS)"
26
27 dnl TODO: figure out how to set these appropriately for compilers other than gcc
28Index: mkelfImage/linux-i386/Makefile
29===================================================================
30--- mkelfImage.orig/linux-i386/Makefile 2012-07-14 14:04:48.964898667 -0700
31+++ mkelfImage/linux-i386/Makefile 2012-07-14 14:04:49.032898671 -0700
32@@ -4,7 +4,7 @@
33
34 $(LI386_OBJ)/mkelf-linux-i386.o: $(LI386_DIR)/mkelf-linux-i386.c $(LI386_DIR)/convert.bin.c $(LI386_DEP)
35 $(MKDIR) -p $(@D)
36- $(HOST_CC) $(HOST_CFLAGS) -c -g $< -o $@
37+ $(CC) $(HOST_CFLAGS) -c -g $< -o $@
38
39
40 ifdef I386_CC
41Index: mkelfImage/linux-ia64/Makefile
42===================================================================
43--- mkelfImage.orig/linux-ia64/Makefile 2012-07-14 14:04:48.964898667 -0700
44+++ mkelfImage/linux-ia64/Makefile 2012-07-14 14:04:49.032898671 -0700
45@@ -4,7 +4,7 @@
46
47 $(LIA64_OBJ)/mkelf-linux-ia64.o: $(LIA64_DIR)/mkelf-linux-ia64.c $(LIA64_DIR)/convert.bin.c $(LIA64_DEP)
48 $(MKDIR) -p $(@D)
49- $(HOST_CC) $(HOST_CFLAGS) -c -g $< -o $@
50+ $(CC) $(HOST_CFLAGS) -c -g $< -o $@
51
52 ifdef IA64_CC
53
54Index: mkelfImage/main/Makefile
55===================================================================
56--- mkelfImage.orig/main/Makefile 2012-07-14 14:04:48.964898667 -0700
57+++ mkelfImage/main/Makefile 2012-07-14 14:04:49.032898671 -0700
58@@ -4,11 +4,11 @@
59
60 $(OBJDIR)/sbin/mkelfImage: $(MKELF_OBJS) $(DEPS)
61 $(MKDIR) -p $(@D)
62- $(HOST_CC) $(HOST_CFLAGS) $(MKELF_OBJS) -o $@ $(LIBS)
63+ $(CC) $(HOST_CFLAGS) $(MKELF_OBJS) -o $@ $(LIBS)
64
65 $(OBJDIR)/main/mkelfImage.o: main/mkelfImage.c include/mkelfImage.h $(DEPS)
66 $(MKDIR) -p $(@D)
67- $(HOST_CC) $(HOST_CFLAGS) -c $< -o $@
68+ $(CC) $(HOST_CFLAGS) -c $< -o $@
69
70 $(OBJDIR)/man/man8/mkelfImage.8: main/mkelfImage.man
71 $(MKDIR) -p $(@D)
diff --git a/meta/recipes-devtools/mkelfimage/mkelfimage_git.bb b/meta/recipes-devtools/mkelfimage/mkelfimage_git.bb
deleted file mode 100644
index 4b45c677f6..0000000000
--- a/meta/recipes-devtools/mkelfimage/mkelfimage_git.bb
+++ /dev/null
@@ -1,17 +0,0 @@
1DESCRIPTION = "A utility to create ELF boot images from Linux kernel images"
2HOMEPAGE = "http://www.coreboot.org/Mkelfimage"
3SECTION = "devel"
4LICENSE = "GPLv2"
5LIC_FILES_CHKSUM = "file://COPYING;md5=ea5bed2f60d357618ca161ad539f7c0a"
6
7SRCREV = "e1e6a91ce0738400fa1615179de88ebc0df29f66"
8PV = "1.0.0+gitr${SRCPV}"
9PR = "r1"
10
11SRC_URI = "git://review.coreboot.org/p/coreboot;protocol=http;branch=master"
12
13S = "${WORKDIR}/git/util/mkelfImage"
14
15inherit autotools
16
17BBCLASSEXTEND = "native"
diff --git a/meta/recipes-devtools/mkelfimage/mkelfimage_svn.bb b/meta/recipes-devtools/mkelfimage/mkelfimage_svn.bb
new file mode 100644
index 0000000000..c670f23e25
--- /dev/null
+++ b/meta/recipes-devtools/mkelfimage/mkelfimage_svn.bb
@@ -0,0 +1,30 @@
1DESCRIPTION = "A utility to create ELF boot images from Linux kernel images"
2HOMEPAGE = "http://www.coreboot.org/Mkelfimage"
3SECTION = "devel"
4LICENSE = "GPLv2"
5LIC_FILES_CHKSUM = "file://COPYING;md5=ea5bed2f60d357618ca161ad539f7c0a"
6
7SRCREV = "6637"
8PV = "1.0.0+svn${SRCPV}"
9PR = "r1"
10
11DEPENDS += "zlib"
12
13SRC_URI = "svn://coreboot.org/coreboot/trunk/util;module=mkelfImage \
14 file://cross-compile.patch \
15 "
16
17S = "${WORKDIR}/mkelfImage"
18
19CFLAGS += "-fno-stack-protector"
20CACHED_CONFIGUREVARS += "HOST_CC='${BUILD_CC}'"
21EXTRA_OEMAKE += "HOST_CPPFLAGS='${BUILD_CPPFLAGS}'"
22
23inherit autotools
24
25do_install_append() {
26 rmdir ${D}${datadir}/mkelfImage/elf32-i386
27 rmdir ${D}${datadir}/mkelfImage
28}
29
30BBCLASSEXTEND = "native"