On Sat, Oct 03, 2009 at 10:40:06PM -0400, Jack Howarth wrote:
> Silvius,
>    The ext/profile/mh.cc test case is failing to compile on *-*-darwin* due 
> to the error...
> 
> /sw/src/fink.build/gcc45-4.4.999-20091003/gcc-4.5-20091003/libstdc++-v3/testsuite/ext/profile/mh.cc:24:20:
>  fatal error: malloc.h: No such file or directory
> 
> This test case should be including stdlib.h rather than malloc.h as has been 
> done in the past...
> 
>         * rts.c: Get malloc() from <stdlib.h>, not <malloc.h>.
> 
> Thanks in advance for fixing this.
>            Jack
I am finding that with...

Index: testsuite/ext/profile/mh.cc
===================================================================
--- testsuite/ext/profile/mh.cc (revision 152438)
+++ testsuite/ext/profile/mh.cc (working copy)
@@ -21,7 +21,7 @@
 // { dg-do compile }
 
 #include <stdio.h>
-#include <malloc.h>
+#include <stdlib.h>
 #include <vector>
 
 using std::vector;

on x86_64-apple-darwin10, the compile error changes to...

Executing on host: 
/sw/src/fink.build/gcc45-4.4.999-20091003/darwin_objdir/./gcc/g++ 
-shared-libgcc -B/sw/src/fink.build/gcc45-4.4.999-20091003/darwin_objdir/./gcc 
-nostdinc++ 
-L/sw/src/fink.build/gcc45-4.4.999-20091003/darwin_objdir/x86_64-apple-darwin10.0.0/i386/libstdc++-v3/src
 
-L/sw/src/fink.build/gcc45-4.4.999-20091003/darwin_objdir/x86_64-apple-darwin10.0.0/i386/libstdc++-v3/src/.libs
 -B/sw/lib/gcc4.5/x86_64-apple-darwin10.0.0/bin/ 
-B/sw/lib/gcc4.5/x86_64-apple-darwin10.0.0/lib/ -isystem 
/sw/lib/gcc4.5/x86_64-apple-darwin10.0.0/include -isystem 
/sw/lib/gcc4.5/x86_64-apple-darwin10.0.0/sys-include -m32 -g -O2 
-D_GLIBCXX_ASSERT -fmessage-length=0 -ffunction-sections -fdata-sections -g -O2 
-g -O2 -DLOCALEDIR="." -nostdinc++ 
-I/sw/src/fink.build/gcc45-4.4.999-20091003/darwin_objdir/x86_64-apple-darwin10.0.0/i386/libstdc++-v3/include/x86_64-apple-darwin10.0.0
 
-I/sw/src/fink.build/gcc45-4.4.999-20091003/darwin_objdir/x86_64-apple-darwin10.0.0/i386/libstdc++-v3/include
 
-I/sw/src/fink.build/gcc45-4.4.999-20091003/gcc-4.5-20091003/libstdc++-v3/libsupc++
 
-I/sw/src/fink.build/gcc45-4.4.999-20091003/gcc-4.5-20091003/libstdc++-v3/include/backward
 
-I/sw/src/fink.build/gcc45-4.4.999-20091003/gcc-4.5-20091003/libstdc++-v3/testsuite/util
 
/sw/src/fink.build/gcc45-4.4.999-20091003/gcc-4.5-20091003/libstdc++-v3/testsuite/ext/profile/mh.cc
   -D_GLIBCXX_PROFILE -S  -m32 -o mh.s    (timeout = 600)
/sw/src/fink.build/gcc45-4.4.999-20091003/gcc-4.5-20091003/libstdc++-v3/testsuite/ext/profile/mh.cc:
 In function 'void my_init_hook()':
/sw/src/fink.build/gcc45-4.4.999-20091003/gcc-4.5-20091003/libstdc++-v3/testsuite/ext/profile/mh.cc:40:21:
 error: '__malloc_hook' was not declared in this scope
/sw/src/fink.build/gcc45-4.4.999-20091003/gcc-4.5-20091003/libstdc++-v3/testsuite/ext/profile/mh.cc:
 In function 'void* my_malloc_hook(size_t, const void*)':
/sw/src/fink.build/gcc45-4.4.999-20091003/gcc-4.5-20091003/libstdc++-v3/testsuite/ext/profile/mh.cc:48:3:
 error: '__malloc_hook' was not declared in this scope
compiler exited with status 1
output is:
/sw/src/fink.build/gcc45-4.4.999-20091003/gcc-4.5-20091003/libstdc++-v3/testsuite/ext/profile/mh.cc:
 In function 'void my_init_hook()':
/sw/src/fink.build/gcc45-4.4.999-20091003/gcc-4.5-20091003/libstdc++-v3/testsuite/ext/profile/mh.cc:40:21:
 error: '__malloc_hook' was not declared in this scope
/sw/src/fink.build/gcc45-4.4.999-20091003/gcc-4.5-20091003/libstdc++-v3/testsuite/ext/profile/mh.cc:
 In function 'void* my_malloc_hook(size_t, const void*)':
/sw/src/fink.build/gcc45-4.4.999-20091003/gcc-4.5-20091003/libstdc++-v3/testsuite/ext/profile/mh.cc:48:3:
 error: '__malloc_hook' was not declared in this scope

FAIL: ext/profile/mh.cc (test for excess errors)
Excess errors:
/sw/src/fink.build/gcc45-4.4.999-20091003/gcc-4.5-20091003/libstdc++-v3/testsuite/ext/profile/mh.cc:40:21:
 error: '__malloc_hook' was not declared in this scope
/sw/src/fink.build/gcc45-4.4.999-20091003/gcc-4.5-20091003/libstdc++-v3/testsuite/ext/profile/mh.cc:48:3:
 error: '__malloc_hook' was not declared in this scope

extra_tool_flags are:
 -D_GLIBCXX_DEBUG -D_GLIBCXX_PROFILE

Any ideas on what is wrong here (or is this test simply glibc-centric)?
        Jack

Reply via email to