From: Alistair John Strachan <alistair@devzero.co.uk>
To: Jakub Jelinek <jakub@redhat.com>
Cc: Sam Ravnborg <sam@ravnborg.org>,
Chris Knadle <Chris.Knadle@coredump.us>,
Andrew Morton <akpm@linux-foundation.org>,
Adrian Bunk <bunk@kernel.org>,
venkatesh.pallipadi@intel.com, davem@davemloft.net,
trini@kernel.crashing.org, mingo@elte.hu, tglx@linutronix.de,
hpa@zytor.com, linux-kernel@vger.kernel.org,
suresh.b.siddha@intel.com,
Linus Torvalds <torvalds@linux-foundation.org>,
Sven-Haegar Koch <haegar@sdinet.de>
Subject: Re: huge gcc 4.1.{0,1} __weak problem
Date: Fri, 2 May 2008 16:26:22 +0100 [thread overview]
Message-ID: <200805021626.23487.alistair@devzero.co.uk> (raw)
In-Reply-To: <20080502141132.GN2255@devserv.devel.redhat.com>
On Friday 02 May 2008 15:11:32 Jakub Jelinek wrote:
> On Fri, May 02, 2008 at 03:57:08PM +0200, Sam Ravnborg wrote:
> > OK, can anyone confirm that this fails to build which a
> > buggy gcc:
> >
> >
> > void __attribute__((weak)) func(void)
> > {
> > /* no code */
> > }
> >
> > int main()
> > {
> > func();
> > return 0;
> > }
>
> Of course it doesn't fail to build.
[snip]
> I doubt a runtime testcase is acceptable though for the
> kernel, as the cross compiler used to build the kernel might not be able to
> create userland executables (missing C library, etc.).
I assume the GCC testsuite has the same generic problem, which is probably why
it uses the -fdump-tree-optimized parameter to gcc. For example:
alistair@just:~$ cat test.c
void __attribute__((weak)) func(void)
{
/* no code */
}
int main()
{
func();
return 0;
}
alistair@just:~$ gcc -O2 -fdump-tree-optimized test.c
alistair@just:~$ rm -f a.out
alistair@just:~$ cat test.c*.optimized | egrep "func \\(\\);"
func ();
Ergo, my compiler isn't buggy. As this doesn't require a runtime test I think
it would be OK for the kernel.
Of course, whether or not it's worth it is now debatable, given the
information Sven-Haegar Koch provided (Debian's GCC version number is
actually 4.1.2).
--
Cheers,
Alistair.
137/1 Warrender Park Road, Edinburgh, UK.
next prev parent reply other threads:[~2008-05-02 15:29 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-01 23:55 huge gcc 4.1.{0,1} __weak problem Chris Knadle
2008-05-02 9:19 ` Miquel van Smoorenburg
2008-05-02 9:55 ` Alistair John Strachan
2008-05-02 10:43 ` Sam Ravnborg
2008-05-02 11:48 ` Alistair John Strachan
2008-05-02 13:57 ` Sam Ravnborg
2008-05-02 14:11 ` Jakub Jelinek
2008-05-02 15:26 ` Alistair John Strachan [this message]
2008-05-02 14:57 ` Jeremy Fitzhardinge
2008-05-02 12:40 ` Sven-Haegar Koch
-- strict thread matches above, loose matches on Subject: below --
2008-04-30 1:31 [PATCH] /dev/mem gcc weak function workaround Venki Pallipadi
2008-04-30 4:28 ` David Miller
2008-04-30 12:49 ` Pallipadi, Venkatesh
2008-05-01 21:56 ` huge gcc 4.1.{0,1} __weak problem Adrian Bunk
2008-05-01 22:20 ` Andrew Morton
2008-05-01 22:27 ` Linus Torvalds
2008-05-01 22:33 ` Andrew Morton
2008-05-01 23:24 ` Tom Rini
2008-05-01 23:59 ` Andrew Morton
2008-05-02 0:21 ` Justin Mattock
2008-05-02 7:18 ` Vegard Nossum
2008-05-02 13:43 ` Theodore Tso
2008-05-02 8:10 ` Adrian Bunk
2008-05-02 9:09 ` Andi Kleen
2008-05-01 22:35 ` Venki Pallipadi
2008-05-01 22:42 ` Andrew Morton
2008-05-01 22:49 ` Jakub Jelinek
2008-05-01 23:21 ` Tom Rini
2008-05-01 23:30 ` Venki Pallipadi
2008-05-02 0:34 ` Linus Torvalds
2008-05-02 0:39 ` Suresh Siddha
2008-05-02 21:11 ` Jeremy Fitzhardinge
2008-05-02 22:02 ` David Miller
2008-05-01 23:23 ` Tom Rini
2008-05-01 22:51 ` David Miller
2008-05-02 21:09 ` Jeremy Fitzhardinge
2008-05-02 21:19 ` Adrian Bunk
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=200805021626.23487.alistair@devzero.co.uk \
--to=alistair@devzero.co.uk \
--cc=Chris.Knadle@coredump.us \
--cc=akpm@linux-foundation.org \
--cc=bunk@kernel.org \
--cc=davem@davemloft.net \
--cc=haegar@sdinet.de \
--cc=hpa@zytor.com \
--cc=jakub@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=sam@ravnborg.org \
--cc=suresh.b.siddha@intel.com \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=trini@kernel.crashing.org \
--cc=venkatesh.pallipadi@intel.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 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.