lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Fri, 2 May 2008 16:26:22 +0100
From:	Alistair John Strachan <alistair@...zero.co.uk>
To:	Jakub Jelinek <jakub@...hat.com>
Cc:	Sam Ravnborg <sam@...nborg.org>,
	Chris Knadle <Chris.Knadle@...edump.us>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Adrian Bunk <bunk@...nel.org>, venkatesh.pallipadi@...el.com,
	davem@...emloft.net, trini@...nel.crashing.org, mingo@...e.hu,
	tglx@...utronix.de, hpa@...or.com, linux-kernel@...r.kernel.org,
	suresh.b.siddha@...el.com,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Sven-Haegar Koch <haegar@...net.de>
Subject: Re: huge gcc 4.1.{0,1} __weak problem

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@...t:~$ cat test.c
void __attribute__((weak)) func(void)
{
    /* no code */
}

int main()
{
    func();
    return 0;
}

alistair@...t:~$ gcc -O2 -fdump-tree-optimized test.c
alistair@...t:~$ rm -f a.out
alistair@...t:~$ 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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ