ubuntu hardy/gcc-4.3 build errors with b40

Douglas Felt dougfelt at gmail.com
Wed Nov 26 08:27:57 UTC 2008


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



More information about the build-dev mailing list