From: Rick K. <rk...@nc...> - 2005-07-24 20:21:16
|
Alex (and others), Here's a followup on your question below regarding using PerfSuite with 32-bit binaries on AMD64. In general, it seems that it won't be too difficult to incorporate this in an upcoming release although the current versions won't build cleanly as-is and will have a few adjustments made to deal with things better. As far as I can tell, there isn't a standard for filesystem names for 32- or 64-bit libraries, so it'll be the choice of the person building it ("--libdir=" configure-time option). I'm working on RHEL4 (Nahant Update 1), Opteron 248, and currently have run into an issue that I'm hoping you or others on this list might be able to offer a suggestion/workaround. Specifically, linking a program compiled for 32-bit fails in finding the Expat library (-lexpat, which is actually present in both of /usr/lib and /usr/lib64). It seems to me that the linker search path isn't what it should be, even though -m32 is on the compile/link line. This, in turn, is messing up a creation of the "libpshwpc" shared library which is where Expat is used in PerfSuite. What I'm after are any suggestions that would successfully compile and link the following program as a 32-bit app on AMD64. Once this gets solved, things should be on their way. If there isn't a clean way to fix it, I think it'll still be possible to have 32-bit support but would require hand-editing automake-generated makefiles, which is naturally not too pleasant... Thanks in advance for any suggestions! Rick Error output from the link is: # gcc -m32 -o expattest expattest.c -lexpat /usr/bin/ld: skipping incompatible /usr/lib64/libexpat.so when searching for -lexpat /usr/bin/ld: skipping incompatible /usr/lib64/libexpat.a when searching for -lexpat /usr/bin/ld: cannot find -lexpat collect2: ld returned 1 exit status Explicitly adding -L/usr/lib or setting LDEMULATION don't seem to do the trick for me. The only thing I've found that works is to add /usr/lib/libexpat.so.0 on the link line instead of -lexpat :( ----------------------------- #include <stdlib.h> #include <stdio.h> #include <expat.h> main(int argc, char **argv) { XML_Parser p; p = XML_ParserCreate(NULL); if ( ! p ) { fputs("Error in creating parser\n", stderr); exit(1); } exit(0); } On Mon, 18 Jul 2005, Alex Mericas wrote: > I am running Suse on an Athlon64. I can use psrun without problems on binaries compiled for 64bit, but if I try to run 32bit binaries psrun cannot find its runtime library. I'm guessing psrun would need both a 32bit and a 64bit library to work this way. Is this possible? Do you have plans to implement? Thanks! > |