|
From: Robert W. <rj...@du...> - 2005-04-27 00:12:47
|
I'm getting this error with the latest SVN update (valgrind 3572 and vex 1145.) Anyone else seeing it? m_debuglog.c: In function `local_sys_write_stderr': m_debuglog.c:65: error: can't find a register in class `BREG' while reloading `asm' Regards, Robert. |
|
From: Julian S. <js...@ac...> - 2005-04-27 00:43:00
|
Hi Robert
What gcc version is this with? I am using 3.3.3.
> m_debuglog.c: In function `local_sys_write_stderr':
> m_debuglog.c:65: error: can't find a register in class `BREG' while
> reloading `asm'
Yes, I saw that on one of Tom's nightly-build logs the other day.
It's this:
static UInt local_sys_write_stderr ( HChar* buf, Int n )
{
UInt __res;
__asm__ volatile ("int $0x80"
: "=a" (__res)
: "0" (4), /* __NR_write */
"b" (2), /* stderr */
"c" (buf),
"d" (n) );
if (__res < 0)
__res = -1;
return __res;
}
Do you know if there is some way to rephrase this so that it
doesn't sometimes crash gcc? I guess the register constraints
got too much for it. I know Tom dealt with a similar problem
a few days back and resorted to writing a .s file with the
function in, but I'd really prefer to stick with inline
assembly if at all possible.
J
|
|
From: Robert W. <rj...@du...> - 2005-04-27 01:07:43
|
> What gcc version is this with? I am using 3.3.3. It's stock Fedora Core 3 (x86), with gcc 3.4.3: Reading specs from /usr/lib/gcc/i386-redhat-linux/3.4.3/specs Configured with: ../configure --prefix=3D/usr --mandir=3D/usr/share/man --i= nfodir=3D/usr/share/info --enable-shared --enable-threads=3Dposix --disable= -checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exce= ptions --enable-java-awt=3Dgtk --host=3Di386-redhat-linux Thread model: posix gcc version 3.4.3 20050227 (Red Hat 3.4.3-22.fc3) > Do you know if there is some way to rephrase this so that it > doesn't sometimes crash gcc? No, but I did snarf that function into a file and compiled it alone. It works, but only if I don't say -fpie. Otherwise, it gives the same problem: $ gcc -fpie -c t.c t.c: In function `local_sys_write_stderr': t.c:4: error: can't find a register in class `BREG' while reloading `asm' $ gcc -c t.c $ Regards, Robert. --=20 Robert Walsh Amalgamated Durables, Inc. - "We don't make the things you buy." Email: rj...@du... |
|
From: Tom H. <to...@co...> - 2005-04-27 06:05:00
|
In message <200...@ac...>
Julian Seward <js...@ac...> wrote:
> static UInt local_sys_write_stderr ( HChar* buf, Int n )
> {
> UInt __res;
> __asm__ volatile ("int $0x80"
> : "=a" (__res)
> : "0" (4), /* __NR_write */
> "b" (2), /* stderr */
> "c" (buf),
> "d" (n) );
> if (__res < 0)
> __res = -1;
> return __res;
> }
>
> Do you know if there is some way to rephrase this so that it
> doesn't sometimes crash gcc? I guess the register constraints
> got too much for it. I know Tom dealt with a similar problem
> a few days back and resorted to writing a .s file with the
> function in, but I'd really prefer to stick with inline
> assembly if at all possible.
It's due to PIE mode - you can't bind ebx like that in PIE mode as
the compiler is using it for the static base address.
I'll fix it up later...
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|