ubuntu hardy/gcc-4.3 build errors with b40

Andrew John Hughes gnu_andrew at member.fsf.org
Thu Nov 27 00:04:57 UTC 2008


2008/11/26 Kelly O'Hair <Kelly.Ohair at sun.com>:
> If you set the variable WARNINGS_ARE_ERRORS to be empty, it should
> be sent through to all the makefiles. It's the variable
> WARNINGS_ARE_ERRORS that contains the option "-Werror" for hotspot
> compiles, and it is -Werror that makes warnings fatal.
>
> So try:
>
>   make WARNINGS_ARE_ERRORS=
>
> Not using -Werror all the time will likely let more warning errors creep
> into the
> builds, but using it means a few people get annoyed when diffenent compilers
> get used.
>
> But keeping all warning messages out of the build is a very good thing in
> my view.
> We need to figure out how to get these warnings fixed in the code, and
> not create new warnings on other platforms or with other compilers.
> Sometimes that is easy, sometimes it is not.
>
> -kto
>
>
> Douglas Felt wrote:
>>
>> I'm running into multiple errors trying to build openjdk 7 on ubuntu
>> 8.10.  I downloaded the  sources from
>>
>> http://www.java.net/download/openjdk/jdk7/promoted/b40/openjdk-7-ea-src-b40-20_nov_2008.zip
>> as listed on http://download.java.net/openjdk/jdk7/.
>>
>> The problem appears to be that gcc flags are configured to map
>> warnings to errors, and gcc 4.3 is issuing some warnings in some of
>> the hotspot files.  here's a sample (as I worked around one, I hit
>> another, and another):
>>
>> --------
>> cc1plus: warnings being treated as errors
>>
>> /home/dougfelt/openjdk/bootstrap7/hotspot/src/share/vm/classfile/javaClasses.cpp:
>> In static member function 'static char*
>> java_lang_Throwable::print_stack_element_to_buffer(methodOopDesc*,
>> int)':
>>
>> /home/dougfelt/openjdk/bootstrap7/hotspot/src/share/vm/classfile/javaClasses.cpp:869:
>> error: format '%#x' expects type 'unsigned int', but argument 3 has
>> type 'nmethod*'
>> make[6]: *** [javaClasses.o] Error 1
>> [...]
>> --------
>> cc1plus: warnings being treated as errors
>> /home/dougfelt/openjdk/bootstrap7/hotspot/src/share/vm/prims/jvm.cpp:
>> In function 'void jio_print(const char*)':
>> /home/dougfelt/openjdk/bootstrap7/hotspot/src/share/vm/prims/jvm.cpp:2477:
>> error: ignoring return value of 'ssize_t write(int, const void*,
>> size_t)', declared with attribute warn_unused_result
>> make[6]: *** [jvm.o] Error 1
>> [...]
>> --------
>> cc1plus: warnings being treated as errors
>> /home/dougfelt/openjdk/bootstrap7/hotspot/src/os/linux/vm/os_linux.cpp:
>> In static member function 'static void
>> os::Linux::capture_initial_stack(size_t)':
>>
>> /home/dougfelt/openjdk/bootstrap7/hotspot/src/os/linux/vm/os_linux.cpp:1189:
>> error: format '%lu' expects type 'long unsigned int*', but argument 22
>> has type 'uintptr_t*'
>>
>> /home/dougfelt/openjdk/bootstrap7/hotspot/src/os/linux/vm/os_linux.cpp:1189:
>> error: format '%lu' expects type 'long unsigned int*', but argument 23
>> has type 'uintptr_t*'
>>
>> /home/dougfelt/openjdk/bootstrap7/hotspot/src/os/linux/vm/os_linux.cpp:1189:
>> error: format '%ld' expects type 'long int*', but argument 24 has type
>> 'uintptr_t*'
>>
>> /home/dougfelt/openjdk/bootstrap7/hotspot/src/os/linux/vm/os_linux.cpp:1189:
>> error: format '%lu' expects type 'long unsigned int*', but argument 26
>> has type 'uintptr_t*'
>>
>> /home/dougfelt/openjdk/bootstrap7/hotspot/src/os/linux/vm/os_linux.cpp:1189:
>> error: format '%lu' expects type 'long unsigned int*', but argument 27
>> has type 'uintptr_t*'
>>
>> /home/dougfelt/openjdk/bootstrap7/hotspot/src/os/linux/vm/os_linux.cpp:1189:
>> error: format '%lu' expects type 'long unsigned int*', but argument 28
>> has type 'uintptr_t*'
>> /home/dougfelt/openjdk/bootstrap7/hotspot/src/os/linux/vm/os_linux.cpp:
>> In static member function 'static void os::jvm_path(char*, jint)':
>>
>> /home/dougfelt/openjdk/bootstrap7/hotspot/src/os/linux/vm/os_linux.cpp:2027:
>> error: ignoring return value of 'char* realpath(const char*, char*)',
>> declared with attribute warn_unused_result
>>
>> /home/dougfelt/openjdk/bootstrap7/hotspot/src/os/linux/vm/os_linux.cpp:2051:
>> error: ignoring return value of 'char* realpath(const char*, char*)',
>> declared with attribute warn_unused_result
>>
>> /home/dougfelt/openjdk/bootstrap7/hotspot/src/os/linux/vm/os_linux.cpp:2062:
>> error: ignoring return value of 'char* realpath(const char*, char*)',
>> declared with attribute warn_unused_result
>> /home/dougfelt/openjdk/bootstrap7/hotspot/src/os/linux/vm/os_linux.cpp:
>> In function 'jlong slow_thread_cpu_time(Thread*, bool)':
>>
>> /home/dougfelt/openjdk/bootstrap7/hotspot/src/os/linux/vm/os_linux.cpp:4157:
>> error: format '%c' expects type 'char*', but argument 3 has type
>> 'int*'
>> make[6]: *** [os_linux.o] Error 1
>> --------
>> cc1plus: warnings being treated as errors
>>
>> /home/dougfelt/openjdk/bootstrap7/hotspot/src/share/vm/utilities/ostream.cpp:
>> In member function 'virtual void fileStream::write(const char*,
>> size_t)':
>>
>> /home/dougfelt/openjdk/bootstrap7/hotspot/src/share/vm/utilities/ostream.cpp:303:
>> error: ignoring return value of 'size_t fwrite(const void*, size_t,
>> size_t, FILE*)', declared with attribute warn_unused_result
>>
>> /home/dougfelt/openjdk/bootstrap7/hotspot/src/share/vm/utilities/ostream.cpp:
>> In member function 'virtual void fdStream::write(const char*,
>> size_t)':
>>
>> /home/dougfelt/openjdk/bootstrap7/hotspot/src/share/vm/utilities/ostream.cpp:331:
>> error: ignoring return value of 'ssize_t write(int, const void*,
>> size_t)', declared with attribute warn_unused_result
>> --------
>>
>> Is my version of gcc too new?  The information on
>> http://hg.openjdk.java.net/jdk7/build/raw-file/tip/README-builds.html
>> is only current as of ubuntu 7.10, and mentions older versions of some
>> packages.  Is there a more recent list of build tools for ubuntu?
>>
>> gcc-4.3 seems to be an indirect dependency of eclipse.  It's not clear
>> if i can downrev it to 4.1 and use the debian eclipse install.
>>
>> Anyway, what should I do?
>>
>> Doug
>>
>>
>>
>

Apparently, these warnings arise from a patch backported to gcc 4.3
from 4.4 in the Ubuntu build (according to Matthias Klose, GCJ/IcedTea
maintainer for Ubuntu).  So this problem will arise more and more once
4.4 is released.
-- 
Andrew :-)

Support Free Java!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net

PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint: F8EF F1EA 401E 2E60 15FA  7927 142C 2591 94EF D9D8



More information about the build-dev mailing list