From: Wu Zhangjin <wuzhangjin@gmail.com>
To: linux-mips@linux-mips.org
Cc: Ralf Baechle <ralf@linux-mips.org>
Subject: Error: symbol `__pastwait' is already defined
Date: Sat, 13 Jun 2009 15:58:42 +0800 [thread overview]
Message-ID: <1244879922.24479.30.camel@falcon> (raw)
Hi,
there is a guy reported a compiling problem in linux-2.6.29:
[...]
CC arch/mips/kernel/cpu-probe.o
{standard input}: Assembler messages:
{standard input}:3939: Error: symbol `__pastwait' is already defined
make[1]: *** [arch/mips/kernel/cpu-probe.o] Error 1
make: *** [arch/mips/kernel] Error 2
Seems I met this problem before, perhaps here is the reason:
arch/mips/kernel/cpu-probe.c:
void r4k_wait_irqoff(void)
{
local_irq_disable();
if (!need_resched())
__asm__(" .set push \n"
" .set mips3 \n"
" wait \n"
" .set pop \n");
local_irq_enable();
__asm__(" .globl __pastwait \n"
"__pastwait: \n");
return;
}
there is a global symbol __pastwait defined at the end of
r4k_wait_irqoff, if r4k_wait_irqoff is called more than one time, the
__pastwait will be multi-defined. so, need to be fixed. does this fix
it?
arch/mips/kernel/cpu-probe.c:
void r4k_wait_irqoff(void)
{
local_irq_disable();
if (!need_resched())
__asm__(" .set push \n"
" .set mips3 \n"
" wait \n"
" .set pop \n");
local_irq_enable();
return;
}
/* a dumy funciton for marking the end of r4k_wait_irqoff */
void __pastwait(void)
{
;
}
but I am not sure the gcc compiler will tune the position of the
r4k_wait_irqoff and __pastwait or not, so seems not safe. perhaps we
should change something else instead.
perhaps we should tune the __pastwait solution directly, just spark it,
not look into it yet, seems __pastwait is only used here:
arch/mips/kernel/smtc.c:
smtc_send_ipi:
if (cpu_wait == r4k_wait_irqoff) {
tcrestart = read_tc_c0_tcrestart();
if (tcrestart >= (unsigned long)r4k_wait_irqoff
&& tcrestart < (unsigned long)__pastwait) {
write_tc_c0_tcrestart(__pastwait);
tcstatus &= ~TCSTATUS_IXMT;
write_tc_c0_tcstatus(tcstatus);
goto postdirect;
}
}
best wishes,
Wu Zhangjin
next reply other threads:[~2009-06-13 7:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-13 7:58 Wu Zhangjin [this message]
2009-06-13 16:25 ` Error: symbol `__pastwait' is already defined Kevin D. Kissell
2009-06-14 9:12 ` Ralf Baechle
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=1244879922.24479.30.camel@falcon \
--to=wuzhangjin@gmail.com \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox