Ryan Mansfield(deleted)
|
Re: gcc 4.2.1 tests - fails to compile lib/kdutil/ppc/cpu_map.c
|
Ryan Mansfield(deleted)
11/05/2007 3:42 PM
post2466
|
Re: gcc 4.2.1 tests - fails to compile lib/kdutil/ppc/cpu_map.c
> So, the compiler generates opcodes that the assembler doesn't recognize?
> Seems like it's confusing different ppc variants or something.
If you trace the code, the assembly comes from inline assembly in ppc/inline.h not the compiler.
> I'm just not sure who to post the PR to - OS team or Tools, or what terms to
> search to see if it is a known problem.
The problem is with both the tools and the code. The inline.h assumes a non-standard builtin assembler macro which is
qnx specific. The new versions of the binutils do not recognize it. I will re-add support for the macro for backwards
compatibility , but it would be nice if we could migrate to the standard ppc gas .machine pseudo-op.
If you apply the following diff to your $QNX_TARGET/usr/include/ppc/inline.h, you should be able to compile lib/kdutil
with the current gcc 4.2.1 toolchain.
ryan@ryan:~/svn/product/trunk/lib/c/public/ppc$ svn diff
Index: inline.h
===================================================================
--- inline.h (revision 157495)
+++ inline.h (working copy)
@@ -63,6 +63,8 @@
__asm__ __volatile__( \
".ifdef PPC_CPUOP_ENABLED;" \
".cpu 403;" \
+ ".else;" \
+ ".machine \"403\";" \
".endif;" \
"mfdcr %0,%1" \
: "=r" (__val) : "i" (dcr) ); \
@@ -71,6 +73,8 @@
__asm__ __volatile__( \
".ifdef PPC_CPUOP_ENABLED;" \
".cpu 403;" \
+ ".else;" \
+ ".machine \"403\";" \
".endif;" \
"mtdcr %0,%1" \
: : "i" (dcr), "r" (val) )
@@ -91,12 +95,16 @@
__asm__ __volatile__( \
".ifdef PPC_CPUOP_ENABLED;" \
".cpu ppc64;" \
+ ".else;" \
+ ".machine \"ppc64\";" \
".endif;" \
"lwsync")
#define ppc_ptesync() \
__asm__ __volatile__( \
".ifdef PPC_CPUOP_ENABLED;" \
".cpu ppc64;" \
+ ".else;" \
+ ".machine \"ppc64\";" \
".endif;" \
"ptesync")
@@ -116,6 +124,8 @@
__asm__ __volatile__( \
".ifdef PPC_CPUOP_ENABLED;" \
".cpu ppc64;" \
+ ".else;" \
+ ".machine \"ppc64\";" \
".endif;" \
"mfmsr %2;" \
"rlwinm %3,%2,0,17,15;" \
@@ -133,6 +143,8 @@
__asm__ __volatile__( \
".ifdef PPC_CPUOP_ENABLED;" ...
View Full Message
|
|
|