Greetings,

Thank you so much for fixing this. :)
I verified I could compile r33049 with gcc 4.4 (Ubuntu 9.10) without any errors.

Best regards,

Hironori Bono
E-mail: hb...@chromium.org

On Wed, Nov 25, 2009 at 2:00 PM, William Chan (陈智昌) <willc...@google.com> wrote:
> This is fixed now in ToT.  I note that the latest version of
> google-perftools fixes this issue, but we're blocked on some other
> cross platform issue in google-perftools before we can upgrade.  I'll
> go bug csilvers about it again so we can unfork this soon.
>
> 2009/11/24 William Chan (陈智昌) <willc...@google.com>:
>> 2009/11/24 Hironori Bono (坊野 博典) <hb...@chromium.org>:
>>> Greetings chromium developers,
>>>
>>> Today, I encountered some the following build errors while compiling
>>> tcmalloc with gcc 4.4.
>>>
>>>  scons: Reading SConscript files ...
>>>  scons: done reading SConscript files.
>>>  scons: Building targets ...
>>>  Compiling 
>>> /home/hbono/Chrome/src/sconsbuild/Release/obj/tcmalloc/tcmalloc/tcmalloc/src/symbolize.o
>>>  Compiling 
>>> /home/hbono/Chrome/src/sconsbuild/Release/obj/tcmalloc/tcmalloc/tcmalloc_linux.o
>>>  Compiling 
>>> /home/hbono/Chrome/src/sconsbuild/Release/obj/tcmalloc/tcmalloc_unittests/unittest_utils.o
>>>  In file included from tcmalloc/src/symbolize.cc:37:
>>>  tcmalloc/src/symbolize.h:45: error: 'uintptr_t' was not declared in this 
>>> scope
>>>  tcmalloc/src/symbolize.h:45: error: template argument 1 is invalid
>>>  tcmalloc/src/symbolize.h:45: error: template argument 3 is invalid
>>>  tcmalloc/src/symbolize.h:45: error: template argument 4 is invalid
>>>  tcmalloc/src/symbolize.h:45: error: invalid type in declaration
>>> before ';' token
>>>  unittest_utils.cc:10: error: 'size_t' has not been declared
>>>  unittest_utils.cc: In function 'int snprintf(char*, int, const char*, 
>>> ...)':
>>>  unittest_utils.cc:12: error: 'va_list' was not declared in this scope
>>>  unittest_utils.cc:12: error: expected ';' before 'args'
>>>  unittest_utils.cc:13: error: 'args' was not declared in this scope
>>>  unittest_utils.cc:13: error: 'va_start' was not declared in this scope
>>>  unittest_utils.cc:14: error: '_vsnprintf' was not declared in this scope
>>>  unittest_utils.cc:15: error: 'va_end' was not declared in this scope
>>>  scons: *** 
>>> [/home/hbono/Chrome/src/sconsbuild/Release/obj/tcmalloc/tcmalloc_unittests/unittest_utils.o]
>>> Error 1
>>>  tcmalloc/src/symbolize.cc: In function 'bool Symbolize(char*, int,
>>> SymbolMap*)':
>>>  tcmalloc/src/symbolize.cc:134: error: expected initializer before 'iter'
>>>  tcmalloc/src/symbolize.cc:135: error: 'iter' was not declared in this scope
>>>  tcmalloc/src/symbolize.cc:135: error: request for member 'end' in '*
>>> symbolization_table', which is of non-class type 'int'
>>>  tcmalloc/src/symbolize.cc:168: error: expected initializer before 'fill'
>>>  tcmalloc/src/symbolize.cc:172: error: 'fill' was not declared in this scope
>>>  tcmalloc/src/symbolize.cc:140: warning: ignoring return value of
>>> 'ssize_t write(int, const void*, size_t)', declared with attribute
>>> warn_unused_result
>>>  scons: *** 
>>> [/home/hbono/Chrome/src/sconsbuild/Release/obj/tcmalloc/tcmalloc/tcmalloc/src/symbolize.o]
>>> Error 1
>>>  tcmalloc_linux.cc: In function 'void PrintStats(int)':
>>>  tcmalloc_linux.cc:491: warning: ignoring return value of 'ssize_t
>>> write(int, const void*, size_t)', declared with attribute
>>> warn_unused_result
>>>  tcmalloc_linux.cc: In function 'void ReportLargeAlloc(Length, void*)':
>>>  tcmalloc_linux.cc:779: warning: ignoring return value of 'ssize_t
>>> write(int, const void*, size_t)', declared with attribute
>>> warn_unused_result
>>>  scons: building terminated because of errors.
>>>
>>> It seems tcmalloc code forgot including <inttypes.h> before using
>>> uintptr_t and forgot checking the return values of write(), which is a
>>> function with a "warn_unused_result" attribute.
>>> Even though the attached patch "tcmalloc_gcc44.txt" can fix these
>>> build errors, I would like to ask experts here since this is a
>>> third_party library and I cannot change it. (I don't have any good
>>> idea to fix "unittest_utils.cc" since vsnprintf() needs a define
>>> _BSD_SOURCE (or _ISOC99_SOURCE) on Linux.)
>>
>> I don't know about the unittest_utils.cc error, I'd have to look it
>> up, but for the rest of them, here's probably the best thing to do
>> right now:
>>
>> (1) The patch to tcmalloc_linux.cc is fine since it's already forked.
>> (2) Fork all the .cc files that reference symbolize.h, add the
>> <inttypes.h> include before the "symbolize.h" include.  This seems to
>> be symbolize.cc and heap-profile-table.cc (we don't use
>> debugallocation.cc yet).  We can't fix symbolize.h by forking it
>> directly because the #include's will prefer the symbolize in the
>> current directory, rather than the one you forked.  See issue 27911
>> for a more complete explanation.  sgk's fixing this.  To fork it
>> properly, add the new files in third_party/tcmalloc/ and make your
>> edits there.  Edit tcmalloc.gyp to add those two new sources, and make
>> sure to subtract them from the windows build and subtract the old
>> sources from the linux build.  Yes, it's a mess.  It'll get fixed
>> soon.
>>
>>>
>>> Regards,
>>>
>>> Hironori Bono
>>> E-mail: hb...@chromium.org
>>>
>>
>

-- 
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
    http://groups.google.com/group/chromium-dev

Reply via email to