All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benny Halevy <bhalevy@panasas.com>
To: Jeff Dike <jdike@addtoit.com>
Cc: linux-kernel@vger.kernel.org,
	user-mode-linux-devel@lists.sourceforge.net
Subject: Re: [uml-devel] [PATCH] fix extern inline errors with gcc 4.3.0
Date: Mon, 30 Jun 2008 19:37:27 +0300	[thread overview]
Message-ID: <48690BC7.5060809@panasas.com> (raw)
In-Reply-To: <20080630162201.GC6643@c2.user-mode-linux.org>

On Jun. 30, 2008, 19:22 +0300, Jeff Dike <jdike@addtoit.com> wrote:
> On Sun, Jun 29, 2008 at 10:32:43AM +0300, Benny Halevy wrote:
>> Note that the crash happened with gcc 4.1.2 and it will get the
>> -fno-unit-at-a-time flag with the proposed patch.
>>
>> That said, this option or the lack of it ought not to cause any
>> runtime crashes.  If it does, I'd feel much more comfortable to know
>> exactly what the root cause is before deciding to use the flag to
>> workaround^hide it.
> 
> I agree.
> 
> The constraints on [no-]unit-at-a-time that I see are:
> 	i386 uses no-unit-at-a-time for pre-4.0 (not 4.3)
> 	x86_64 uses unit-at-a-time always
> 
> 	Uli reported a crash on x86_64 with gcc 4.1.2 with unit-at-a-time
> 	Ingo reported a gcc internal error with gcc 4.3 with
> no-unit-at-a-time 
> 	You are seeing extern inlines not resolved with gcc 4.3 with
> no-unit-at-a-time 
> 
> I'm tempted to follow x86 on this, with the results that
> 	extern inlines should be fine
> 	Ingo's gcc crash should not reappear
> 	Uli's crash may reappear
> 
> If that crash does come back, I'd say we should just debug it.  It's
> likely UML implicitly relying on some gcc behavior anyway.

Agreed.

> 
> This is the patch that I'm dropping into my tree:
> 
> Index: linux-2.6.22/arch/um/Makefile-i386
> ===================================================================
> --- linux-2.6.22.orig/arch/um/Makefile-i386	2008-05-29 11:21:25.000000000 -0400
> +++ linux-2.6.22/arch/um/Makefile-i386	2008-06-30 12:20:01.000000000 -0400
> @@ -32,4 +32,10 @@ cflags-y += $(call cc-option,-mpreferred
>  # an unresolved reference.
>  cflags-y += -ffreestanding
>  
> +# Disable unit-at-a-time mode on pre-gcc-4.0 compilers, it makes gcc use
> +# a lot more stack due to the lack of sharing of stacklots.  Also, gcc
> +# 4.3.0 needs -funit-at-a-time for extern inline functions.
> +KBUILD_CFLAGS += $(shell if [ $(call cc-version) -lt 0403 ] ; then \

This isn't exactly aligned with the comment above.
Should be -lt 0400, as in 22eecde2f9034764a3fd095eecfa3adfb8ec9a98?

> +			echo $(call cc-option,-fno-unit-at-a-time); fi ;)
> +
>  KBUILD_CFLAGS += $(cflags-y)
> Index: linux-2.6.22/arch/um/Makefile-x86_64
> ===================================================================
> --- linux-2.6.22.orig/arch/um/Makefile-x86_64	2008-05-29 11:21:25.000000000 -0400
> +++ linux-2.6.22/arch/um/Makefile-x86_64	2008-06-30 12:21:01.000000000 -0400
> @@ -21,3 +21,6 @@ HEADER_ARCH := x86
>  
>  LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib64
>  LINK-y += -m64
> +
> +# Do unit-at-a-time unconditionally on x86_64, following the host
> +KBUILD_CFLAGS += $(call cc-option,-funit-at-a-time)

Hmm, arch/um/Makefile includes $(srctree)/$(ARCH_DIR)/Makefile-$(SUBARCH)
before add -fno-unit-at-a-time to KBUILD_CFLAGS.
Will this override the flag set first here?

Benny

> 
> 				Jeff
> 


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

WARNING: multiple messages have this Message-ID (diff)
From: Benny Halevy <bhalevy@panasas.com>
To: Jeff Dike <jdike@addtoit.com>
Cc: user-mode-linux-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fix extern inline errors with gcc 4.3.0
Date: Mon, 30 Jun 2008 19:37:27 +0300	[thread overview]
Message-ID: <48690BC7.5060809@panasas.com> (raw)
In-Reply-To: <20080630162201.GC6643@c2.user-mode-linux.org>

On Jun. 30, 2008, 19:22 +0300, Jeff Dike <jdike@addtoit.com> wrote:
> On Sun, Jun 29, 2008 at 10:32:43AM +0300, Benny Halevy wrote:
>> Note that the crash happened with gcc 4.1.2 and it will get the
>> -fno-unit-at-a-time flag with the proposed patch.
>>
>> That said, this option or the lack of it ought not to cause any
>> runtime crashes.  If it does, I'd feel much more comfortable to know
>> exactly what the root cause is before deciding to use the flag to
>> workaround^hide it.
> 
> I agree.
> 
> The constraints on [no-]unit-at-a-time that I see are:
> 	i386 uses no-unit-at-a-time for pre-4.0 (not 4.3)
> 	x86_64 uses unit-at-a-time always
> 
> 	Uli reported a crash on x86_64 with gcc 4.1.2 with unit-at-a-time
> 	Ingo reported a gcc internal error with gcc 4.3 with
> no-unit-at-a-time 
> 	You are seeing extern inlines not resolved with gcc 4.3 with
> no-unit-at-a-time 
> 
> I'm tempted to follow x86 on this, with the results that
> 	extern inlines should be fine
> 	Ingo's gcc crash should not reappear
> 	Uli's crash may reappear
> 
> If that crash does come back, I'd say we should just debug it.  It's
> likely UML implicitly relying on some gcc behavior anyway.

Agreed.

> 
> This is the patch that I'm dropping into my tree:
> 
> Index: linux-2.6.22/arch/um/Makefile-i386
> ===================================================================
> --- linux-2.6.22.orig/arch/um/Makefile-i386	2008-05-29 11:21:25.000000000 -0400
> +++ linux-2.6.22/arch/um/Makefile-i386	2008-06-30 12:20:01.000000000 -0400
> @@ -32,4 +32,10 @@ cflags-y += $(call cc-option,-mpreferred
>  # an unresolved reference.
>  cflags-y += -ffreestanding
>  
> +# Disable unit-at-a-time mode on pre-gcc-4.0 compilers, it makes gcc use
> +# a lot more stack due to the lack of sharing of stacklots.  Also, gcc
> +# 4.3.0 needs -funit-at-a-time for extern inline functions.
> +KBUILD_CFLAGS += $(shell if [ $(call cc-version) -lt 0403 ] ; then \

This isn't exactly aligned with the comment above.
Should be -lt 0400, as in 22eecde2f9034764a3fd095eecfa3adfb8ec9a98?

> +			echo $(call cc-option,-fno-unit-at-a-time); fi ;)
> +
>  KBUILD_CFLAGS += $(cflags-y)
> Index: linux-2.6.22/arch/um/Makefile-x86_64
> ===================================================================
> --- linux-2.6.22.orig/arch/um/Makefile-x86_64	2008-05-29 11:21:25.000000000 -0400
> +++ linux-2.6.22/arch/um/Makefile-x86_64	2008-06-30 12:21:01.000000000 -0400
> @@ -21,3 +21,6 @@ HEADER_ARCH := x86
>  
>  LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib64
>  LINK-y += -m64
> +
> +# Do unit-at-a-time unconditionally on x86_64, following the host
> +KBUILD_CFLAGS += $(call cc-option,-funit-at-a-time)

Hmm, arch/um/Makefile includes $(srctree)/$(ARCH_DIR)/Makefile-$(SUBARCH)
before add -fno-unit-at-a-time to KBUILD_CFLAGS.
Will this override the flag set first here?

Benny

> 
> 				Jeff
> 


  reply	other threads:[~2008-06-30 16:37 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-26 13:50 [PATCH] fix extern inline errors with gcc 4.3.0 Benny Halevy
2008-06-27 16:26 ` [uml-devel] " Jeff Dike
2008-06-27 16:26   ` Jeff Dike
2008-06-28 13:10   ` Halevy, Benny
2008-06-29  7:32     ` [SPAM] Re: [uml-devel] " Benny Halevy
2008-06-29  7:32       ` Benny Halevy
2008-06-30 16:22       ` [uml-devel] " Jeff Dike
2008-06-30 16:22         ` Jeff Dike
2008-06-30 16:37         ` Benny Halevy [this message]
2008-06-30 16:37           ` Benny Halevy
2008-07-07 16:58           ` [uml-devel] " Jeff Dike
2008-07-07 16:58             ` Jeff Dike
2008-06-30 16:43         ` [uml-devel] " Adrian Bunk
2008-06-30 16:43           ` Adrian Bunk
2008-08-08  1:02         ` [uml-devel] " Rob Landley
2008-08-08  1:02           ` Rob Landley
2008-08-08  1:42         ` Rob Landley
2008-08-08  1:42           ` Rob Landley
2008-07-14 18:30 ` David Shane Holden
2008-07-15 16:24   ` Jeff Dike
2008-07-15 18:42     ` [SPAM] " David Shane Holden
2008-07-15 20:13       ` Jeff Dike
     [not found]         ` <487DDF69.9030801@panasas.com>
     [not found]           ` <487DE1B3.1060502@panasas.com>
2008-07-18 20:49             ` Jeff Dike

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=48690BC7.5060809@panasas.com \
    --to=bhalevy@panasas.com \
    --cc=jdike@addtoit.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /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.