All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christopher Larson <kergoth@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: Christopher Larson <chris_larson@mentor.com>
Subject: [master][PATCHv2 2/3] mkelfimage: obey LDFLAGS, sort out HOST_ flags
Date: Thu,  5 May 2016 15:59:42 -0700	[thread overview]
Message-ID: <e889a21f09e4bcbddd05ee90a914600d33540dfa.1462489051.git.chris_larson@mentor.com> (raw)
In-Reply-To: <289ee855c6244dfd7a5b1e0f2a4a27ad236ac60c.1462476586.git.chris_larson@mentor.com>
In-Reply-To: <cover.1462489051.git.chris_larson@mentor.com>

From: Christopher Larson <chris_larson@mentor.com>

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.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
---
 .../mkelfimage/mkelfimage/cross-compile.patch      | 86 +++++++++++++++-------
 meta/recipes-devtools/mkelfimage/mkelfimage_git.bb |  4 +-
 2 files changed, 63 insertions(+), 27 deletions(-)

diff --git a/meta/recipes-devtools/mkelfimage/mkelfimage/cross-compile.patch b/meta/recipes-devtools/mkelfimage/mkelfimage/cross-compile.patch
index 7692709..2ae4b61 100644
--- a/meta/recipes-devtools/mkelfimage/mkelfimage/cross-compile.patch
+++ b/meta/recipes-devtools/mkelfimage/mkelfimage/cross-compile.patch
@@ -1,13 +1,43 @@
-make the tool to be cross compilable.
+From dc2712119d6832e24a9b7bed9ed4ce5ae03ce0a3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 14 Jul 2012 14:14:07 -0700
+Subject: [PATCH] mkelfimage: Fix cross build
+
+Make the tool to be cross compilable, by separating the variables for build
+tools from those for the target. Also modified to obey LDFLAGS.
 
 Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+
 Upstream-Status: Pending
 
-Index: mkelfImage/configure.ac
-===================================================================
---- mkelfImage.orig/configure.ac	2012-07-14 14:04:48.964898667 -0700
-+++ mkelfImage/configure.ac	2012-07-14 14:10:47.800916083 -0700
-@@ -70,6 +70,9 @@
+---
+ util/mkelfImage/Makefile.conf.in    | 3 +++
+ util/mkelfImage/configure.ac        | 7 +++++--
+ util/mkelfImage/linux-i386/Makefile | 2 +-
+ util/mkelfImage/linux-ia64/Makefile | 2 +-
+ util/mkelfImage/main/Makefile       | 4 ++--
+ 5 files changed, 12 insertions(+), 6 deletions(-)
+
+diff --git a/util/mkelfImage/Makefile.conf.in b/util/mkelfImage/Makefile.conf.in
+index 4645e44..dcb6cf2 100644
+--- a/util/mkelfImage/Makefile.conf.in
++++ b/util/mkelfImage/Makefile.conf.in
+@@ -17,6 +17,9 @@ DEFS=@DEFS@
+ LIBS=@LIBS@
+ HOST_CC=@HOST_CC@
+ HOST_CFLAGS=@HOST_CFLAGS@  $(DEFS)
++CC=@CC@
++CFLAGS=@CFLAGS@ $(DEFS)
++LDFLAGS=@LDFLAGS@
+ 
+ I386_CC     =@I386_CC@
+ I386_LD     =@I386_LD@
+diff --git a/util/mkelfImage/configure.ac b/util/mkelfImage/configure.ac
+index 652b952..0f2ac72 100644
+--- a/util/mkelfImage/configure.ac
++++ b/util/mkelfImage/configure.ac
+@@ -70,6 +70,9 @@ if test "with_default" != no ; then
  		AC_MSG_ERROR([cc not found])
  	fi
  	eval "${with_default}_CC='$CC'"
@@ -17,19 +47,22 @@ Index: mkelfImage/configure.ac
  	AC_PROG_CPP
  	if test "$CPP" = no; then
  		AC_MSG_ERROR([cpp not found])
-@@ -172,7 +175,6 @@
+@@ -172,8 +175,8 @@ fi
  
  dnl ---Output variables...
  
 -HOST_CC=$CC
- HOST_CFLAGS="$HOST_CFLAGS -O2 -Wall \$(HOST_CPPFLAGS)"
+-HOST_CFLAGS="$HOST_CFLAGS -O2 -Wall \$(HOST_CPPFLAGS)"
++CFLAGS="${CFLAGS:--O2} -Wall \$(CPPFLAGS)"
++HOST_CFLAGS="${HOST_CFLAGS:--O2} -Wall \$(HOST_CPPFLAGS)"
  
  dnl TODO: figure out how to set these appropriately for compilers other than gcc
-Index: mkelfImage/linux-i386/Makefile
-===================================================================
---- mkelfImage.orig/linux-i386/Makefile	2012-07-14 14:04:48.964898667 -0700
-+++ mkelfImage/linux-i386/Makefile	2012-07-14 14:04:49.032898671 -0700
-@@ -4,7 +4,7 @@
+ I386_CFLAGS="$I386_CFLAGS -Os -ffreestanding -Wall -W -Wno-format \$(I386_CPPFLAGS)"
+diff --git a/util/mkelfImage/linux-i386/Makefile b/util/mkelfImage/linux-i386/Makefile
+index 51531d6..7e8aa3c 100644
+--- a/util/mkelfImage/linux-i386/Makefile
++++ b/util/mkelfImage/linux-i386/Makefile
+@@ -4,7 +4,7 @@ LI386_DEP=Makefile Makefile.conf $(LI386_DIR)/Makefile
  
  $(LI386_OBJ)/mkelf-linux-i386.o: $(LI386_DIR)/mkelf-linux-i386.c $(LI386_DIR)/convert.bin.c $(LI386_DEP)
  	$(MKDIR) -p $(@D)
@@ -38,11 +71,11 @@ Index: mkelfImage/linux-i386/Makefile
  
  
  ifdef I386_CC
-Index: mkelfImage/linux-ia64/Makefile
-===================================================================
---- mkelfImage.orig/linux-ia64/Makefile	2012-07-14 14:04:48.964898667 -0700
-+++ mkelfImage/linux-ia64/Makefile	2012-07-14 14:04:49.032898671 -0700
-@@ -4,7 +4,7 @@
+diff --git a/util/mkelfImage/linux-ia64/Makefile b/util/mkelfImage/linux-ia64/Makefile
+index 38f5d8c..5df8870 100644
+--- a/util/mkelfImage/linux-ia64/Makefile
++++ b/util/mkelfImage/linux-ia64/Makefile
+@@ -4,7 +4,7 @@ LIA64_DEP=Makefile Makefile.conf $(LIA64_DIR)/Makefile
  
  $(LIA64_OBJ)/mkelf-linux-ia64.o: $(LIA64_DIR)/mkelf-linux-ia64.c $(LIA64_DIR)/convert.bin.c $(LIA64_DEP)
  	$(MKDIR) -p $(@D)
@@ -51,21 +84,24 @@ Index: mkelfImage/linux-ia64/Makefile
  
  ifdef IA64_CC
  
-Index: mkelfImage/main/Makefile
-===================================================================
---- mkelfImage.orig/main/Makefile	2012-07-14 14:04:48.964898667 -0700
-+++ mkelfImage/main/Makefile	2012-07-14 14:04:49.032898671 -0700
-@@ -4,11 +4,11 @@
+diff --git a/util/mkelfImage/main/Makefile b/util/mkelfImage/main/Makefile
+index 403b0a4..cd53613 100644
+--- a/util/mkelfImage/main/Makefile
++++ b/util/mkelfImage/main/Makefile
+@@ -4,11 +4,11 @@ MKELF_OBJS=$(OBJDIR)/main/mkelfImage.o \
  
  $(OBJDIR)/sbin/mkelfImage: $(MKELF_OBJS) $(DEPS)
  	$(MKDIR) -p $(@D)
 -	$(HOST_CC) $(HOST_CFLAGS) $(MKELF_OBJS) -o $@ $(LIBS)
-+	$(CC) $(HOST_CFLAGS) $(MKELF_OBJS) -o $@ $(LIBS)
++	$(CC) $(CFLAGS) $(LDFLAGS) $(MKELF_OBJS) -o $@ $(LIBS)
  
  $(OBJDIR)/main/mkelfImage.o: main/mkelfImage.c include/mkelfImage.h $(DEPS)
  	$(MKDIR) -p $(@D)
 -	$(HOST_CC) $(HOST_CFLAGS) -c $< -o $@
-+	$(CC) $(HOST_CFLAGS) -c $< -o $@
++	$(CC) $(CFLAGS) -c $< -o $@
  
  $(OBJDIR)/man/man8/mkelfImage.8: main/mkelfImage.man
  	$(MKDIR) -p $(@D)
+-- 
+2.8.0
+
diff --git a/meta/recipes-devtools/mkelfimage/mkelfimage_git.bb b/meta/recipes-devtools/mkelfimage/mkelfimage_git.bb
index 92435cd..d7a4429 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
 DEPENDS += "zlib"
 
 SRC_URI = "git://review.coreboot.org/p/coreboot;protocol=http \
-           file://cross-compile.patch   \
-          "
+           file://cross-compile.patch \
+           "
 SRC_URI_append_class-native = " \
            file://fix-makefile-to-find-libz.patch   \
 "
-- 
2.8.0



  parent reply	other threads:[~2016-05-05 22:59 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-05 19:30 [master][PATCH 0/3] Fix a few recipes to obey LDFLAGS Christopher Larson
2016-05-05 19:30 ` [master][PATCH 1/3] ruby: obey LDFLAGS for the link of libruby Christopher Larson
2016-05-05 19:30 ` [master][PATCH 2/3] mkelfimage: obey LDFLAGS, sort out HOST_ flags Christopher Larson
2016-05-05 21:54   ` Khem Raj
2016-05-05 22:16     ` Christopher Larson
     [not found]   ` <cover.1462489051.git.chris_larson@mentor.com>
2016-05-05 22:59     ` Christopher Larson [this message]
2016-05-14  6:25       ` [master][PATCHv2 " Richard Purdie
2016-05-16 22:37         ` Christopher Larson
2016-05-20 17:04       ` [PATCHv3] " Christopher Larson
2016-05-23  4:52         ` Khem Raj
2016-05-23 13:31           ` Patrick Ohly
2016-05-23 19:59             ` Christopher Larson
2016-05-23 20:07               ` Burton, Ross
2016-05-24 13:49                 ` Khem Raj
2016-05-23 20:01             ` Christopher Larson
2016-05-05 19:30 ` [master][PATCH 3/3] pong-clock: obey CFLAGS, LDFLAGS Christopher Larson
2016-05-05 22:30   ` Khem Raj
2016-05-12 18:08 ` [master][PATCH 0/3] Fix a few recipes to obey LDFLAGS Christopher Larson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e889a21f09e4bcbddd05ee90a914600d33540dfa.1462489051.git.chris_larson@mentor.com \
    --to=kergoth@gmail.com \
    --cc=chris_larson@mentor.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.