Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1329116 > unrolled thread
| Started by | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| First post | 2016-02-08 15:40 +0100 |
| Last post | 2016-02-08 19:20 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] Kbuild: provide a __UNIQUE_ID for clang Arnd Bergmann <arnd@arndb.de> - 2016-02-08 15:40 +0100
Re: [PATCH] Kbuild: provide a __UNIQUE_ID for clang Michal Marek <mmarek@suse.cz> - 2016-02-08 19:20 +0100
| From | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| Date | 2016-02-08 15:40 +0100 |
| Subject | [PATCH] Kbuild: provide a __UNIQUE_ID for clang |
| Message-ID | <qZV8S-6zW-21@gated-at.bofh.it> |
The default __UNIQUE_ID macro in compiler.h fails to work for some drivers:
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:615:1: error: redefinition of
'__UNIQUE_ID_firmware615'
BRCMF_FW_NVRAM_DEF(4354, "brcmfmac4354-sdio.bin", "brcmfmac4354-sdio.txt");
This adds a copy of the version we use for gcc-4.3 and higher, as the same
one works with all versions of clang that I could find in svn (2.6 and higher).
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
include/linux/compiler-clang.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h
index d1e49d52b640..de179993e039 100644
--- a/include/linux/compiler-clang.h
+++ b/include/linux/compiler-clang.h
@@ -10,3 +10,8 @@
#undef uninitialized_var
#define uninitialized_var(x) x = *(&(x))
#endif
+
+/* same as gcc, this was present in clang-2.6 so we can assume it works
+ * with any version that can compile the kernel
+ */
+#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
--
2.7.0
[toc] | [next] | [standalone]
| From | Michal Marek <mmarek@suse.cz> |
|---|---|
| Date | 2016-02-08 19:20 +0100 |
| Message-ID | <qZYzM-v9-7@gated-at.bofh.it> |
| In reply to | #1329116 |
On Mon, Feb 08, 2016 at 03:38:32PM +0100, Arnd Bergmann wrote: > The default __UNIQUE_ID macro in compiler.h fails to work for some drivers: > > drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:615:1: error: redefinition of > '__UNIQUE_ID_firmware615' > BRCMF_FW_NVRAM_DEF(4354, "brcmfmac4354-sdio.bin", "brcmfmac4354-sdio.txt"); I applied the patch to kbuild.git#kbuild, but can you tell me with which commit and config you get such failure. I only see a single MODULE_FIRMWARE() call in the expansion of BRCMF_FW_NVRAM_DEF(), which should work with line numbers as well. And I can't reproduce it with today's linux-next. If there is some issue with code not yet in linux-next, it needs to be worked around, because older GCCs did not have __COUNTER__. Michal
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web