public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/63567] New: Linux kernel build error due to non-static initializers
@ 2014-10-16 22:46 sasha.levin at oracle dot com
  2014-10-17  5:33 ` [Bug c/63567] " mpolacek at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: sasha.levin at oracle dot com @ 2014-10-16 22:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63567

            Bug ID: 63567
           Summary: Linux kernel build error due to non-static
                    initializers
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sasha.levin at oracle dot com

Hi all,

I'm seeing a new build issue with the linux kernel:

  CC      kernel/smpboot.o
In file included from include/linux/mutex.h:15:0,
                 from include/linux/kernfs.h:13,
                 from include/linux/sysfs.h:15,
                 from include/linux/kobject.h:21,
                 from include/linux/device.h:17,
                 from include/linux/node.h:17,
                 from include/linux/cpu.h:16,
                 from kernel/smpboot.c:4:
include/linux/spinlock_types.h:82:2: error: initializer element is not constant
  (spinlock_t ) __SPIN_LOCK_INITIALIZER(lockname)
  ^
include/linux/mutex.h:112:18: note: in expansion of macro
‘__SPIN_LOCK_UNLOCKED’
   , .wait_lock = __SPIN_LOCK_UNLOCKED(lockname.wait_lock) \
                  ^
include/linux/mutex.h:118:27: note: in expansion of macro ‘__MUTEX_INITIALIZER’
  struct mutex mutexname = __MUTEX_INITIALIZER(mutexname)
                           ^
kernel/smpboot.c:80:8: note: in expansion of macro ‘DEFINE_MUTEX’
 static DEFINE_MUTEX(smpboot_threads_lock);
        ^
include/linux/spinlock_types.h:82:2: note: (near initialization for
‘smpboot_threads_lock.wait_lock’)
  (spinlock_t ) __SPIN_LOCK_INITIALIZER(lockname)
  ^
include/linux/mutex.h:112:18: note: in expansion of macro
‘__SPIN_LOCK_UNLOCKED’
   , .wait_lock = __SPIN_LOCK_UNLOCKED(lockname.wait_lock) \
                  ^
include/linux/mutex.h:118:27: note: in expansion of macro ‘__MUTEX_INITIALIZER’
  struct mutex mutexname = __MUTEX_INITIALIZER(mutexname)
                           ^
kernel/smpboot.c:80:8: note: in expansion of macro ‘DEFINE_MUTEX’
 static DEFINE_MUTEX(smpboot_threads_lock);
        ^
make[1]: *** [kernel/smpboot.o] Error 1
make: *** [kernel/smpboot.o] Error 2


This was bisected down to:

commit b2601928b5bf34a817b5a9a2a371c476018e634d
Author: mpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Wed Oct 15 10:08:00 2014 +0000

        * doc/invoke.texi: Update to reflect that GNU11 is the default
        mode for C.
        * c-common.h (c_language_kind): Update comment.
    c-family/
        * c-opts.c (c_common_init_options): Make -std=gnu11 the default for C.


    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@216247
138bc75d-0d04-0410-961f-82ee72b054a4
>From gcc-bugs-return-464297-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Oct 16 22:49:46 2014
Return-Path: <gcc-bugs-return-464297-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 11447 invoked by alias); 16 Oct 2014 22:49:46 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 11418 invoked by uid 48); 16 Oct 2014 22:49:42 -0000
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/63567] Linux kernel build error due to non-static initializers
Date: Thu, 16 Oct 2014 22:49:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: pinskia at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on everconfirmed
Message-ID: <bug-63567-4-eQ6hK6B58S@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-63567-4@http.gcc.gnu.org/bugzilla/>
References: <bug-63567-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-10/txt/msg01318.txt.bz2
Content-length: 833

https://gcc.gnu.org/bugzilla/show_bug.cgi?idc567

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-10-16
     Ever confirmed|0                           |1

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I Just reported this to the mailing list:
https://gcc.gnu.org/ml/gcc-patches/2014-10/msg01640.html

The reduced testcase that shows the difference between GNU 89 and GNU 11/99:
typedef struct {
 volatile unsigned int lock;
} arch_rwlock_t;
typedef struct {
 arch_rwlock_t raw_lock;
} rwlock_t;

static rwlock_t step_hook_lock = (rwlock_t) { .raw_lock = { 0 }, };


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-10-19 16:50 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-16 22:46 [Bug c/63567] New: Linux kernel build error due to non-static initializers sasha.levin at oracle dot com
2014-10-17  5:33 ` [Bug c/63567] " mpolacek at gcc dot gnu.org
2014-10-17  5:38 ` mpolacek at gcc dot gnu.org
2014-10-17 21:03 ` mpolacek at gcc dot gnu.org
2014-10-17 21:04 ` mpolacek at gcc dot gnu.org
2014-10-18  5:26 ` sasha.levin at oracle dot com
2014-10-18 17:53 ` sasha.levin at oracle dot com
2014-10-18 17:53 ` sasha.levin at oracle dot com
2014-10-18 18:30 ` mpolacek at gcc dot gnu.org
2014-10-19  4:17 ` sasha.levin at oracle dot com
2014-10-19 16:50 ` mpolacek at gcc dot gnu.org
2014-10-19 18:27 ` mpolacek at gcc dot gnu.org

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 read-only IMAP folder(s) and NNTP newsgroup(s).