From: Simon Horman <horms@verge.net.au>
To: "Edgar E. Iglesias" <edgar.iglesias@axis.com>
Cc: "Edgar E. Iglesias" <edgar@axis.com>,
kexec@lists.infradead.org, jespern@axis.com
Subject: [PATCH] Only use -fno-zero-initialized-in-bss if it is available
Date: Wed, 8 Oct 2008 17:17:26 +1100 [thread overview]
Message-ID: <20081008061723.GG22396@verge.net.au> (raw)
In-Reply-To: <20081008061541.GF22396@verge.net.au>
As pointed out by Edgar E. Iglesias, the -fno-zero-initialized-in-bss
option to gcc is not available in the cris 3.2.1 toolchain.
Signed-off-by: Simon Horman <horms@verge.net.au>
---
Makefile.in | 1 +
configure.ac | 14 ++++++++++++++
purgatory/Makefile | 6 +++---
3 files changed, 18 insertions(+), 3 deletions(-)
I have applied this patch to the kexec-tools git tree.
diff --git a/Makefile.in b/Makefile.in
index f0621e1..6b4c954 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -46,6 +46,7 @@ TARGET_CFLAGS = @TARGET_CFLAGS@
CPPFLAGS = @CPPFLAGS@ -I$(srcdir)/include -I$(srcdir)/util_lib/include \
-Iinclude/
CFLAGS = @CFLAGS@ -fno-strict-aliasing -Wall -Wstrict-prototypes
+PURGATORY_EXTRA_CFLAGS = @PURGATORY_EXTRA_CFLAGS@
ASFLAGS = @ASFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
diff --git a/configure.ac b/configure.ac
index c677334..5351d53 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7,6 +7,7 @@ dnl ---Required
AC_INIT(kexec-tools, 2.0.0-git)
AC_CONFIG_AUX_DIR(./config)
AC_CONFIG_HEADERS([include/config.h])
+AC_LANG(C)
AC_DEFINE_UNQUOTED(PACKAGE_DATE, "19th July 2008",
[Define to the release date of this package])
@@ -105,6 +106,19 @@ else
TARGET_LD="$LD"
fi
+AC_MSG_CHECKING([whether $TARGET_CC accepts -fno-zero-initialized-in-bss])
+saved_CFLAGS="$CFLAGS"
+saved_CC="$CC"
+CC="$TARGET_CC"
+CFLAGS="$CFLAGS -fno-zero-initialized-in-bss"
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,,)],
+ PURGATORY_EXTRA_CFLAGS="-fno-zero-initialized-in-bss"
+ AC_MSG_RESULT([Yes]), AC_MSG_RESULT([No]))
+CFLAGS="$saved_CFLAGS"
+CC="$saved_CC"
+
+AC_SUBST(PURGATORY_EXTRA_CFLAGS, [$PURGATORY_EXTRA_CFLAGS])
+
dnl Find the helper functions
AC_PROG_INSTALL
AC_CHECK_PROG([MKDIR], mkdir, mkdir, "no", [$PATH])
diff --git a/purgatory/Makefile b/purgatory/Makefile
index ac58719..ceab269 100644
--- a/purgatory/Makefile
+++ b/purgatory/Makefile
@@ -45,9 +45,9 @@ purgatory/sha256.o: $(srcdir)/util_lib/sha256.c
$(COMPILE.c) -o $@ $^
$(PURGATORY): CC=$(TARGET_CC)
-$(PURGATORY): CFLAGS+=$($(ARCH)_PURGATORY_EXTRA_CFLAGS) \
- -Os -fno-builtin -ffreestanding \
- -fno-zero-initialized-in-bss
+$(PURGATORY): CFLAGS+=$(PURGATORY_EXTRA_CFLAGS) \
+ $($(ARCH)_PURGATORY_EXTRA_CFLAGS) \
+ -Os -fno-builtin -ffreestanding
$(PURGATORY): CPPFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS) \
-I$(srcdir)/purgatory/include \
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
next prev parent reply other threads:[~2008-10-08 6:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-04 14:08 [PATCH] cris: Add CRISv32 support Edgar E. Iglesias
2008-09-05 0:42 ` Simon Horman
2008-09-05 9:25 ` Edgar E. Iglesias
2008-10-08 6:15 ` Simon Horman
2008-10-08 6:17 ` Simon Horman [this message]
2008-10-08 6:18 ` [PATCH] cris: add kexc_load syscall Simon Horman
2008-10-08 6:19 ` [patch] cris: add cris architecture to configure Simon Horman
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=20081008061723.GG22396@verge.net.au \
--to=horms@verge.net.au \
--cc=edgar.iglesias@axis.com \
--cc=edgar@axis.com \
--cc=jespern@axis.com \
--cc=kexec@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox