diff --git a/.gitignore b/.gitignore index 608a4f606..d308fdcf9 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ test/nashorn/lib NashornProfile.txt **/JTreport/** **/JTwork/** +cmake-build-debug/ diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..9ff9b581e --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.7) +project(hotspot) +include_directories( + src/hotspot/cpu + src/hotspot/os + src/hotspot/os_cpu + src/hotspot/share + src/hotspot/share/precompiled + src/hotspot/share/include + src/java.base/unix/native/include + src/java.base/share/native/include +) +file(GLOB_RECURSE SOURCE_FILES "*.cpp" "*.hpp" "*.c" "*.h") +add_executable(hotspot ${SOURCE_FILES}) diff --git a/make/autoconf/flags-cflags.m4 b/make/autoconf/flags-cflags.m4 index c31c5d4fe..4773b6e08 100644 --- a/make/autoconf/flags-cflags.m4 +++ b/make/autoconf/flags-cflags.m4 @@ -179,7 +179,7 @@ AC_DEFUN([FLAGS_SETUP_WARNINGS], gcc) DISABLE_WARNING_PREFIX="-Wno-" - CFLAGS_WARNINGS_ARE_ERRORS="-Werror" + CFLAGS_WARNINGS_ARE_ERRORS="-Werror -Wno-error=missing-attributes -Wno-error=deprecated-declarations" # Additional warnings that are not activated by -Wall and -Wextra WARNINGS_ENABLE_ADDITIONAL="-Wpointer-arith -Wsign-compare \ diff --git a/src/hotspot/share/compiler/disassembler.cpp b/src/hotspot/share/compiler/disassembler.cpp index 0d67201f2..85648dc57 100644 --- a/src/hotspot/share/compiler/disassembler.cpp +++ b/src/hotspot/share/compiler/disassembler.cpp @@ -362,7 +362,7 @@ void decode_env::print_hook_comments(address pc, bool newline) { decode_env::decode_env(CodeBlob* code, outputStream* output, CodeStrings c, ptrdiff_t offset) { - memset(this, 0, sizeof(*this)); // Beware, this zeroes bits of fields. + memset((void* )this, 0, sizeof(*this)); // Beware, this zeroes bits of fields. _output = output ? output : tty; _code = code; if (code != NULL && code->is_nmethod()) diff --git a/src/hotspot/share/gc/parallel/objectStartArray.cpp b/src/hotspot/share/gc/parallel/objectStartArray.cpp index 8658de4a3..5ff2f9f47 100644 --- a/src/hotspot/share/gc/parallel/objectStartArray.cpp +++ b/src/hotspot/share/gc/parallel/objectStartArray.cpp @@ -103,7 +103,7 @@ void ObjectStartArray::set_covered_region(MemRegion mr) { vm_exit_out_of_memory(expand_by, OOM_MMAP_ERROR, "object start array expansion"); } // Clear *only* the newly allocated region - memset(_blocks_region.end(), clean_block, expand_by); + memset((void*)_blocks_region.end(), clean_block, expand_by); } if (requested_blocks_size_in_bytes < current_blocks_size_in_bytes) { @@ -121,7 +121,7 @@ void ObjectStartArray::set_covered_region(MemRegion mr) { } void ObjectStartArray::reset() { - memset(_blocks_region.start(), clean_block, _blocks_region.byte_size()); + memset((void*)_blocks_region.start(), clean_block, _blocks_region.byte_size()); } bool ObjectStartArray::object_starts_in_range(HeapWord* start_addr, diff --git a/src/hotspot/share/memory/metaspace/chunkManager.cpp b/src/hotspot/share/memory/metaspace/chunkManager.cpp index 19f85ac7f..b16ce3f98 100644 --- a/src/hotspot/share/memory/metaspace/chunkManager.cpp +++ b/src/hotspot/share/memory/metaspace/chunkManager.cpp @@ -354,7 +354,7 @@ Metachunk* ChunkManager::split_chunk(size_t target_chunk_word_size, Metachunk* l // Any larger non-humongous chunk size is a multiple of any smaller chunk size. // Since non-humongous chunks are aligned to their chunk size, the larger chunk should start // at an address suitable to place the smaller target chunk. - assert_is_aligned(region_start, target_chunk_word_size); + assert_is_aligned((void*)region_start, target_chunk_word_size); // Remove old chunk. free_chunks(larger_chunk_index)->remove_chunk(larger_chunk); @@ -363,7 +363,7 @@ Metachunk* ChunkManager::split_chunk(size_t target_chunk_word_size, Metachunk* l // Prevent access to the old chunk from here on. larger_chunk = NULL; // ... and wipe it. - DEBUG_ONLY(memset(region_start, 0xfe, region_word_len * BytesPerWord)); + DEBUG_ONLY(memset((void*)region_start, 0xfe, region_word_len * BytesPerWord)); // In its place create first the target chunk... MetaWord* p = region_start; diff --git a/src/java.base/unix/native/libjli/java_md_solinux.c b/src/java.base/unix/native/libjli/java_md_solinux.c index 7ae9d8161..d392db215 100644 --- a/src/java.base/unix/native/libjli/java_md_solinux.c +++ b/src/java.base/unix/native/libjli/java_md_solinux.c @@ -744,7 +744,7 @@ ContinueInNewThread0(int (JNICALL *continuation)(void *), jlong stack_size, void } pthread_attr_setguardsize(&attr, 0); // no pthread guard page on java threads - if (pthread_create(&tid, &attr, (void *(*)(void*))continuation, (void*)args) == 0) { + if (pthread_create(&tid, &attr, (void *(*)(void*))(void*)continuation, (void*)args) == 0) { void * tmp; pthread_join(tid, &tmp); rslt = (int)(intptr_t)tmp; diff --git a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-set-private.hh b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-set-private.hh index 023332f0d..035332717 100644 --- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-set-private.hh +++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-set-private.hh @@ -51,7 +51,7 @@ struct hb_set_t struct page_t { inline void init0 (void) { memset (&v, 0, sizeof (v)); } - inline void init1 (void) { memset (&v, 0xff, sizeof (v)); } + inline void init1 (void) { memset ((void*)&v, 0xff, sizeof (v)); } inline unsigned int len (void) const { return ARRAY_LENGTH_CONST (v); } diff --git a/src/java.desktop/share/native/liblcms/cmsxform.c b/src/java.desktop/share/native/liblcms/cmsxform.c index 77d54804a..61c2c6ca4 100644 --- a/src/java.desktop/share/native/liblcms/cmsxform.c +++ b/src/java.desktop/share/native/liblcms/cmsxform.c @@ -836,7 +836,7 @@ _cmsTRANSFORM* AllocEmptyTransform(cmsContext ContextID, cmsPipeline* lut, // Save the day? (Ignore the warning) if (Plugin->OldXform) { - p->OldXform = (_cmsTransformFn) p->xform; + p->OldXform = (_cmsTransformFn)(void*) p->xform; p->xform = _cmsTransform2toTransformAdaptor; }