Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp153367imm; Tue, 14 Aug 2018 16:03:46 -0700 (PDT) X-Google-Smtp-Source: AA+uWPx6vzQrAqRwjK8zj3aHTbwmvTVpXQJ99/0KOWTe9ZllwXjGw2RfHlfh6nwYWii+Ri7GgsnV X-Received: by 2002:a17:902:b28:: with SMTP id 37-v6mr21999713plq.337.1534287825993; Tue, 14 Aug 2018 16:03:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534287825; cv=none; d=google.com; s=arc-20160816; b=Mflmg94tSEytpjHshrqUaOzIB9MrefbPJQSZ+j9n/gtx+yTrC4GBUn6ntDhRtmWsKA 7+TqQb3D8WODojdHIvhP/BAxEXGX/MnoMCe97vdWSmzvblhZHTJpJp/herS1+hbmbI6k NfrT3uFveqdkbNPOu19gq9U4QCbaLnopo+h3xfD4qeLQkwlHt4J+fHAhmEJg5hfzI7sc 8bHr5PJdHN2WleVFiPjYXATZYIMjJOOOxJ3oEitLb8y2AXWFm/xz7jtOnfXB3PRGr2Ru ymgP1yAPISOUEZ0fbYPAbEHBGIikOemWpIAg8yxRjNDdI5Ava6CoBPobAJfYtVxxnIP8 rn8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=5vSFjnor5SE9B7V50lxheo2fMENYY8/YykEV+GZqQmA=; b=Il3npIT5028TsaVGtl6SvnFQod8ncagbL5XQniIPncu5GKho3LGCsaokfNIjhsFzug ir5uKou6P7r09GBEcj/tIfkroztutezCV/D716vycm/HmdK0eoVDXrdtLHeweJA/RkTN rl2lPf1xGOtjIGKkljme8aYXxjt5za0JEpPdc1EO/lB3aaCiRfCvA5j+GatKpPLXwhws 9RmiWvbozPl16Qfgi8Ijbioyp2zgUHpUbxr4/gZ/A9vdVcls3exnomWw6uEcXqeg5aoh fKwOJTEqO0HRk2vQ2yoPoG81FGrhp7e1kzZxiDonczWWCy60NbOOThkF//vvRBgdYhiA XBdw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y10-v6si22142551pgf.312.2018.08.14.16.03.30; Tue, 14 Aug 2018 16:03:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732573AbeHOBve (ORCPT + 99 others); Tue, 14 Aug 2018 21:51:34 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:55546 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729705AbeHOBve (ORCPT ); Tue, 14 Aug 2018 21:51:34 -0400 Received: from akpm3.svl.corp.google.com (unknown [104.133.9.92]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id D4D7FD00; Tue, 14 Aug 2018 23:02:09 +0000 (UTC) Date: Tue, 14 Aug 2018 16:02:08 -0700 From: Andrew Morton To: Guenter Roeck Cc: linux-kernel@vger.kernel.org, Rik van Riel , Mike Galbraith , Dave Hansen , Linus Torvalds , Thomas Gleixner Subject: Re: Build failures with gcc 4.5 and older Message-Id: <20180814160208.4f4dd7ca142912f5894ddddd@linux-foundation.org> In-Reply-To: <20180814221559.GA15888@roeck-us.net> References: <20180814170904.GA12768@roeck-us.net> <20180814143655.3acd4bb211d44747f77e74f2@linux-foundation.org> <20180814221559.GA15888@roeck-us.net> X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 14 Aug 2018 15:15:59 -0700 Guenter Roeck 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.’) > 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) }; _