All of lore.kernel.org
 help / color / mirror / Atom feed
From: Khem Raj <raj.khem@gmail.com>
To: Christopher Larson <kergoth@gmail.com>
Cc: Christopher Larson <chris_larson@mentor.com>,
	Patches and discussions about the oe-core layer
	<openembedded-core@lists.openembedded.org>
Subject: Re: [master][PATCH 2/3] mkelfimage: obey LDFLAGS, sort out HOST_ flags
Date: Thu, 5 May 2016 14:54:49 -0700	[thread overview]
Message-ID: <CAMKF1srtLpbqyE00f6RJ3irfS2n-zz-GjQ=saPFKOMoy5-OYZQ@mail.gmail.com> (raw)
In-Reply-To: <289ee855c6244dfd7a5b1e0f2a4a27ad236ac60c.1462476586.git.chris_larson@mentor.com>

On Thu, May 5, 2016 at 12:30 PM, Christopher Larson <kergoth@gmail.com> wrote:
> 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.
>

may be you should fold it into cross_compile patch ?

> Signed-off-by: Christopher Larson <chris_larson@mentor.com>
> ---
>  ...HOST_-vs-non-HOST_-flags-and-obey-LDFLAGS.patch | 73 ++++++++++++++++++++++
>  meta/recipes-devtools/mkelfimage/mkelfimage_git.bb |  5 +-
>  2 files changed, 76 insertions(+), 2 deletions(-)
>  create mode 100644 meta/recipes-devtools/mkelfimage/mkelfimage/0002-Sort-out-HOST_-vs-non-HOST_-flags-and-obey-LDFLAGS.patch
>
> diff --git a/meta/recipes-devtools/mkelfimage/mkelfimage/0002-Sort-out-HOST_-vs-non-HOST_-flags-and-obey-LDFLAGS.patch b/meta/recipes-devtools/mkelfimage/mkelfimage/0002-Sort-out-HOST_-vs-non-HOST_-flags-and-obey-LDFLAGS.patch
> new file mode 100644
> index 0000000..8139edc
> --- /dev/null
> +++ b/meta/recipes-devtools/mkelfimage/mkelfimage/0002-Sort-out-HOST_-vs-non-HOST_-flags-and-obey-LDFLAGS.patch
> @@ -0,0 +1,73 @@
> +Upstream-Status: Pending
> +
> +From ef21bb404cb5dbfbaa95b693c9705da2fd7e7472 Mon Sep 17 00:00:00 2001
> +From: Christopher Larson <chris_larson@mentor.com>
> +Date: Thu, 5 May 2016 11:49:24 -0700
> +Subject: Sort out HOST_ vs non-HOST_ flags, and obey LDFLAGS
> +
> +Signed-off-by: Christopher Larson <chris_larson@mentor.com>
> +---
> + Makefile.conf.in | 3 +++
> + configure.ac     | 6 +++++-
> + main/Makefile    | 4 ++--
> + 3 files changed, 10 insertions(+), 3 deletions(-)
> +
> +diff --git a/Makefile.conf.in b/Makefile.conf.in
> +index 4645e44..dcb6cf2 100644
> +--- a/Makefile.conf.in
> ++++ b/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/configure.ac b/configure.ac
> +index d8bd7aa..2962a4a 100644
> +--- a/configure.ac
> ++++ b/configure.ac
> +@@ -175,7 +175,8 @@ fi
> +
> + dnl ---Output variables...
> +
> +-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
> + I386_CFLAGS="$I386_CFLAGS -Os -ffreestanding -Wall -W -Wno-format \$(I386_CPPFLAGS)"
> +@@ -189,6 +190,9 @@ IA64_LDFLAGS='-static --warn-multiple-gp --warn-common'
> +
> + AC_SUBST([HOST_CC])
> + AC_SUBST([HOST_CFLAGS])
> ++AC_SUBST([CC])
> ++AC_SUBST([CFLAGS])
> ++AC_SUBST([LDFLAGS])
> +
> + AC_SUBST([I386_CC])
> + AC_SUBST([I386_LD])
> +diff --git a/main/Makefile b/main/Makefile
> +index d9fb1d8..cd53613 100644
> +--- a/main/Makefile
> ++++ b/main/Makefile
> +@@ -4,11 +4,11 @@ MKELF_OBJS=$(OBJDIR)/main/mkelfImage.o \
> +
> + $(OBJDIR)/sbin/mkelfImage: $(MKELF_OBJS) $(DEPS)
> +       $(MKDIR) -p $(@D)
> +-      $(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)
> +-      $(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..9fcccb4 100644
> --- a/meta/recipes-devtools/mkelfimage/mkelfimage_git.bb
> +++ b/meta/recipes-devtools/mkelfimage/mkelfimage_git.bb
> @@ -13,8 +13,9 @@ 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 \
> +           file://0002-Sort-out-HOST_-vs-non-HOST_-flags-and-obey-LDFLAGS.patch \
> +           "
>  SRC_URI_append_class-native = " \
>             file://fix-makefile-to-find-libz.patch   \
>  "
> --
> 2.8.0
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


  reply	other threads:[~2016-05-05 21:55 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 [this message]
2016-05-05 22:16     ` Christopher Larson
     [not found]   ` <cover.1462489051.git.chris_larson@mentor.com>
2016-05-05 22:59     ` [master][PATCHv2 " Christopher Larson
2016-05-14  6:25       ` 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='CAMKF1srtLpbqyE00f6RJ3irfS2n-zz-GjQ=saPFKOMoy5-OYZQ@mail.gmail.com' \
    --to=raj.khem@gmail.com \
    --cc=chris_larson@mentor.com \
    --cc=kergoth@gmail.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.