2011/11/15 Mingjie Xing <[email protected]>:
> Hi,
>
> Recently, I run into a very odd things when change my gcc toolchain
> from 3.3.* to 3.4.*. The compiled application such as a simple hello
> printing, is unable to redirect into a file.
Here's more information generating by strace.
$ strace ./hello.gcc-3.3 > log
execve("./hello..gcc-3.3", ["./hello..gcc-3.3"], [/* 36 vars */]) = 0
uname({sys="Linux", node="loongson.redflag-linux.com", ...}) = 0
fcntl64(0, F_GETFD) = 0
fcntl64(1, F_GETFD) = 0
fcntl64(2, F_GETFD) = 0
geteuid() = 0
getuid() = 0
getegid() = 0
getgid() = 0
brk(0) = 0x10008000
brk(0x1000c000) = 0x1000c000
fstat64(1, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
old_mmap(NULL, 65536, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0x2aaa8000
write(1, "hello\n"..., 6) = 6
munmap(0x2aaa8000, 65536) = 0
exit_group(0) = ?
$ strace ./hello.gcc-3.4 > log
execve("./hello.gcc-3.4", ["./hello.gcc-3.4"], [/* 36 vars */]) = 0
uname({sys="Linux", node="loongson.redflag-linux.com", ...}) = 0
fcntl64(0, F_GETFD) = 0
fcntl64(1, F_GETFD) = 0
fcntl64(2, F_GETFD) = 0
geteuid() = 0
getuid() = 0
getegid() = 0
getgid() = 0
brk(0) = 0x10008000
brk(0x1000c000) = 0x1000c000
fstat64(1, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
old_mmap(NULL, 65536, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0x2aaa8000
exit_group(0) = ?
We can see that the latter program doesn't run "write(1, "hello\n"...,
6) " at all.
Thanks
Mingjie