All of lore.kernel.org
 help / color / mirror / Atom feed
From: nicolas.pitre@linaro.org (Nicolas Pitre)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: asm/unified.h: guard the IT macros against redefinition when using LTO
Date: Fri, 24 Jul 2015 17:42:15 -0400 (EDT)	[thread overview]
Message-ID: <alpine.LFD.2.20.1507241739280.1806@knanqh.ubzr> (raw)


With LTO, the intermediate representation for each .c file contains those
global assembly macro definitions. When the lot is merged together during
the final link, we get duplicate definition errors:

[...]
/tmp/cc48fUMp.s:42352: Error: Macro `it' was already defined
/tmp/cc48fUMp.s:42354: Error: Macro `itt' was already defined
/tmp/cc48fUMp.s:42356: Error: Macro `ite' was already defined
[...]

Guard those against redefinitions.

Signed-off-by: Nicolas Pitre <nico@linaro.org>

diff --git a/arch/arm/include/asm/unified.h b/arch/arm/include/asm/unified.h
index a91ae49961..ee257a3de7 100644
--- a/arch/arm/include/asm/unified.h
+++ b/arch/arm/include/asm/unified.h
@@ -103,6 +103,8 @@
 	.endm
 #else	/* !__ASSEMBLY__ */
 __asm__(
+/* the .L_it_macros_defined guards against redefinition in the LTO case */
+"	.ifndef	.L_it_macros_defined\n"
 "	.macro	it, cond\n"
 "	.endm\n"
 "	.macro	itt, cond\n"
@@ -132,7 +134,9 @@ __asm__(
 "	.macro	iteet, cond\n"
 "	.endm\n"
 "	.macro	iteee, cond\n"
-"	.endm\n");
+"	.endm\n"
+"	.set	.L_it_macros_defined,1\n"
+"	.endif");
 #endif	/* __ASSEMBLY__ */
 
 #endif	/* CONFIG_ARM_ASM_UNIFIED */

             reply	other threads:[~2015-07-24 21:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-24 21:42 Nicolas Pitre [this message]
2015-07-27 11:16 ` [PATCH] ARM: asm/unified.h: guard the IT macros against redefinition when using LTO Dave Martin
2015-07-27 11:21   ` Russell King - ARM Linux

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=alpine.LFD.2.20.1507241739280.1806@knanqh.ubzr \
    --to=nicolas.pitre@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.