Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751171AbbDRFrN (ORCPT ); Sat, 18 Apr 2015 01:47:13 -0400 Received: from bh-25.webhostbox.net ([208.91.199.152]:34852 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750864AbbDRFrJ (ORCPT ); Sat, 18 Apr 2015 01:47:09 -0400 Date: Fri, 17 Apr 2015 22:47:05 -0700 From: Guenter Roeck To: linux-kernel@vger.kernel.org Cc: Sowmini Varadhan , "David S. Miller" , sparclinux@vger.kernel.org Subject: sparc64: Build failure due to commit f1600e549b94 (sparc: Make sparc64 use scalable lib/iommu-common.c functions) Message-ID: <20150418054705.GA10746@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-CTCH-PVer: 0000001 X-CTCH-Spam: Unknown X-CTCH-VOD: Unknown X-CTCH-Flags: 0 X-CTCH-RefID: str=0001.0A020205.5531EFDC.0143,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 X-CTCH-Score: 0.000 X-CTCH-ScoreCust: 0.000 X-CTCH-Rules: X-CTCH-SenderID: linux@roeck-us.net X-CTCH-SenderID-Flags: 0 X-CTCH-SenderID-TotalMessages: 1 X-CTCH-SenderID-TotalSpam: 0 X-CTCH-SenderID-TotalSuspected: 0 X-CTCH-SenderID-TotalConfirmed: 0 X-CTCH-SenderID-TotalBulk: 0 X-CTCH-SenderID-TotalVirus: 0 X-CTCH-SenderID-TotalRecipients: 0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: mailgid no entry from get_relayhosts_entry X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1955 Lines: 46 Hi all, I see the following build failure when compiling sparc64:allmodconfig in the upstream kernel (v4.0-7820-g04b7fe6a4a23). arch/sparc/kernel/pci_sun4v.o:(.discard+0x1): multiple definition of `__pcpu_unique_iommu_pool_hash' arch/sparc/kernel/iommu.o:(.discard+0x0): first defined here make[2]: *** [arch/sparc/kernel/built-in.o] Error 1 make[1]: *** [arch/sparc/kernel] Error 2 The problem is caused by commit f1600e549b94 ("sparc: Make sparc64 use scalable lib/iommu-common.c functions"), which introduces static DEFINE_PER_CPU(unsigned int, iommu_pool_hash); in both files. DEFINE_PER_CPU translates to DEFINE_PER_CPU_SECTION, which in turn is defined as #define DEFINE_PER_CPU_SECTION(type, name, sec) \ __PCPU_DUMMY_ATTRS char __pcpu_scope_##name; \ extern __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \ --> __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \ extern __PCPU_ATTRS(sec) __typeof__(type) name; \ __PCPU_ATTRS(sec) PER_CPU_DEF_ATTRIBUTES __weak \ __typeof__(type) name if CONFIG_DEBUG_FORCE_WEAK_PER_CPU is configured, which is the case here. The marked line above shows that __pcpu_unique_iommu_pool_hash is declared as global variable, which explains the problem (and makes me wonder what the 'static' keyword in front of DEFINE_PER_CPU is supposed to accomplish). I thought about fixing the problem by renaming one of the variables, but I am not sure if that is what is intended. Specifically, I am not sure if the variables are supposed to be different, as it looks like, or if they are supposed to be the same. In case it is relevant, I use gcc version 4.6.3 for my build test. Guenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/