* [PATCH] __used is needed for function referenced only from inline asm
@ 2008-11-24 8:17 Török Edwin
2008-11-24 8:57 ` Geert Uytterhoeven
2008-11-24 9:04 ` Ingo Molnar
0 siblings, 2 replies; 7+ messages in thread
From: Török Edwin @ 2008-11-24 8:17 UTC (permalink / raw)
To: Ingo Molnar
Cc: Arjan van de Ven, Thomas Gleixner, Steven Rostedt, David Howells,
linux-kernel, Török Edwin
According to the gcc manual, the 'used' attribute should be applied to
functions referenced only from inline assembly.
This fixes a build failure with llvm-gcc-4.2, which deleted
__mutex_lock_slowpath, __mutex_unlock_slowpath.
Signed-off-by: Török Edwin <edwintorok@gmail.com>
---
kernel/mutex.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/kernel/mutex.c b/kernel/mutex.c
index 39a3816..4f45d4b 100644
--- a/kernel/mutex.c
+++ b/kernel/mutex.c
@@ -59,7 +59,7 @@ EXPORT_SYMBOL(__mutex_init);
* We also put the fastpath first in the kernel image, to make sure the
* branch is predicted by the CPU as default-untaken.
*/
-static void noinline __sched
+static __used noinline void __sched
__mutex_lock_slowpath(atomic_t *lock_count);
/***
@@ -96,7 +96,7 @@ void inline __sched mutex_lock(struct mutex *lock)
EXPORT_SYMBOL(mutex_lock);
#endif
-static noinline void __sched __mutex_unlock_slowpath(atomic_t *lock_count);
+static __used noinline void __sched __mutex_unlock_slowpath(atomic_t *lock_count);
/***
* mutex_unlock - release the mutex
@@ -268,7 +268,7 @@ __mutex_unlock_common_slowpath(atomic_t *lock_count, int nested)
/*
* Release the lock, slowpath:
*/
-static noinline void
+static __used noinline void
__mutex_unlock_slowpath(atomic_t *lock_count)
{
__mutex_unlock_common_slowpath(lock_count, 1);
@@ -313,7 +313,7 @@ int __sched mutex_lock_killable(struct mutex *lock)
}
EXPORT_SYMBOL(mutex_lock_killable);
-static noinline void __sched
+static __used noinline void __sched
__mutex_lock_slowpath(atomic_t *lock_count)
{
struct mutex *lock = container_of(lock_count, struct mutex, count);
--
1.5.6.5
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH] __used is needed for function referenced only from inline asm
2008-11-24 8:17 [PATCH] __used is needed for function referenced only from inline asm Török Edwin
@ 2008-11-24 8:57 ` Geert Uytterhoeven
2008-11-24 9:22 ` Andi Kleen
2008-11-24 9:04 ` Ingo Molnar
1 sibling, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2008-11-24 8:57 UTC (permalink / raw)
To: Török Edwin
Cc: Ingo Molnar, Arjan van de Ven, Thomas Gleixner, Steven Rostedt,
David Howells, linux-kernel
On Mon, 24 Nov 2008, Török Edwin wrote:
> According to the gcc manual, the 'used' attribute should be applied to
> functions referenced only from inline assembly.
> This fixes a build failure with llvm-gcc-4.2, which deleted
> __mutex_lock_slowpath, __mutex_unlock_slowpath.
>
> Signed-off-by: Török Edwin <edwintorok@gmail.com>
> ---
> kernel/mutex.c | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/kernel/mutex.c b/kernel/mutex.c
> index 39a3816..4f45d4b 100644
> --- a/kernel/mutex.c
> +++ b/kernel/mutex.c
> @@ -59,7 +59,7 @@ EXPORT_SYMBOL(__mutex_init);
> * We also put the fastpath first in the kernel image, to make sure the
> * branch is predicted by the CPU as default-untaken.
> */
> -static void noinline __sched
> +static __used noinline void __sched
Perhaps we should incorporate it into `noinline'?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] __used is needed for function referenced only from inline asm
2008-11-24 8:57 ` Geert Uytterhoeven
@ 2008-11-24 9:22 ` Andi Kleen
2008-11-24 9:32 ` Andreas Schwab
0 siblings, 1 reply; 7+ messages in thread
From: Andi Kleen @ 2008-11-24 9:22 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Török Edwin, Ingo Molnar, Arjan van de Ven,
Thomas Gleixner, Steven Rostedt, David Howells, linux-kernel
Geert Uytterhoeven <geert@linux-m68k.org> writes:
>> */
>> -static void noinline __sched
>> +static __used noinline void __sched
>
> Perhaps we should incorporate it into `noinline'?
No, we use noinline for other reasons too. Perhaps the other way
around though.
-Andi
--
ak@linux.intel.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] __used is needed for function referenced only from inline asm
2008-11-24 9:22 ` Andi Kleen
@ 2008-11-24 9:32 ` Andreas Schwab
2008-11-24 9:53 ` Andi Kleen
0 siblings, 1 reply; 7+ messages in thread
From: Andreas Schwab @ 2008-11-24 9:32 UTC (permalink / raw)
To: Andi Kleen
Cc: Geert Uytterhoeven, Török Edwin, Ingo Molnar,
Arjan van de Ven, Thomas Gleixner, Steven Rostedt, David Howells,
linux-kernel
Andi Kleen <andi@firstfloor.org> writes:
> Geert Uytterhoeven <geert@linux-m68k.org> writes:
>>> */
>>> -static void noinline __sched
>>> +static __used noinline void __sched
>>
>> Perhaps we should incorporate it into `noinline'?
>
> No, we use noinline for other reasons too. Perhaps the other way
> around though.
Or just drop noinline here (since there are no callers to inline into
anyway).
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] __used is needed for function referenced only from inline asm
2008-11-24 9:32 ` Andreas Schwab
@ 2008-11-24 9:53 ` Andi Kleen
0 siblings, 0 replies; 7+ messages in thread
From: Andi Kleen @ 2008-11-24 9:53 UTC (permalink / raw)
To: Andreas Schwab
Cc: Andi Kleen, Geert Uytterhoeven, Török Edwin,
Ingo Molnar, Arjan van de Ven, Thomas Gleixner, Steven Rostedt,
David Howells, linux-kernel
On Mon, Nov 24, 2008 at 10:32:54AM +0100, Andreas Schwab wrote:
> Andi Kleen <andi@firstfloor.org> writes:
>
> > Geert Uytterhoeven <geert@linux-m68k.org> writes:
> >>> */
> >>> -static void noinline __sched
> >>> +static __used noinline void __sched
> >>
> >> Perhaps we should incorporate it into `noinline'?
> >
> > No, we use noinline for other reasons too. Perhaps the other way
> > around though.
>
> Or just drop noinline here (since there are no callers to inline into
> anyway).
That would seem fragile to me because it could hit later again when
someone changes the code or adds debugging code. Better always
have full annotations, even if you don't need them all at the moment.
-Andi
--
ak@linux.intel.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] __used is needed for function referenced only from inline asm
2008-11-24 8:17 [PATCH] __used is needed for function referenced only from inline asm Török Edwin
2008-11-24 8:57 ` Geert Uytterhoeven
@ 2008-11-24 9:04 ` Ingo Molnar
2008-11-24 9:50 ` Török Edwin
1 sibling, 1 reply; 7+ messages in thread
From: Ingo Molnar @ 2008-11-24 9:04 UTC (permalink / raw)
To: Török Edwin
Cc: Arjan van de Ven, Thomas Gleixner, Steven Rostedt, David Howells,
linux-kernel
* Török Edwin <edwintorok@gmail.com> wrote:
> According to the gcc manual, the 'used' attribute should be applied to
> functions referenced only from inline assembly.
> This fixes a build failure with llvm-gcc-4.2, which deleted
> __mutex_lock_slowpath, __mutex_unlock_slowpath.
>
> Signed-off-by: Török Edwin <edwintorok@gmail.com>
> ---
> kernel/mutex.c | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
quite sad - it's gcc inline assembly after all - applied to
tip/core/locking (for v2.6.29). Should this get into v2.6.28 too?
Ingo
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] __used is needed for function referenced only from inline asm
2008-11-24 9:04 ` Ingo Molnar
@ 2008-11-24 9:50 ` Török Edwin
0 siblings, 0 replies; 7+ messages in thread
From: Török Edwin @ 2008-11-24 9:50 UTC (permalink / raw)
To: Ingo Molnar
Cc: Arjan van de Ven, Thomas Gleixner, Steven Rostedt, David Howells,
linux-kernel
On 2008-11-24 11:04, Ingo Molnar wrote:
> * Török Edwin <edwintorok@gmail.com> wrote:
>
>
>> According to the gcc manual, the 'used' attribute should be applied to
>> functions referenced only from inline assembly.
>> This fixes a build failure with llvm-gcc-4.2, which deleted
>> __mutex_lock_slowpath, __mutex_unlock_slowpath.
>>
>> Signed-off-by: Török Edwin <edwintorok@gmail.com>
>> ---
>> kernel/mutex.c | 8 ++++----
>> 1 files changed, 4 insertions(+), 4 deletions(-)
>>
>
> quite sad - it's gcc inline assembly after all - applied to
> tip/core/locking (for v2.6.29).
Thanks.
> Should this get into v2.6.28 too?
>
It is up to you to decide. I'd say it can't hurt to have it in 2.6.28,
and patch looks trivial enough.
On the other hand it is not urgent either, building a full x86 kernel
with llvm-gcc only still has some loose ends
(there is something wrong with the boot code for example, like it can't
detect vga modes, I didn't figure out what is wrong yet)
Best regards,
--Edwin
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2008-11-24 9:51 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-24 8:17 [PATCH] __used is needed for function referenced only from inline asm Török Edwin
2008-11-24 8:57 ` Geert Uytterhoeven
2008-11-24 9:22 ` Andi Kleen
2008-11-24 9:32 ` Andreas Schwab
2008-11-24 9:53 ` Andi Kleen
2008-11-24 9:04 ` Ingo Molnar
2008-11-24 9:50 ` Török Edwin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox