* Problems Compileing PVM @ 2000-05-06 22:14 ian reinhart geiser 2000-05-07 9:05 ` Andreas Tobler 2000-05-07 14:37 ` Michael Schmitz 0 siblings, 2 replies; 6+ messages in thread From: ian reinhart geiser @ 2000-05-06 22:14 UTC (permalink / raw) To: linuxppc-dev Greetings, I have a problem with compileing PVMd on my LinuxPPC 1999 dist. When i try to build anything liked off of the PVM libs i get the following errors: ../../lib/LINUXPPC/libpvm3.a(lpvmpack.o): In function `pvm_vpackf': lpvmpack.o(.text+0x53e8): undefined reference to `__va_arg_type_violation' lpvmpack.o(.text+0x53e8): relocation truncated to fit: R_PPC_REL24 __va_arg_type_violation lpvmpack.o(.text+0x54f4): undefined reference to `__va_arg_type_violation' lpvmpack.o(.text+0x54f4): relocation truncated to fit: R_PPC_REL24 __va_arg_type_violation It looks like a linker error... i have never had this error before on any of my other systems(ARM, ALPHA and INTEL). has anyone seen this? or am i looking in the wrong list? thanks -ian reinhart geiser ------------------------------------------------- Ian Reinhart Geiser <geiseri@msoe.edu> DEC Unix Systems Adimistrator and Computer Engineering Student http://www.msoe.edu/~geiseri/finger.phtml ** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/ ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Problems Compileing PVM 2000-05-06 22:14 Problems Compileing PVM ian reinhart geiser @ 2000-05-07 9:05 ` Andreas Tobler 2000-05-07 14:37 ` Michael Schmitz 1 sibling, 0 replies; 6+ messages in thread From: Andreas Tobler @ 2000-05-07 9:05 UTC (permalink / raw) To: ian reinhart geiser; +Cc: linuxppc-dev ian reinhart geiser wrote: > > Greetings, > I have a problem with compileing PVMd > on my LinuxPPC 1999 dist. > > When i try to build anything liked off of the > PVM libs i get the following errors: > > ../../lib/LINUXPPC/libpvm3.a(lpvmpack.o): In function > `pvm_vpackf': lpvmpack.o(.text+0x53e8): undefined reference to > `__va_arg_type_violation' > lpvmpack.o(.text+0x53e8): relocation truncated > to fit: R_PPC_REL24 __va_arg_type_violation > lpvmpack.o(.text+0x54f4): > undefined reference to `__va_arg_type_violation' > lpvmpack.o(.text+0x54f4): relocation truncated to fit: R_PPC_REL24 > __va_arg_type_violation > > It looks like a linker error... > i have never had this error before on any > of my other systems(ARM, ALPHA and INTEL). > > has anyone seen this? or am i looking in the > wrong list? Have a look in the function pvm_vpackf. I suppose there is something like this: va_arg(xyz,int) and in your case I suppose the int isn't int, it's something else?! e.g. when you have this va_arg(xyz,char), this would give the error described above. You can only get the function as wanted when you do (char)va_arg(xyz,int). For further details search the dev-list. Andreas ** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/ ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Problems Compileing PVM 2000-05-06 22:14 Problems Compileing PVM ian reinhart geiser 2000-05-07 9:05 ` Andreas Tobler @ 2000-05-07 14:37 ` Michael Schmitz 2000-05-07 18:28 ` Kevin Hendricks 1 sibling, 1 reply; 6+ messages in thread From: Michael Schmitz @ 2000-05-07 14:37 UTC (permalink / raw) To: ian reinhart geiser; +Cc: linuxppc-dev > __va_arg_type_violation > > It looks like a linker error... No, it rather is a varargs usage error (illegal types used in va_arg() calls). Sloppy programming is the cause of this, most likely. If it makes you feel better: the error message goes away if you compile without optimization. Doesn't mean the code will run, then. Michael ** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/ ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Problems Compileing PVM 2000-05-07 14:37 ` Michael Schmitz @ 2000-05-07 18:28 ` Kevin Hendricks 2000-05-08 9:35 ` Michael Schmitz 0 siblings, 1 reply; 6+ messages in thread From: Kevin Hendricks @ 2000-05-07 18:28 UTC (permalink / raw) To: Michael Schmitz, ian reinhart geiser; +Cc: linuxppc-dev Hi, On Sun, 07 May 2000, Michael Schmitz wrote: > > __va_arg_type_violation Franz once explained this error to me. It seems according to the ANSI C standard va_arg can only be done with primary (promoted) types like integer, double, etc. For any other type, a cast must be done to create proper ansi c. gcc is going to barf on this on all platforms in the future, but right now it does so only under optimization on ppc. The solution is just to edit and code and make the correction(s). Here are some code snippets to illustrate: va_arg(args,boolean) becomes (boolean)va_arg(args, int) va_arg(args,byte) becomes (byte)va_arg(args, int) va_arg(args,char) becomes (char)va_arg(args, int) va_arg(ags,short) becomes (short)va_arg(args, int) va_arg(args,int) is okay since it is a primary (promoted) type va_arg(args, long long) is okay since long long is a primary (promoted) type va_arg(args,float) becomes (float)va_arg(args, double) va_arg(args,double) is okay since it is a primary (promoted) type I hope this helps. Kevin On Sun, 07 May 2000, Michael Schmitz wrote: > > __va_arg_type_violation > > > > It looks like a linker error... > > No, it rather is a varargs usage error (illegal types used in va_arg() > calls). Sloppy programming is the cause of this, most likely. -- Kevin B. Hendricks Associate Professor of Operations and Information Technology Richard Ivey School of Business, University of Western Ontario London, Ontario N6A-3K7 CANADA khendricks@ivey.uwo.ca, (519) 661-3874, fax: 519-661-3959 ** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/ ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Problems Compileing PVM 2000-05-07 18:28 ` Kevin Hendricks @ 2000-05-08 9:35 ` Michael Schmitz 2000-05-08 12:56 ` Hendricks, Kevin 0 siblings, 1 reply; 6+ messages in thread From: Michael Schmitz @ 2000-05-08 9:35 UTC (permalink / raw) To: Kevin Hendricks; +Cc: ian reinhart geiser, linuxppc-dev > On Sun, 07 May 2000, Michael Schmitz wrote: > > > __va_arg_type_violation > > Franz once explained this error to me. It seems according to the ANSI C > standard va_arg can only be done with primary (promoted) types like integer, > double, etc. For any other type, a cast must be done to create proper ansi c. That's what I meant by 'sloppy programming'. Your instructions cover everything but one tiny detail: it is common practice to pass the 'args' va_list argument to other functions further down. In some cases I've seen, a pointer to the va_list argument is passed (which breaks on PPC). What's the proper coding style here? Michael ** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/ ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Problems Compileing PVM 2000-05-08 9:35 ` Michael Schmitz @ 2000-05-08 12:56 ` Hendricks, Kevin 0 siblings, 0 replies; 6+ messages in thread From: Hendricks, Kevin @ 2000-05-08 12:56 UTC (permalink / raw) To: Michael Schmitz; +Cc: ian reinhart geiser, linuxppc-dev Hi, >That's what I meant by 'sloppy programming'. Your instructions cover >everything but one tiny detail: it is common practice to pass the 'args' >va_list argument to other functions further down. In some cases I've seen, >a pointer to the va_list argument is passed (which breaks on PPC). What's >the proper coding style here? In the jdk ppc code, we do exactly that. In fact, a bunch of us argued that the ppc vararg stuff was very broken because of this fact but the sysv abi is the bible and no one with any power would change it. I asked Franz about adding a macro to do this properly (just like the va_start, va_end) but as it stands, there is no cross-platform way to pass pointers to varargs. So all code that does this will require a ppc ifdef. Here is how we handle this case in the jdk source along with a code snippet to illustrate its use. If it were up to me I would add an official macro called va_ptr or something: /* fix for varargs differences */ #if defined(__powerpc__) #define VARGS(x) (x) #else #define VARGS(x) (&x) #endif static ResultType JNICALL jni_CallVoidMethodV(JNIEnv *env, jobject obj, jmethodID methodID, va_list args) { ResultType result; result = jni_Invoke(env, obj, methodID, jni_PushArgumentsVararg, VARGS(args), INVOKE_VIRTUAL | retType).unionType; return result; } Kevin -- Kevin B. Hendricks, Associate Professor of Operations and Information Technology Richard Ivey School of Business, University of Western Ontario London, Ontario N6A-3K7 CANADA khendricks@ivey.uwo.ca, (519) 661-3874, fax: 519-661-3959 ** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/ ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2000-05-08 12:56 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2000-05-06 22:14 Problems Compileing PVM ian reinhart geiser 2000-05-07 9:05 ` Andreas Tobler 2000-05-07 14:37 ` Michael Schmitz 2000-05-07 18:28 ` Kevin Hendricks 2000-05-08 9:35 ` Michael Schmitz 2000-05-08 12:56 ` Hendricks, Kevin
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).