linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Guenter Roeck <linux@roeck-us.net>
Cc: linux-kernel@vger.kernel.org, Rik van Riel <riel@surriel.com>,
	Mike Galbraith <efault@gmx.de>,
	Dave Hansen <dave.hansen@intel.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: Build failures with gcc 4.5 and older
Date: Tue, 14 Aug 2018 16:02:08 -0700	[thread overview]
Message-ID: <20180814160208.4f4dd7ca142912f5894ddddd@linux-foundation.org> (raw)
In-Reply-To: <20180814221559.GA15888@roeck-us.net>

On Tue, 14 Aug 2018 15:15:59 -0700 Guenter Roeck <linux@roeck-us.net> wrote:

> > Confused.  Why does it think that the mm_struct is "otherwise empty"?
> > 
> 
> The problem isn't really that the structure is otherwise empty.
> Some digging reveals that the error message is wrong; gcc should
> instead complain about having no _named_ structure element before
> the flexible array member.
> 
> > This shuts it up:
> > 
> > --- a/include/linux/mm_types.h~a
> > +++ a/include/linux/mm_types.h
> > @@ -490,6 +490,7 @@ struct mm_struct {
> >  #endif
> >  	} __randomize_layout;
> >  
> > +	int wibble;
> >  	/*
> >  	 * The mm_cpumask needs to be at the end of mm_struct, because it
> >  	 * is dynamically sized based on nr_cpu_ids.
> > 
> 
> Unfortunately, that only triggers secondary errors.
> Seen with both gcc 4.4 and 4.5.
> 
> mm/init-mm.c:29: error: unknown field ‘mm_rb’ specified in initializer
> mm/init-mm.c:29: warning: missing braces around initializer
> mm/init-mm.c:29: warning: (near initialization for ‘init_mm.<anonymous>’)
> mm/init-mm.c:29: error: incompatible types when initializing type ‘struct
> vm_area_struct *’ using type ‘struct rb_root’
> mm/init-mm.c:30: error: unknown field ‘pgd’ specified in initializer
> 
> and many more similar errors.

This works, I think.

The m68k build still fails because 0cc3cd21657 ("cpu/hotplug: Boot HT
siblings at least once") was evidently never tested on CONFIG_SMP=n. 
How could that come about - the patch is six weeks old??

kernel/cpu.c: In function 'boot_cpu_hotplug_init':
kernel/cpu.c:2275:2: error: 'struct cpuhp_cpu_state' has no member named 'booted_once'


--- a/include/linux/mm_types.h~a
+++ a/include/linux/mm_types.h
@@ -490,6 +490,8 @@ struct mm_struct {
 #endif
 	} __randomize_layout;
 
+	int wibble;
+
 	/*
 	 * The mm_cpumask needs to be at the end of mm_struct, because it
 	 * is dynamically sized based on nr_cpu_ids.
--- a/mm/init-mm.c~a
+++ a/mm/init-mm.c
@@ -26,15 +26,17 @@
  * and size this cpu_bitmask to NR_CPUS.
  */
 struct mm_struct init_mm = {
-	.mm_rb		= RB_ROOT,
-	.pgd		= swapper_pg_dir,
-	.mm_users	= ATOMIC_INIT(2),
-	.mm_count	= ATOMIC_INIT(1),
-	.mmap_sem	= __RWSEM_INITIALIZER(init_mm.mmap_sem),
-	.page_table_lock =  __SPIN_LOCK_UNLOCKED(init_mm.page_table_lock),
-	.arg_lock	=  __SPIN_LOCK_UNLOCKED(init_mm.arg_lock),
-	.mmlist		= LIST_HEAD_INIT(init_mm.mmlist),
-	.user_ns	= &init_user_ns,
+	{
+		.mm_rb		= RB_ROOT,
+		.pgd		= swapper_pg_dir,
+		.mm_users	= ATOMIC_INIT(2),
+		.mm_count	= ATOMIC_INIT(1),
+		.mmap_sem	= __RWSEM_INITIALIZER(init_mm.mmap_sem),
+		.page_table_lock = __SPIN_LOCK_UNLOCKED(init_mm.page_table_lock),
+		.arg_lock	= __SPIN_LOCK_UNLOCKED(init_mm.arg_lock),
+		.mmlist		= LIST_HEAD_INIT(init_mm.mmlist),
+		.user_ns	= &init_user_ns,
+	},
 	.cpu_bitmap	= { [BITS_TO_LONGS(NR_CPUS)] = 0},
 	INIT_MM_CONTEXT(init_mm)
 };
_


  reply	other threads:[~2018-08-14 23:02 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-14 17:09 Build failures with gcc 4.5 and older Guenter Roeck
2018-08-14 17:20 ` Linus Torvalds
2018-08-14 17:36   ` Guenter Roeck
2018-08-14 20:19     ` Tony Luck
2018-08-15 16:09       ` Tony Luck
2018-08-15 16:34         ` Linus Torvalds
2018-08-16  0:27           ` Guenter Roeck
2018-08-15 16:49         ` Guenter Roeck
2018-08-14 17:48 ` Joe Perches
2018-08-19 21:23   ` Kees Cook
2018-08-20 17:46   ` Nick Desaulniers
2018-08-20 18:34     ` Linus Torvalds
2018-08-14 21:36 ` Andrew Morton
2018-08-14 22:15   ` Guenter Roeck
2018-08-14 23:02     ` Andrew Morton [this message]
2018-08-14 23:20       ` Linus Torvalds
2018-08-15  1:02         ` Guenter Roeck
2018-08-20 14:53           ` Thomas Gleixner
2018-08-20 16:00             ` Arnd Bergmann
2018-08-15 12:40 ` David Laight
2018-08-15 15:44   ` Linus Torvalds
2018-08-15 16:18     ` David Laight
2018-08-15 16:33       ` Linus Torvalds
2018-08-16  9:17         ` David Laight

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=20180814160208.4f4dd7ca142912f5894ddddd@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=dave.hansen@intel.com \
    --cc=efault@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=riel@surriel.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).