From: Ram Pai <linuxram@us.ibm.com>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: hartb@us.ibm.com, paulus@samba.org, anton@samba.org,
tony@ozlabs.au.ibm.com, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 1/1] powerpc: crtsaveres.o needed only when -Os flag is enabled
Date: Fri, 2 May 2014 10:47:36 -0700 [thread overview]
Message-ID: <20140502174736.GA5045@ram.oc3035372033.ibm.com> (raw)
In-Reply-To: <87wqe4age2.fsf@linux.vnet.ibm.com>
On Fri, May 02, 2014 at 11:09:17AM +0530, Aneesh Kumar K.V wrote:
> Ram Pai <linuxram@us.ibm.com> writes:
>
> > powerpc: crtsaveres.o needed only when -Os flag is enabled
> >
> > Currently on powerpc arch, out-of-tree module fails to build without
> > crtsaveres.o, even when the module has no dependency on the symbols
> > provided by the file; when built without the -Os flag.
> >
> > BTW: '-Os' flag is enabled when CONFIG_CC_OPTIMIZE_FOR_SIZE is
> > configured.
> >
> > This patch fixes that problem.
> >
> > Signed-off-by: Ram Pai <linuxram@us.ibm.com>
> >
> > diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
> > index 4c0cedf..cf12f38 100644
> > --- a/arch/powerpc/Makefile
> > +++ b/arch/powerpc/Makefile
> > @@ -157,7 +157,10 @@ CPP = $(CC) -E $(KBUILD_CFLAGS)
> >
> > CHECKFLAGS += -m$(CONFIG_WORD_SIZE) -D__powerpc__ -D__powerpc$(CONFIG_WORD_SIZE)__
> >
> > +ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
> > KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o
> > +endif
> > +
> >
> > # No AltiVec or VSX instructions when building kernel
> > KBUILD_CFLAGS += $(call cc-option,-mno-altivec)
> >
>
> So if we enable CONFIG_CC_OPTIMIZE_FOR_SIZE can we build out-of-tree
> module with this patch ?
Yes, provided crtsaveres.o is available.
If crtsaveres.o is not available; some distro dont ship it, than
out-of-tree module linking will fail.
Some distro don't ship crtsaveres.o since they do not want
kernel and modules to be built with space optimization. In such cases
requiring crtsaveres.o to be available during module building, even
when the module is not built for space optimization is wrong.
This patch fixes that issue.
RP
prev parent reply other threads:[~2014-05-02 17:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-29 0:05 [PATCH 1/1] powerpc: crtsaveres.o needed only when -Os flag is enabled Ram Pai
2014-04-29 15:38 ` Brian W Hart
2014-04-30 5:14 ` Benjamin Herrenschmidt
2014-04-30 18:43 ` Ram Pai
2014-05-02 5:39 ` Aneesh Kumar K.V
2014-05-02 17:47 ` Ram Pai [this message]
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=20140502174736.GA5045@ram.oc3035372033.ibm.com \
--to=linuxram@us.ibm.com \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=anton@samba.org \
--cc=hartb@us.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=paulus@samba.org \
--cc=tony@ozlabs.au.ibm.com \
/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;
as well as URLs for NNTP newsgroup(s).