public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
To: David Miller <davem@davemloft.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: sparc64: Optimized immediate value implementation build error
Date: Tue, 14 Oct 2008 00:47:58 -0400	[thread overview]
Message-ID: <20081014044758.GA20420@Krystal> (raw)
In-Reply-To: <20081013.193117.38855645.davem@davemloft.net>

* David Miller (davem@davemloft.net) wrote:
> From: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
> Date: Mon, 13 Oct 2008 22:17:04 -0400
> 
> > * David Miller (davem@davemloft.net) wrote:
> > > From: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
> > > Date: Mon, 13 Oct 2008 19:37:53 -0400
> > > 
> > > > * David Miller (davem@davemloft.net) wrote:
> > > > > From: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
> > > > > Date: Fri, 3 Oct 2008 16:10:07 -0400
> > > > > 
> > > > > > I ran a cross-compiler on the -lttng tree
> > > > > > git://git.kernel.org/pub/scm/linux/kernel/git/compudj/linux-2.6-lttng.git
> > > > > > 
> > > > > > to build the sparc64 arch, and ran across this build error :
> > > > > > 
> > > > > > /home/compudj/git/morestable/linux-2.6-lttng/include/trace/sched.h: In function `do_fork':
> > > > > > /home/compudj/git/morestable/linux-2.6-lttng/include/trace/sched.h:38: warning: asm operand 1 probably doesn't match constraints
> > > > > > /home/compudj/git/morestable/linux-2.6-lttng/include/trace/sched.h:38: error: impossible constraint in `asm'
> > > > > > /home/compudj/git/morestable/linux-2.6-lttng/include/trace/sched.h:38: warning: 'value' might be used uninitialized in this function
> > > > > > make[2]: *** [kernel/fork.o] Error 1
> > > > > > 
> > > > > > I think it's caused by :
> > > > > > http://git.kernel.org/?p=linux/kernel/git/compudj/linux-2.6-lttng.git;a=commit;h=c76bfa90a6eb02651368a152b3646aa672d9e625
> > > > > 
> > > > > It can't be "caused by" that commit because that's the initial
> > > > > immediate value sparc64 support I wrote and the tree very much compiled
> > > > > properly when I did test builds way back then.
> > > > > 
> > > > > I don't have time to look further into this right now, sorry.
> > > > 
> > > > Ok, I'll dig into this. I use gcc 3.4.5, that could be my problem; it's
> > > > broken on x86_64. I'll do some testing in this direction. Also, I see
> > > > that you have used .uaword and declared "int" in your sparc64
> > > > implementation to encode pointers. Am I missing something or should it
> > > > be "long" and either .word or .xword (32 or 64 bits) ?
> > > 
> > > long would be for ".uaxword", ".uaword" is 32-bit.  It means
> > > "UnAligned WORD"
> > > 
> > 
> > Ok, it's fixed.
> 
> How? :-)
> 

The int -> long uses commit 
http://git.kernel.org/?p=linux/kernel/git/compudj/linux-2.6-lttng.git;a=commitdiff;h=3940305f7248f269ae330982bcd6d51d5c55c2f4

Which adds a sparc asm.h to abstract the 32/64 bits "pointer" type at
the assembler level. It's inspired from x86 32/64 :

diff --git a/arch/sparc/include/asm/asm.h b/arch/sparc/include/asm/asm.h
new file mode 100644 (file)
index 0000000..2be3d10
--- /dev/null
+++ b/arch/sparc/include/asm/asm.h
@@ -0,0 +1,19 @@
+#ifndef _ASM_SPARC_ASM_H
+#define _ASM_SPARC_ASM_H
+
+#ifdef __ASSEMBLY__
+# define __ASM_FORM(x) x
+#else
+# define __ASM_FORM(x) " " #x " "
+#endif
+
+#ifdef CONFIG_SPARC32
+# define __ASM_SEL(a,b)        __ASM_FORM(a)
+#else
+# define __ASM_SEL(a,b)        __ASM_FORM(b)
+#endif
+
+#define _ASM_PTR       __ASM_SEL(.word, .xword)
+#define _ASM_UAPTR     __ASM_SEL(.uaword, .uaxword)
+
+#endif /* _ASM_SPARC_ASM_H */

I also check for the compiler version to only enable immediate values if
gcc is >= 4.0.0. I suspect that sparc64 gcc has similar issues x86_64
gcc 3.x has with base+offset addresses and "i" inline asm constraint.

This is done in commit :
http://git.kernel.org/?p=linux/kernel/git/compudj/linux-2.6-lttng.git;a=commit;h=3c1106cf88f849a381c0bc01ccb185a3911e6a51

But my cross-compiler for sparc64 is only gcc 3.4.5 and I did not
succeed to find the right versions of gcc/glibc and binutils working
together to cross-build with a gcc >= 4.0.0 on x86_64. So some testing
is welcome.

> > If someone has access to a sparc64 gcc >= 4.0.0 compiler (native or
> > cross) and some spare cycles, if would be interesting to build test this
> > with CONFIG_IMMEDIATE=y and with CONFIG_TRACEPOINTS=y and
> > CONFIG_MARKERS=y :
> > 
> > git://git.kernel.org/pub/scm/linux/kernel/git/compudj/linux-2.6-lttng.git
> > branch : 2.6.27-lttng-0.40
> 
> I just checked out 0.39 and was building it to try and reproduce your failure.
> I'll pull in 0.40 next.

I'm looking forward to hear about the results. Thanks !

Mathieu


-- 
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68

  reply	other threads:[~2008-10-14  4:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-03 20:10 sparc64: Optimized immediate value implementation build error Mathieu Desnoyers
2008-10-13  8:15 ` David Miller
2008-10-13 23:37   ` Mathieu Desnoyers
2008-10-14  1:31     ` David Miller
2008-10-14  2:17       ` Mathieu Desnoyers
2008-10-14  2:31         ` David Miller
2008-10-14  4:47           ` Mathieu Desnoyers [this message]
2008-10-14  9:15             ` David Miller
2008-10-14 16:08               ` Mathieu Desnoyers
2008-10-14 19:02                 ` David Miller

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=20081014044758.GA20420@Krystal \
    --to=mathieu.desnoyers@polymtl.ca \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.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