summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
Commit message (Collapse)AuthorAgeFilesLines
* Prevent 'function should return a value' BCC error in CMake scriptIvan Maidanski2023-04-171-0/+5
| | | | | * CMakeLists.txt [enable_werror && BORLAND && enable_threads]: Pass "/w-rvl" to add_compile_options; add comment.
* Do not check presence of getcontext and dl_iterate_phdr by cmake on Win32Ivan Maidanski2023-04-171-6/+10
| | | | | | | | | (refactoring) * CMakeLists.txt (getcontext): Do not check_function_exists if BORLAND or MSVC. * CMakeLists.txt (dl_iterate_phdr): Do not check_function_exists if WIN32.
* Change enable_threads default to off if threads are unsupported (CMake)Bruce Mitchener2023-03-101-65/+70
| | | | | | | | | | | | | | | | | | | | | | PR #535 (bdwgc). In case of an absent multi-threading support for the target platform, like for Emscripten or WASI, cmake build should not fail by default (i.e. threads support should not be on by default). This matches the relevant behavior of configure one. * CMakeLists.txt (default_enable_threads): New variable (ON by default). * CMakeLists.txt: Call find_package(Threads) quietly regardless of enable_threads. * CMakeLists.txt [EMSCRIPTEN || WASI || !(CMAKE_USE_PTHREADS_INIT || CMAKE_USE_WIN32_THREADS_INIT)] (default_enable_threads): Set to OFF. * CMakeLists.txt (enable_threads): Specify the default value to default_enable_threads. * CMakeLists.txt: Check CMAKE_USE_PTHREADS_INIT and CMAKE_USE_WIN32_THREADS_INIT only if enable_threads. Co-authored-by: Ivan Maidanski <ivmai@mail.ru>
* Rename doc folder to docsIvan Maidanski2023-01-261-35/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * CMakeLists.txt [enable_docs] (CMAKE_INSTALL_DOCDIR): Rename doc folder to docs. * Makefile.am [ENABLE_DOCS] (docdocdir, dist_docdocs_DATA, dist_docdocsplatforms_DATA): Likewise. * Makefile.direct (CXXFLAGS): Likewise. * README.md: Likewise. * docs/simple_example.md (Other platforms): Likewise. * Makefile.am [ENABLE_DOCS] (docdocdir): Rename to docdocsdir. * Makefile.am [ENABLE_DOCS] (dist_docdoc_DATA): Rename to dist_docdocs_DATA. * Makefile.am [ENABLE_DOCS] (docdocplatformsdir): Rename to docdocsplatformsdir. * Makefile.am [ENABLE_DOCS] (dist_docdocplatforms_DATA): Rename to dist_docdocsplatforms_DATA. * doc/README.autoconf: Move to docs folder. * doc/README.cmake: Likewise. * doc/README.cords: Likewise. * doc/README.environment: Likewise. * doc/README.macros: Likewise. * doc/debugging.md: Likewise. * doc/faq.md: Likewise. * doc/finalization.md: Likewise. * doc/gcdescr.md: Likewise. * doc/gcinterface.md: Likewise. * doc/leak.md: Likewise. * doc/overview.md: Likewise. * doc/porting.md: Likewise. * doc/scale.md: Likewise. * doc/simple_example.md: Likewise. * doc/tree.md: Likewise. * doc/platforms/README.aix: Move to docs/platforms folder. * doc/platforms/README.amiga: Likewise. * doc/platforms/README.arm_cross: Likewise. * doc/platforms/README.darwin: Likewise. * doc/platforms/README.dgux386: Likewise. * doc/platforms/README.emscripten: Likewise. * doc/platforms/README.ews4800: Likewise. * doc/platforms/README.hp: Likewise. * doc/platforms/README.linux: Likewise. * doc/platforms/README.mac: Likewise. * doc/platforms/README.os2: Likewise. * doc/platforms/README.sgi: Likewise. * doc/platforms/README.solaris2: Likewise. * doc/platforms/README.symbian: Likewise. * doc/platforms/README.uts: Likewise. * doc/platforms/README.win32: Likewise. * doc/platforms/README.win64: Likewise.
* Preserve doc folders structure on package installIvan Maidanski2023-01-261-4/+37
| | | | | | | | | | | | | | | | | | | | Issue #518 (bdwgc). Previously all documentation files were copied to a single folder during make install. Now, the files are copied preserving the directories structure. * CMakeLists.txt [enable_docs] (install): Change destination for doc/README.* and doc/*.md items from ${CMAKE_INSTALL_DOCDIR} to ${CMAKE_INSTALL_DOCDIR}/doc; change destination for doc/platforms/README.* items from ${CMAKE_INSTALL_DOCDIR} to ${CMAKE_INSTALL_DOCDIR}/doc/platforms. * Makefile.am [ENABLE_DOCS] (docdocdir, docdocplatformsdir): New variable. * Makefile.am [ENABLE_DOCS] (dist_docdoc_DATA): Define (move doc/README.* and doc/*.md items from dist_doc_DATA). * Makefile.am [ENABLE_DOCS] (dist_docdocplatforms_DATA): Define (move doc/platforms/README.* items from dist_doc_DATA).
* Install ChangeLog among doc filesIvan Maidanski2023-01-241-1/+1
| | | | | | * CMakeLists.txt [enable_docs] (CMAKE_INSTALL_DOCDIR): Add "ChangeLog" entry. * Makefile.am [ENABLE_DOCS] (dist_doc_DATA): Likewise.
* Avoid code duplication between pthread_support.c and win32_threads.cIvan Maidanski2022-12-061-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (refactoring) * CMakeLists.txt [CMAKE_USE_PTHREADS_INIT || CMAKE_USE_WIN32_THREADS_INIT] (SRC): Include pthread_start.c and pthread_support.c for Win32 platform. * Makefile.am [THREADS] (libgc_la_SOURCES): Likewise. * NT_MAKEFILE [ENABLE_STATIC] (OBJS): Add pthread_start.obj, pthread_support.obj. * include/private/gc_locks.h [LINT2 || GC_WIN32_THREADS] (NO_PTHREAD_TRYLOCK): Do not define if already defined; add comment. * include/private/gcconfig.h [GC_PTHREADS && !GC_PTHREADS_PARAMARK && !__MINGW32__] (GC_PTHREADS_PARAMARK): Do not define unless PARALLEL_MARK. * include/private/pthread_support.h (thread_id_self, THREAD_ID_EQUAL, ADDR_LIMIT, MAX_MARKERS, GC_PTHREAD_PTRVAL): Define macro. * include/private/pthread_support.h (GC_win32_dll_threads, GC_available_markers_m1, GC_required_markers_cnt, GC_marker_sp, GC_marker_last_stack_min, GC_marker_Id): Declare global variable. * include/private/pthread_support.h (GC_init_win32_thread_naming, GC_mark_thread, GC_new_thread, GC_record_stack_base, GC_register_my_thread_inner, GC_lookup_by_pthread, GC_setup_atfork, GC_win32_cache_self_pthread, GC_delete_gc_thread_no_free, GC_win32_dll_lookup_thread, GC_delete_thread, GC_win32_unprotect_thread, GC_wait_for_gc_completion): Declare. * include/private/pthread_support.h [GC_PTHREADS] (GC_pthread_start_inner, GC_start_rtn_prepare_thread): Declare even for GC_WIN32_THREADS. * misc.c [!THREADS] (GC_call_with_gc_active, GC_do_blocking_inner): Update comment to refer to pthread_support.c. * pthread_start.c [GC_PTHREADS] (GC_pthread_start_inner): Define even for GC_WIN32_THREADS. * pthread_support.c: Do not skip this file for GC_WIN32_THREADS; adjust includes for Win32. * pthread_support.c (GC_INNER_WIN32THREAD): New macro. * pthread_support.c (GC_init_win32_thread_naming, GC_win32_unprotect_thread): New function. * pthread_support.c (setThreadDescription_fn, set_marker_thread_name): Move from win32_threads.c. * pthread_support.c (available_markers_m1): Rename to GC_available_markers_m1. * win32_threads.c (available_markers_m1): Likewise. * pthread_support.c (required_markers_cnt): Rename to GC_required_markers_cnt. * win32_threads.c (required_markers_cnt): Likewise. * pthread_support.c (GC_mark_thread, GC_start_mark_threads_inner, GC_push_thread_structures, GC_count_threads, GC_new_thread, GC_delete_thread, GC_delete_gc_thread_no_free, GC_lookup_thread, GC_reset_finalizer_nested, GC_check_finalizer_nested, GC_is_thread_tsd_valid, GC_thread_is_registered, GC_register_altstack, GC_segment_is_thread_stack, GC_wait_for_gc_completion, GC_remove_all_threads_but_me, fork_child_proc, GC_record_stack_base, GC_init_parallel, GC_pthread_sigmask, GC_set_stackbottom, GC_get_my_stackbottom, GC_call_with_gc_active, GC_unregister_my_thread, GC_unregister_my_thread_inner, GC_thread_exit_proc, GC_pthread_join, GC_pthread_detach, GC_pthread_sigmask, GC_pthread_create): Adjust function for Win32. * win32_threads.c (GC_lock_holder, GC_win32_dll_threads, IE_t, GC_thr_initialized, GC_need_to_lock, ADDR_LIMIT, GC_thread, GC_vthread, GC_threads, first_thread, GC_new_thread, GC_in_thread_creation, GC_record_stack_base, GC_lookup_thread, CHECK_LOOKUP_MY_THREAD, GC_reset_finalizer_nested, GC_check_finalizer_nested, GC_is_thread_tsd_valid, GC_thread_is_registered, GC_register_altstack, UNPROTECT_THREAD, GC_PTHREAD_PTRVAL, GC_delete_gc_thread_no_free, GC_delete_thread, GC_allow_register_threads, GC_register_my_thread, GC_set_stackbottom, GC_wait_for_gc_completion, GC_unregister_my_thread, GC_do_blocking_inner, GC_call_with_gc_active, GC_get_my_stackbottom, GC_remove_all_threads_but_me, fork_prepare_proc, fork_parent_proc, fork_child_proc, GC_atfork_prepare, GC_atfork_parent, GC_atfork_child, GC_setup_atfork, GC_push_thread_structures, marker_sp, set_marker_thread_name, setThreadDescription_fn, GC_mark_thread, required_markers_cnt, GC_set_markers_count, START_MARK_THREADS, start_info, GC_pthread_join, GC_pthread_create, GC_pthread_start_inner, GC_pthread_start, GC_thread_exit_proc, GC_pthread_detach, GC_check_tls, GC_init_parallel, GC_lock, GC_mark_thread_local_free_lists): Remove. * win32_threads.c [GC_PTHREADS_PARAMARK] (mark_cv, GC_start_mark_threads_inner, GC_mark_lock_holder, SET_MARK_LOCK_HOLDER, UNSET_MARK_LOCK_HOLDER, mark_mutex, builder_cv, GC_acquire_mark_lock, GC_release_mark_lock, GC_wait_builder, GC_wait_for_reclaim, GC_notify_all_builder, GC_wait_marker, GC_notify_all_marker, * win32_threads.c [GC_PTHREADS] (pthread_create, pthread_join, pthread_detach, pthread_sigmask): Do not undefine. * win32_threads.c [CAN_CALL_ATFORK]: Do not include unistd.h. * win32_threads.c (GC_register_my_thread_inner): Change type of me local variable from GC_vthread to GC_thread. * win32_threads.c (GC_win32_dll_lookup_thread, GC_win32_cache_self_pthread): New GC_INNER function. * win32_threads.c (GC_suspend, GC_start_world, GC_push_stack_for): Use GC_win32_unprotect_thread() instead of UNPROTECT_THREAD(). * win32_threads.c (marker_last_stack_min): Rename to GC_marker_last_stack_min. * win32_threads.c (GC_thr_init): Call GC_init_win32_thread_naming().
* Make Emscripten Asyncify feature optionalJukka Jylanki2022-11-241-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #506 (bdwgc). "-sASYNCIFY" is a relatively rarely used feature of Emscripten, most developers do not use it, and it does not scale well to moderate-to-large codebases. It incurs a heavy impact to code size and performance, and carries other correctness problems that developers must then adhere to regarding event loop message ordering. This commit provides new option in cmake (-Denable_emscripten_asyncify) and configure (--enable-emscripten-asyncify) scripts to turn on Emscripten Asyncify feature on demand. * CMakeLists.txt (enable_emscripten_asyncify): New option (off by default). * CMakeLists.txt (EMSCRIPTEN): Define using check_c_source_compiles. * CMakeLists.txt [EMSCRIPTEN && enable_emscripten_asyncify] (EMSCRIPTEN_ASYNCIFY): Define C macro. * CMakeLists.txt [EMSCRIPTEN && enable_emscripten_asyncify] (CMAKE_EXE_LINKER_FLAGS): Append "-sASYNCIFY" and "-sASYNCIFY_STACK_SIZE=128000". * configure.ac (emscripten): Remove quotes for the error directive message. * configure.ac [emscripten] (gc_cflags): Move comment and assignment down (to be after reporting result for emscripten). * configure.ac (emscripten-asyncify): New AC_ARG_ENABLE option; add comment. * configure.ac [enable_emscripten_asyncify && emscripten] (gc_cflags): Add -D EMSCRIPTEN_ASYNCIFY; remove space after "-s". * configure.ac [emscripten] (gc_cflags): Append "-sASYNCIFY" and "-sASYNCIFY_STACK_SIZE=128000" only if enable_emscripten_asyncify. * doc/README.macros (EMSCRIPTEN_ASYNCIFY): Document. * os_dep.c [!ECOS && !NOSYS && !SYMBIAN && EMSCRIPTEN]: Make USE_EMSCRIPTEN_SCAN_STACK has effect only if EMSCRIPTEN_ASYNCIFY. * os_dep.c [THREADS && EMSCRIPTEN]: Include emscripten.h only if EMSCRIPTEN_ASYNCIFY. * os_dep.c [THREADS && EMSCRIPTEN] (scan_regs_cb, GC_default_push_other_roots): Define as a function only if EMSCRIPTEN_ASYNCIFY; update comment. Co-authored-by: Ivan Maidanski <ivmai@mail.ru>
* Build with GC_wcsdup support if wcslen existsIvan Maidanski2022-10-291-0/+6
| | | | | | | | | | | | | | | | | | Now, digimars.mak, NT_MAKEFILE and WCC_MAKEFILE scripts pass -D GC_REQUIRE_WCSDUP option to the compiler unconditionally to build GC_wcsdup API function. CMakeLists.txt and configure.ac pass this option to the compiler after successful probing whether wcslen() is provided on the host. Makefile.direct does not pass the option by default, only the comment about the option is added (because this script cannot check availability of wcslen in libc). * CMakeLists.txt (HAVE_WCSLEN): Set if wcslen symbol exists in wchar.h. * Makefile.direct (CFLAGS_EXTRA): Add comment of -D GC_REQUIRE_WCSDUP. * NT_MAKEFILE (CFLAGS_DEFAULT): Add -D GC_REQUIRE_WCSDUP. * WCC_MAKEFILE (DEFS): Likewise. * digimars.mak (DEFINES): Likewise. * configure.ac (GC_REQUIRE_WCSDUP): Define if the code snippet including wchar.h and calling wcslen() can be compiled and linked.
* Fix 'unknown option --no-undefined' linker error in cmake script (OS X)Ivan Maidanski2022-09-231-12/+39
| | | | | | | | | | | | | | | | | | | | | Use check_linker_flag() and LINKER prefix in CMakeLists.txt. This fixes the linker error that "--no-undefined" option is unknown, at least with apple-clang 13.0. * CMakeLists.txt [CMP0057] (CMP0057): Set to NEW. * CMakeLists.txt [$CMAKE_VERSION<3.18.0]: Include CheckLinkerFlag. * CMakeLists.txt [BUILD_SHARED_LIBS] (WL_NO_UNDEFINED_OPT): New variable. * CMakeLists.txt [BUILD_SHARED_LIBS && $CMAKE_VERSION>=3.18.0] (WL_NO_UNDEFINED_OPT): Use "LINKER:" prefix. * CMakeLists.txt [BUILD_SHARED_LIBS && $CMAKE_VERSION>=3.18.0] (HAVE_FLAG_WL_NO_UNDEFINED): Use check_linker_flag(C) instead of check_c_compiler_flag. * CMakeLists.txt [BUILD_SHARED_LIBS && $CMAKE_VERSION<3.13.0] (gc, gccpp, gctba, cord): Use $WL_NO_UNDEFINED_OPT. * CMakeLists.txt [BUILD_SHARED_LIBS && $CMAKE_VERSION>=3.13.0] (gc, gccpp, gctba, cord): Use target_link_options instead of target_link_libraries; remove TODO item.
* Fix 'call to undeclared pthread_setname_np' errors in configure and cmakeSam James2022-09-151-2/+2
| | | | | | | | | | | | | | | | | | | Issue #474 (bdwgc). Clang 15 makes implicit function declarations an error by default which leads to configure (and cmake script) falsely thinking pthread_setname_np symbol is not present. * CMakeLists.txt [CMAKE_USE_PTHREADS_INIT] (check_c_source_compiles): Always define _GNU_SOURCE before include pthread.h (regardless of __CYGWIN__, __linux__, __GLIBC__, __GNU__ macros). * configure.ac [$THREADS==posix] (AC_COMPILE_IFELSE): Likewise. * include/private/gc_priv.h [!_GNU_SOURCE && (HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID || HAVE_PTHREAD_SETNAME_NP_WITH_TID_AND_ARG || HAVE_PTHREAD_SETNAME_NP_WITH_TID)] (_GNU_SOURCE): Define. Co-authored-by: Ivan Maidanski <ivmai@mail.ru>
* Use cast to void instead of the attribute to indicate unused argumentsIvan Maidanski2022-09-151-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (refactoring) * CMakeLists.txt [BORLAND] (add_compile_options): Remove "/w-par"; reorder options. * CMakeLists.txt [!BORLAND && MSVC] (add_compile_options): Remove "/wd4100"; update comment. * NT_MAKEFILE (.c.obj): Likewise. * allchblk.c [!NO_DEBUGGING || GC_ASSERTIONS] (add_hb_sz): Use UNUSED_ARG() instead of GC_ATTR_UNUSED. * allchblk.c [USE_MUNMAP] (GC_adjust_num_unmapped): Likewise. * backgraph.c [MAKE_BACK_GRAPH] (pop_in_progress, reset_back_edge, update_max_height): Likewise. * checksums.c [CHECKSUMS] (GC_add_block): Likewise. * darwin_stop_world.c (GC_stack_range_for): Likewise. * dbg_mlc.c (GC_store_debug_info_inner, GC_debug_change_stubborn, GC_check_heap_block): Likewise. * finalize.c [!GC_NO_FINALIZATION] (GC_null_finalize_mark_proc): Likewise. * gcj_mlc.c [GC_GCJ_SUPPORT] (GC_gcj_fake_mark_proc): Likewise. * mallocx.c [!CPPCHECK] (GC_change_stubborn): Likewise. * mark.c (GC_noop6, clear_marks_for_block): Likewise. * mark.c [WRAP_MARK_SOME && (MSWIN32 || MSWINCE) && __GNUC__] (mark_ex_handler): Likewise. * mark.c [GC_DISABLE_INCREMENTAL] (GC_push_conditional): Likewise. * mark_rts.c (GC_push_current_stack, GC_push_roots): Likewise. * misc.c (GC_default_oom_fn, GC_set_handle_fork): Likewise. * misc.c [THREADS && !SIGNAL_BASED_STOP_WORLD] (GC_set_suspend_signal, GC_set_thr_restart_signal): Likewise. * misc.c [THREADS && UNIX_LIKE && !NO_GETCONTEXT] (callee_saves_pushed_dummy_fn): Likewise. * misc.c [!THREADS] (GC_do_blocking_inner): Likewise. * misc.c [!PARALLEL_MARK] (GC_set_markers_count): Likewise. * os_dep.c [OPENBSD] (GC_fault_handler_openbsd): Likewise. * os_dep.c [NEED_FIND_LIMIT || WRAP_MARK_SOME && !MSWIN32 && !MSWINCE || USE_PROC_FOR_LIBRARIES && THREADS] (GC_fault_handler): Likewise. * os_dep.c [!HAVE_GET_STACK_BASE && !NEED_FIND_LIMIT] (GC_get_stack_base): Likewise. * os_dep.c [MPROTECT_VDB && DARWIN] (catch_exception_raise_state, catch_exception_raise_state_identity, catch_exception_raise): Likewise. * pthread_stop_world.c [!NACL && !GC_OPENBSD_UTHREADS && !SUSPEND_HANDLER_NO_CONTEXT] (GC_suspend_sigaction): Likewise. * pthread_stop_world.c [!NACL && !GC_OPENBSD_UTHREADS] (GC_suspend_handler_inner): Likewise. * pthread_support.c (GC_do_blocking_inner): Likewise. * pthread_support.c [GC_ENABLE_SUSPEND_THREAD && SIGNAL_BASED_STOP_WORLD] (GC_suspend_self_blocked): Likewise. * tests/gctest.c [!DBG_HDRS_ALL] (fail_proc1): Likewise. * tests/gctest.c [(MSWIN32 && !__MINGW32__ || MSWINCE) && !NO_WINMAIN_ENTRY] (WinMain): Likewise. * tests/gctest.c [!PCR && !GC_WIN32_THREADS && !GC_PTHREADS && CPPCHECK && RTEMS] (Init): Likewise. * tests/gctest.c [GC_WIN32_THREADS && !GC_PTHREADS] (thr_run_one_test): Likewise. * tests/gctest.c [MSWINCE] (thr_window): Likewise. * tests/gctest.c [GC_PTHREADS] (thr_run_one_test): Likewise. * typd_mlc.c (GC_array_mark_proc): Likewise. * win32_threads.c (GC_register_altstack, GC_do_blocking_inner): Likewise. * win32_threads.c [!GC_PTHREADS && !GC_NO_THREADS_DISCOVERY] (GC_DllMain): Likewise. * cord/cordxtra.c (CORD_ATTR_UNUSED): Remove. * include/private/gc_priv.h [!GC_ATTR_UNUSED] (GC_ATTR_UNUSED): Likewise. * cord/cordxtra.c (CORD_nul_func): Cast unused argument to void instead of using CORD_ATTR_UNUSED. * cord/cordxtra.c [!GC_NO_FINALIZATION] (CORD_lf_close_proc): Likewise. * include/private/gc_priv.h [!UNUSED_ARG] (UNUSED_ARG): Define macro.
* Support disable_single_obj_compilation option in cmake scriptIvan Maidanski2022-09-141-1/+2
| | | | | | | | | This works similar to configure --disable-single-obj-compilation. Has effect only if building the shared libraries. * CMakeLists.txt (disable_single_obj_compilation): New option. * CMakeLists.txt [BUILD_SHARED_LIBS] (SRC): Do not override with "extra/gc.c" value if disable_single_obj_compilation.
* Update shared objects version info to be not lower than in gc 8.2.2Ivan Maidanski2022-08-261-2/+2
| | | | | | | | | * CMakeLists.txt (LIBCORD_VER_INFO): Increment current and age (change version info of libcord.so to 6:0:5). * cord/cord.am (LIBCORD_VER_INFO): Likewise. * CMakeLists.txt (LIBGC_VER_INFO): Increment revision (change version info of libgc.so to 6:1:5). * Makefile.am (LIBGC_VER_INFO): Likewise.
* Set default build type to RelWithDebInfo (CMake)Ivan Maidanski2022-08-191-0/+9
| | | | | | | | | | | Issue #468 (bdwgc). This enforces -O2 -g options passed to the compiler (in case of the gcc or clang compiler), matching that of the configure-based build. * CMakeLists.txt [!CMAKE_BUILD_TYPE && !CMAKE_CONFIGURATION_TYPES] (CMAKE_BUILD_TYPE): Set to RelWithDebInfo; set property (listing all possible values).
* Link with rt library to get clock_gettime where necessaryIvan Maidanski2022-08-181-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | Issue #450 (bdwgc). This patch adds the logic to CMake and configure scripts to pass -lrt option during linking to avoid unresolved clock_gettime on some hosts. * CMakeLists.txt [!NEED_LIB_RT] (HAVE_CLOCK_GETTIME_DIRECTLY): Set variable by check_function_exists(clock_gettime). * CMakeLists.txt [!NEED_LIB_RT && !HAVE_CLOCK_GETTIME_DIRECTLY] (NEED_LIB_RT): Set to ON. * CMakeLists.txt (LIBRT): Refine comment. * CMakeLists.txt (gc): Specify target_link_libraries regardless of enable_threads. * Makefile.am (libgc_la_LIBADD): Update comment. * configure.ac (need_lib_rt): Define variable (and set to false). * configure.ac [$THREADS==pthreads && ($host==*-*-hpux11* || $host==*-*-netbsd* || $host== *-*-solaris* || $host==*-*-osf*)] (THREADDLLIBS): Do not add "-lrt" directly. * configure.ac [$THREADS==pthreads && ($host==*-*-hpux11* || $host==*-*-netbsd* || $host== *-*-solaris* || $host==*-*-osf*)] (need_lib_rt): Set to true. * configure.ac [!need_lib_rt && !AC_LINK_IFELSE(clock_gettime) && AC_CHECK_LIB(rt,clock_gettime)] (need_lib_rt): Set to true. * configure.ac [need_lib_rt] (THREADDLLIBS): Append "-lrt".
* Pass -lrt linker option in CMake script on HP/UX, NetBSD and SunOSIvan Maidanski2022-08-131-0/+13
| | | | | | | | | | | | | | (fix of commit 54769e69e) This is to match the relevant logic of configure. * CMakeLists.txt (NEED_LIB_RT): New variable. * CMakeLists.txt [CMAKE_USE_PTHREADS_INIT && ($host==.*-.*-hpux11.* || $host==.*-.*-netbsd.* || $CMAKE_C_COMPILER_ID STREQUAL==SunPro)] (NEED_LIB_RT): Set to ON (true). * CMakeLists.txt [NEED_LIB_RT] (LIBRT): Find library "rt". * CMakeLists.txt [NEED_LIB_RT && LIBRT] (THREADDLLIBS_LIST): Append $LIBRT.
* Update copyright information in alloc.c and other modified files (2022)Ivan Maidanski2022-05-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * CMakeLists.txt: Update year in copyright comment (2021 to 2022). * alloc.c: Likewise. * configure.ac: Likewise. * dyn_load.c: Likewise. * include/private/gc_priv.h: Likewise. * include/private/gcconfig.h: Likewise. * mallocx.c: Likewise. * mark.c: Likewise. * mark_rts.c: Likewise. * misc.c: Likewise. * os_dep.c: Likewise. * pthread_support.c: Likewise. * reclaim.c: Likewise. * tests/gctest.c: Likewise. * win32_threads.c: Likewise. * LICENSE: Update year (2021 to 2022). * allchblk.c: Add copyright line in header comment. * darwin_stop_world.c: Likewise. * dbg_mlc.c: Likewise. * gcj_mlc.c: Likewise. * headers.c: Likewise. * include/gc/gc_inline.h: Likewise. * include/gc/gc_mark.h: Likewise. * include/private/gc_locks.h: Likewise. * include/private/gc_pmark.h: Likewise. * include/private/pthread_stop_world.h: Likewise. * include/private/pthread_support.h: Likewise. * mach_dep.c: Likewise. * malloc.c: Likewise. * thread_local_alloc.c: Likewise. * typd_mlc.c: Likewise. * finalize.c: Update year in copyright comment (2020 to 2022). * include/gc/gc.h: Likewise. * pthread_stop_world.c: Likewise.
* Remove extra space after comma in license termsIvan Maidanski2022-05-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (reformatting) * CMakeLists.txt: Remove an extra space after comma in license header comment. * Makefile.am: Likewise. * allchblk.c: Likewise. * alloc.c: Likewise. * backgraph.c: Likewise. * blacklst.c: Likewise. * checksums.c: Likewise. * configure.ac: Likewise. * cord/cordbscs.c: Likewise. * cord/cordprnt.c: Likewise. * cord/cordxtra.c: Likewise. * cord/tests/cordtest.c: Likewise. * cord/tests/de.c: Likewise. * cord/tests/de_cmds.h: Likewise. * cord/tests/de_win.c: Likewise. * cord/tests/de_win.h: Likewise. * cord/tests/de_win.rc: Likewise. * darwin_stop_world.c: Likewise. * dbg_mlc.c: Likewise. * dyn_load.c: Likewise. * extra/gc.c: Likewise. * extra/msvc_dbg.c: Likewise. * extra/pcr_interface.c: Likewise. * extra/real_malloc.c: Likewise. * finalize.c: Likewise. * fnlz_mlc.c: Likewise. * gc_badalc.cc: Likewise. * gc_cpp.cc: Likewise. * gc_dlopen.c: Likewise. * gcj_mlc.c: Likewise. * headers.c: Likewise. * include/gc/cord.h: Likewise. * include/gc/cord_pos.h: Likewise. * include/gc/ec.h: Likewise. * include/gc/gc.h: Likewise. * include/gc/gc_backptr.h: Likewise. * include/gc/gc_config_macros.h: Likewise. * include/gc/gc_disclaim.h: Likewise. * include/gc/gc_gcj.h: Likewise. * include/gc/gc_inline.h: Likewise. * include/gc/gc_mark.h: Likewise. * include/gc/gc_pthread_redirects.h: Likewise. * include/gc/gc_tiny_fl.h: Likewise. * include/gc/gc_typed.h: Likewise. * include/gc/gc_version.h: Likewise. * include/gc/javaxfc.h: Likewise. * include/gc/leak_detector.h: Likewise. * include/include.am: Likewise. * include/private/darwin_semaphore.h: Likewise. * include/private/darwin_stop_world.h: Likewise. * include/private/dbg_mlc.h: Likewise. * include/private/gc_alloc_ptrs.h: Likewise. * include/private/gc_atomic_ops.h: Likewise. * include/private/gc_hdrs.h: Likewise. * include/private/gc_locks.h: Likewise. * include/private/gc_pmark.h: Likewise. * include/private/gc_priv.h: Likewise. * include/private/gcconfig.h: Likewise. * include/private/pthread_stop_world.h: Likewise. * include/private/pthread_support.h: Likewise. * include/private/specific.h: Likewise. * include/private/thread_local_alloc.h: Likewise. * m4/gc_set_version.m4: Likewise. * mach_dep.c: Likewise. * malloc.c: Likewise. * mallocx.c: Likewise. * mark.c: Likewise. * mark_rts.c: Likewise. * misc.c: Likewise. * new_hblk.c: Likewise. * obj_map.c: Likewise. * os_dep.c: Likewise. * pthread_start.c: Likewise. * pthread_stop_world.c: Likewise. * pthread_support.c: Likewise. * ptr_chck.c: Likewise. * reclaim.c: Likewise. * specific.c: Likewise. * tests/atomicops.c: Likewise. * tests/cpp.cc: Likewise. * tests/disclaim.c: Likewise. * tests/disclaim_bench.c: Likewise. * tests/gctest.c: Likewise. * tests/tests.am: Likewise. * tests/weakmap.c: Likewise. * thread_local_alloc.c: Likewise. * tools/setjmp_t.c: Likewise. * tools/threadlibs.c: Likewise. * typd_mlc.c: Likewise. * win32_threads.c: Likewise. * LICENSE: Remove an extra space after comma in license terms.
* Fix pthread_setname_np and dladdr detection by CMakeIvan Maidanski2022-04-231-1/+5
| | | | | | | | | | | | | (fix of commits 3a8028ff2, ecd488e02) check_c_source_compiles() compiles and links the provided code snippet (contrary to AC_COMPILE_IFELSE() in configure); the linking of the checked code is now suppressed by adding "-c" to CMAKE_REQUIRED_FLAGS. * CMakeLists.txt (CMAKE_REQUIRED_FLAGS): Set to "-c"; add comment. * CMakeLists.txt [!BORLAND && !MSVC && !WATCOM && HAVE_FLAG_WERROR] (CMAKE_REQUIRED_FLAGS): Append "-Werror" instead of overwriting the value.
* Name all tests consistentlyIvan Maidanski2022-02-071-46/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (refactoring) In brief, the tests naming as follows: all test executable files end with "test" (not "_test"); all test source files do not have "test" suffix (except for gctest); test.c is named now as gctest.c. * CMakeLists.txt: Rename leak_test.c to leak.c; rename huge_test.c to huge.c; rename leak_test.c to leak.c; rename realloc_test.c to realloc.c; rename smash_test.c to smash.c; rename staticrootslib.c to staticroots_lib.c; rename trace_test.c to trace.c; rename thread_leak_test.c to threadleak.c; rename threadkey_test to threadkey_test; rename threadkey_test.c to threadkey.c; rename subthreadcreate_test to subthreadcreatetest; rename subthread_create.c to subthreadcreate.c; rename initsecondarythread_test to initfromthreadtest; rename initsecondarythread.c to initfromthread.c; rename disclaim_test to disclaimtest; rename disclaim_test.c to disclaim.c; rename disclaim_weakmap_test to weakmaptest; rename disclaim_weakmap_test.c to weakmap.c. * tests/tests.am: Likewise. * CMakeLists.txt: Rename test.c to gctest.c; rename test_cpp to cpptest; rename test_cpp.cc to cpp.cc. * Makefile.direct: Likewise. * NT_MAKEFILE: Likewise. * README.md (Installation and Portability): Likewise. * WCC_MAKEFILE: Likewise. * digimars.mak: Likewise. * doc/README.Mac: Likewise. * tests/tests.am: Likewise. * CMakeLists.txt: rename test_atomic_ops.c to atomicops.c; rename test_atomic_ops to atomicopstest. * configure.ac [$with_libatomic_ops=check]: Likewise. * ChangeLog (8.3.0): Rename threadkey_test to threadkeytest; rename test_atomic_ops to atomicopstest; rename test_cpp to cpptest. * Makefile.direct: Rename test.o to gctest.o. * NT_MAKEFILE: Rename test_cpp.exe to cpptest.exe; rename test.obj to gctest.obj. * WCC_MAKEFILE: Likewise. * digimars.mak: Likewise. * doc/README.win64: Likewise. * configure.ac: Rename test_cpp to cpptest in comment. * doc/leak.md: Rename leak_test.c to leak.c. * tests/test_atomic_ops.c: Rename to atomicops.c; remove test name in "skipped" message. * tests/test_cpp.cc: Rename to cpp.cc; rename test_cpp to cpptest. * tests/disclaim_test.c: Rename to disclaim.c. * tests/test.c: Rename to gctest.c. * tests/huge_test.c: Rename to huge.c. * tests/initsecondarythread.c: Rename to initfromthread.c. * tests/leak_test.c: Rename to leak.c. * tests/realloc_test.c: Rename to realloc.c. * tests/smash_test.c: Rename to smash.c. * tests/staticrootstest.c: Rename to staticroots.c. * tests/staticrootslib.c: Rename to staticroots_lib.c. * tests/subthread_create.c: Rename to subthreadcreate.c; remove test name in printed messages. * tests/threadkey_test.c: Rename to threadkey.c; remove test name in "skipped" message. * tests/thread_leak_test.c: Rename to threadleak.c. * tests/trace_test.c: Rename to trace.c. * tests/disclaim_weakmap_test.c: Rename to weakmap.c; rename disclaim_test.c to disclaim.c in comment.
* Workaround gctest hang if test compiled as C++ code by MSVC (CMake)Ivan Maidanski2021-12-311-2/+5
| | | | | | * CMakeLists.txt [build_tests && enable_cplusplus && MSVC] (tests/test.c): Do not set source files LANGUAGE property to CXX; add comment.
* Support space-separated flags in CFLAGS_EXTRA passed to CMakeIvan Maidanski2021-12-231-1/+2
| | | | | | | (fix of commit b6ac6a5a4) * CMakeLists.txt [CFLAGS_EXTRA] (CFLAGS_EXTRA): Apply separate_arguments(UNIX_COMMAND).
* Compile pthread_start.c on Darwin again by CMake scriptIvan Maidanski2021-11-301-3/+6
| | | | | | | | | (fix of commit 6ccda3052) * CMakeLists.txt [CMAKE_USE_PTHREADS_INIT && !CYGWIN && !MSYS && APPLE] (SRC): Add pthread_start.c item again. * CMakeLists.txt [CMAKE_USE_PTHREADS_INIT && !CYGWIN && !MSYS] (SRC): Specify pthread_support.c once (avoid code duplication).
* Try find libatomic_ops installed by cmake if with_libatomic_ops (CMake)Ivan Maidanski2021-11-301-5/+17
| | | | | | | | | | | | | | | | | | | | * CMakeLists.txt (ATOMIC_OPS_LIBS_CMAKE): New variable. * CMakeLists.txt [enable_threads && with_libatomic_ops] (Atomic_ops): Call find_package(). * CMakeLists.txt [enable_threads && with_libatomic_ops && Atomic_ops_FOUND] (AO_INCLUDE_DIRS): Get target property from Atomic_ops::atomic_ops; pass it to include_directories and print it as status message. * CMakeLists.txt [enable_threads && with_libatomic_ops] (ATOMIC_OPS_LIBS_CMAKE): Set either to Atomic_ops::atomic_ops or to ${ATOMIC_OPS_LIBS}. * CMakeLists.txt [enable_threads] (gc): Use ${ATOMIC_OPS_LIBS_CMAKE} instead of ${ATOMIC_OPS_LIBS}. * CMakeLists.txt [build_tests] (gctest): Likewise. * CMakeLists.txt [build_tests && enable_threads] (test_atomic_ops, subthreadcreate_test): Likewise. * CMakeLists.txt [build_tests && enable_disclaim] (disclaim_weakmap_test): Likewise.
* Add _PROP suffix to CORD/GC[CPP]_VERSION variables in CMake scriptIvan Maidanski2021-11-301-10/+10
| | | | | | | | | | | (refactoring) * CMakeLists.txt [BUILD_SHARED_LIBS] (CORD_VERSION): Rename variable to CORD_VERSION_PROP. * CMakeLists.txt [BUILD_SHARED_LIBS] (GC_VERSION): Rename variable to GC_VERSION_PROP. * CMakeLists.txt [BUILD_SHARED_LIBS] (GCCPP_VERSION): Rename variable to GCCPP_VERSION_PROP.
* Enable without_libatomic_ops for targets requiring atomic_ops.c (CMake)Ivan Maidanski2021-11-301-20/+32
| | | | | | | | | | | This matches the functionality of configure --without-libatomic-ops. * CMakeLists.txt (NODIST_SRC): New variable. * CMakeLists.txt [without_libatomic_ops] (NODIST_SRC): Set variable (to libatomic_ops/src/atomic_ops.c, adding libatomic_ops/src/atomic_ops_sysdeps.S if SunPro); add comment. * CMakeLists.txt (add_executable): Add ${NODIST_SRC} to the list of test source files.
* Do not compile pthread_start.c, pthread_stop_world.c on Darwin (CMake)Ivan Maidanski2021-11-301-2/+3
| | | | | | | | | * CMakeLists.txt [CMAKE_USE_PTHREADS_INIT && APPLE] (SRC): Do not add pthread_start.c and pthread_stop_world.c; add darwin_stop_world.c before pthread_support.c item. * CMakeLists.txt [(enable_single_obj_compilation || BUILD_SHARED_LIBS) && CMAKE_USE_PTHREADS_INIT] (GC_PTHREAD_START_STANDALONE): Do not define C macro if APPLE.
* Do not compile pthread_start.c on Cygwin even if build shared libs (CMake)Ivan Maidanski2021-11-301-2/+2
| | | | | | | | | * CMakeLists.txt [(enable_single_obj_compilation || BUILD_SHARED_LIBS) && CMAKE_USE_PTHREADS_INIT] (GC_PTHREAD_START_STANDALONE): Do not define C macro if CYGWIN or MSYS. * CMakeLists.txt [(enable_single_obj_compilation || BUILD_SHARED_LIBS) && CMAKE_USE_PTHREADS_INIT] (SRC): Do not add pthread_start.c if CYGWIN or MSYS.
* New CMake option to link with external libatomic_ops (system library)Ivan Maidanski2021-11-301-9/+18
| | | | | | | | | | | | | | | | | | | | | | | | | This option (-Dwith_libatomic_ops=ON) is provided to match configure --with-libatomic-ops=yes option. * CMakeLists.txt (with_libatomic_ops): New option. * CMakeLists.txt (ATOMIC_OPS_LIBS): Move initial assignment upper (to be near THREADDLLIBS_LIST one); remove TODO. * CMakeLists.txt [enable_threads && with_libatomic_ops && without_libatomic_ops] (FATAL_ERROR): Print a message that with_libatomic_ops and without_libatomic_ops cannot be specified together. * CMakeLists.txt [enable_threads && with_libatomic_ops] (ATOMIC_OPS_LIBS): Set to "-latomic_ops". * CMakeLists.txt [enable_threads && with_libatomic_ops] (GC_BUILTIN_ATOMIC): Do not define; do noy include libatomic_ops/src. * CMakeLists.txt [enable_threads] (gc): Specify ATOMIC_OPS_LIBS before THREADDLLIBS_LIST. * CMakeLists.txt [build_tests] (gctest): Specify ATOMIC_OPS_LIBS to link with. * CMakeLists.txt [build_tests && enable_threads] (test_atomic_ops, subthreadcreate_test): Likewise. * CMakeLists.txt [build_tests && enable_disclaim] (disclaim_weakmap_test): Likewise.
* Add CMake option to force libatomic_ops headers usageIvan Maidanski2021-11-271-3/+8
| | | | | | | | | | | | | | If -Dwithout_libatomic_ops=ON is passed to cmake or MS VC (or similar) compiler is used, then libatomic_ops/src is set as an additional include directory. Otherwise, GC_BUILTIN_ATOMIC macro is defined. * CMakeLists.txt (without_libatomic_ops): New option. * CMakeLists.txt [enable_threads] (libatomic_ops/src): Include only if without_libatomic_ops or BORLAND or MSVC or WATCOM; add comment. * CMakeLists.txt [enable_threads && !without_libatomic_ops && !BORLAND && !MSVC && !WATCOM] (GC_BUILTIN_ATOMIC): Define C macro only. * CMakeLists.txt [CMAKE_USE_PTHREADS_INIT] (GC_BUILTIN_ATOMIC): Remove C macro definition.
* Remove doc.am and move gc.man to base folderIvan Maidanski2021-11-251-2/+1
| | | | | | | | | | | | | | | (refactoring) This is to eliminate non-dist-doc files in doc folder. * CMakeLists.txt [enable_docs] (doc/gc.man): Rename to gc.man. * Makefile.am [ENABLE_DOCS] (dist_man3_MANS): Likewise. * Makefile.direct (BSD-pkg-install): Likewise. * Makefile.am: Do not include doc/doc.am. * Makefile.am [ENABLE_DOCS] (dist_doc_DATA, dist_man3_MANS): Copy assignment from doc.am. * doc/doc.am: Remove. * doc/gc.man: Rename to gc.man.
* Move public header files to include/gc in source treeIvan Maidanski2021-11-251-21/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also, include/extra public header files (for the redirection) are moved to include directory. This is have the same directories structure of public headers in the source tree as that of the installed "include" directory. * doc/finalization.md: Remove "include/" prefix for cord.h. * LICENSE: Rename include/gc_allocator.h to gc/gc_allocator.h. * Makefile.direct (CORD_SRCS, CORD_INCLUDE_FILES): Add "gc/" prefix for cord.h, ec.h, cord_pos.h. * CMakeLists.txt [install_headers]: Likewise. * cord/cord.am (pkginclude_HEADERS): Likewise. * Makefile.direct (SRCS, tests/test.o, dyn_load.o, dyn_load_sunos53.o, mark.o, typd_mlc.o, finalize.o, ptr_chck.o, specific.o, alloc.o, pthread_support.o, thread_local_alloc.o, win32_threads.o): Add "gc/" prefix for gc_typed.h, gc_tiny_fl.h, gc_version.h, gc_inline.h, gc_mark.h, gc_disclaim.h, gc_allocator.h, javaxfc.h, gc_backptr.h, gc_gcj.h, leak_detector.h, gc_pthread_redirects.h, gc_config_macros.h. * NT_MAKEFILE (test.obj): Add gc\ prefix for gc_mark.h, gc_disclaim.h. * NT_MAKEFILE (cord\tests\de.obj, cord\tests\de_win.obj): Add gc\ prefix for cord.h, cord_pos.h. * OS2_MAKEFILE (cord\cordbscs.obj, cord\cordxtra.obj, cord\cordprnt.obj, cordtest.exe): Likewise. * cord/cordbscs.c: Add "gc/" prefix in include for cord.h, ec.h; reorder includes. * cord/cordprnt.c: Likewise. * cord/cordxtra.c: Likewise. * cord/tests/cordtest.c: Likewise. * cord/tests/de.c: Likewise. * cord/tests/de_win.c: Likewise. * extra/gc.c: Add "gc/" prefix in include for gc_inline.h, gc_pthread_redirects.h, javaxfc.h, gc_disclaim.h, gc_gcj.h, gc_backptr.h, gc_mark.h, gc_tiny_fl.h, leak_detector.h., gc_typed.h. * finalize.c: Likewise. * fnlz_mlc.c: Likewise. * gcj_mlc.c: Likewise. * include/private/dbg_mlc.h: Likewise. * include/private/gc_pmark.h: Likewise. * include/private/gc_priv.h: Likewise. * include/private/thread_local_alloc.h: Likewise. * malloc.c: Likewise. * mallocx.c: Likewise. * pthread_stop_world.c: Likewise. * pthread_support.c: Likewise. * reclaim.c: Likewise. * tests/disclaim_bench.c: Likewise. * tests/disclaim_test.c: Likewise. * tests/disclaim_weakmap_test.c: Likewise. * tests/leak_test.c: Likewise. * tests/staticrootstest.c: Likewise. * tests/test.c: Likewise. * tests/thread_leak_test.c: Likewise. * tests/trace_test.c: Likewise. * thread_local_alloc.c: Likewise. * typd_mlc.c: Likewise. * tests/test_cpp.cc: Add "gc/" prefix in include for gc_allocator.h. * include/extra/gc.h: Move to include folder; replace include<> to include "". * include/extra/gc_cpp.h: Likewise. * include/cord.h: Move to include/gc folder. * include/cord_pos.h: Likewise. * include/ec.h: Likewise. * include/gc.h: Likewise. * include/gc_allocator.h: Likewise. * include/gc_backptr.h: Likewise. * include/gc_config_macros.h: Likewise. * include/gc_cpp.h: Likewise. * include/gc_disclaim.h: Likewise. * include/gc_gcj.h: Likewise. * include/gc_inline.h: Likewise. * include/gc_mark.h: Likewise. * include/gc_pthread_redirects.h: Likewise. * include/gc_tiny_fl.h: Likewise. * include/gc_typed.h: Likewise. * include/gc_version.h: Likewise. * include/javaxfc.h: Likewise. * include/leak_detector.h: Likewise. * include/include.am (pkginclude_HEADERS): Add "gc/" prefix for gc.h, gc_backptr.h, gc_config_macros.h, gc_inline.h, gc_mark.h, gc_tiny_fl.h, gc_typed.h, gc_version.h, javaxfc.h, leak_detector.h, gc_disclaim.h, gc_gcj.h, gc_pthread_redirects.h, gc_allocator.h, gc_cpp.h. * CMakeLists.txt [install_headers]: Likewise. * include/include.am (include_HEADERS): Remove "extra/" prefix for gc_cpp.h, gc.h. * CMakeLists.txt [install_headers]: Likewise.
* Put gc_badalc/cpp.cpp instead of .cc ones in CMake script (MSVC/BCC/WCC)Ivan Maidanski2021-11-241-2/+10
| | | | | | | | | | This is for testing purpose mostly. * CMakeLists.txt [enable_cplusplus && (BORLAND || MSVC || WATCOM)] (gccpp): Add .cpp files instead of .cc ones. * CMakeLists.txt [enable_cplusplus && (BORLAND || MSVC || WATCOM) && enable_throw_bad_alloc_library] (gctba): Likewise.
* Rename README.QUICK to LICENSE and install it by defaultIvan Maidanski2021-11-231-2/+1
| | | | | | | | | | | | | | README.QUICK contains the package copyright and licensing terms, it is more natural to name the file as LICENSE. * CMakeLists.txt [enable_docs] (install): Add LICENSE for $CMAKE_INSTALL_DOCDIR; remove note that README.QUICK is not installed. * README.QUICK: Rename to LICENSE. * Makefile.am (EXTRA_DIST): Do not add README.QUICK. * README.md (Copyright & Warranty, Contributors): Rename README.QUICK to LICENSE. * doc/README.DGUX386: Refer to README.md instead of README.QUICK. * doc/doc.am [ENABLE_DOCS] (dist_doc_DATA): Add LICENSE.
* Relax required dependencies for test_atomic_ops (CMake)Ivan Maidanski2021-11-081-1/+1
| | | | | * CMakeLists.txt [build_tests && enable_threads] (test_atomic_ops): Specify dependency on ${THREADDLLIBS_LIST} instead of "gc".
* Do not name GCC intrinsics as C11 onesIvan Maidanski2021-10-301-1/+1
| | | | | | | | | | * CMakeLists.txt (GC_BUILTIN_ATOMIC): Do not mention C11 in comment (or documentation) when referring to GCC intrinsics. * configure.ac (GC_BUILTIN_ATOMIC): Likewise. * include/private/gc_atomic_ops.h: Likewise. * ChangeLog (8.0.0): Do not mention C11 when referring to GCC intrinsics. * doc/README.macros (GC_BUILTIN_ATOMIC): Likewise.
* Bump libgc version (for the development of 8.4 release)Ivan Maidanski2021-09-291-1/+1
| | | | | | | | | | * README.md: Restore build status badges (Travis, AppVeyor, Codecov, Coveralls, Coverity, LGTM, Hits-of-Code, Lines of code, GitHub code size, Github All Releases). * CMakeLists.txt (PACKAGE_VERSION): Bump package version to 8.3.0. * README.md: Likewise. * configure.ac (AC_INIT): Likewise. * include/gc_version.h (GC_TMP_VERSION_MINOR): Likewise.
* [8.2.0]v8.2.0Ivan Maidanski2021-09-291-2/+2
| | | | | | | | | | | | | | | | | | | Bump gc version to 8.2.0 (experimental release) * ChangeLog (8.2.0): Set release date. * CMakeLists.txt (PACKAGE_VERSION): Bump minor version and set micro to 0 (change package version to 8.2.0). * README.md: Likewise. * configure.ac (AC_INIT): Likewise. * include/gc_version.h (GC_TMP_VERSION_MINOR, GC_TMP_VERSION_MICRO): Likewise. * CMakeLists.txt (LIBGCCPP_VER_INFO): Increment current and age (change version info of libgccpp.so to 6:0:5). * Makefile.am (LIBGCCPP_VER_INFO): Likewise. * README.md: Remove build status badges (Travis, AppVeyor, Codecov, Coveralls, Coverity, LGTM). * doc/README.cmake (HOW TO IMPORT BDWGC): Update BDWgc version in the sample.
* Turn on automatic fork() handling by default on AndroidIvan Maidanski2021-09-181-2/+2
| | | | | | | | | | | Note: pthread_atfork() is available in Android NDK since API level 21. * CMakeLists.txt [CMAKE_USE_PTHREADS_INIT && !MSYS && !APPLE && $enable_handle_fork && !$disable_handle_fork] (HANDLE_FORK): Define macro (even for Android). * configure.ac [$enable_handle_fork!=yes && $enable_handle_fork!=no && $enable_handle_fork!=manual && $THREADS==xposix && $host==*-*-android*] (HANDLE_FORK): Define AC macro.
* Update copyright information in alloc.c and other modified files (2021)Ivan Maidanski2021-09-091-0/+1
| | | | | | | | | | | | | | | | | | | | | * README.QUICK (Copyright): Update year (2019 to 2020). * README.md (Copyright): Likewise. * alloc.c (Copyright, GC_copyright): Likewise. * configure.ac (Copyright): Likewise. * include/private/gc_priv.h (Copyright): Likewise. * mark.c (Copyright): Likewise. * misc.c (Copyright): Likewise. * os_dep.c (Copyright): Likewise. * pthread_support.c (Copyright): Likewise. * win32_threads.c (Copyright): Likewise. * CMakeLists.txt: Update (add Ivan Maidanski). * dyn_load.c (Copyright): Likewise. * include/private/gc_alloc_ptrs.h (Copyright): Likewise. * include/private/gcconfig.h (Copyright): Likewise. * mallocx.c (Copyright): Likewise. * mark_rts.c (Copyright): Likewise. * reclaim.c (Copyright): Likewise. * tests/test.c (Copyright): Likewise.
* Avoid dirty_init warn of incremental mode incompatible with fork on DarwinIvan Maidanski2021-09-061-6/+2
| | | | | | | | | | | | | | | | | | | (fix of commit 3c571c7ad) Issue #151 (bdwgc). To both support GC incremental mode and GC functions usage in the forked child, pthread_atfork should be used to install handlers that switch off GC_incremental in the child gracefully. For now, we just disable incremental mode if fork() handling is requested by client. Previously, GC incremental mode was disabled if parallel marker is on. * CMakeLists.txt [APPLE && enable_handle_fork && !disable_handle_fork && enable_parallel_mark] (HANDLE_FORK): Do not define; update comment. * configure.ac [$enable_handle_fork!=yes && $enable_handle_fork!=no && $enable_handle_fork!=manual && $THREADS==posix && $host==*-*-darwin* && $use_parallel_mark!=no] (HANDLE_FORK): Likewise.
* Install gc_gcj.h and gc_pthread_redirects.h only if appropriateIvan Maidanski2021-07-261-2/+8
| | | | | | | | | | | | | | | | | | | gc_gcj.h should not be installed if support for gcj is off. gc_pthread_redirects.h should not be installed if threads support is off or not based on pthread library. * CMakeLists.txt [install_headers] (FILES): Install include/gc_gcj.h only if enable_gcj_support; install include/gc_pthread_redirects.h only if enable_threads AND CMAKE_USE_PTHREADS_INIT. * Makefile.am (libgc_la_SOURCES): Remove gcj_mlc.c unless ENABLE_GCJ_SUPPORT. * Makefile.am [PTHREADS] (pkginclude_HEADERS): Add include/gc_pthread_redirects.h. * Makefile.am [ENABLE_GCJ_SUPPORT] (pkginclude_HEADERS): Add include/gc_gcj.h. * configure.ac (ENABLE_GCJ_SUPPORT): New AM conditional. * include/include.am (pkginclude_HEADERS): Remove gc_gcj.h and gc_pthread_redirects.h.
* Do not compile pthread_*.c files in Cygwin or MSYS (CMake)Ivan Maidanski2021-07-251-5/+6
| | | | | | * CMakeLists.txt [CMAKE_USE_PTHREADS_INIT] (SRC): Do not add pthread_start.c, pthread_stop_world.c, pthread_support.c if CYGWIN or MSYS.
* Fix THREADDLLIBS passed to target_link_librariesIvan Maidanski2021-07-111-13/+16
| | | | | | | | | | | | (fix of commit 292d98e0b) Issue #356 (bdwgc). * CMakeLists.txt (THREADDLLIBS): Rename to THREADDLLIBS_LIST. * CMakeLists.txt [enable_threads] (THREADDLLIBS_LIST): Do not use quotes. * CMakeLists.txt (THREADDLLIBS): Generate space-separated value from THREADDLLIBS_LIST.
* Make Libs elements space-separated in bdw-gc.pc when generated by CMakeSteve Youngs2021-07-101-2/+2
| | | | | | | | | (fix of commit fe4ed5af3) Issue #356 (bdwgc). * CMakeLists.txt [enable_threads] (THREADDLLIBS): Put the value in quotes.
* Export CMake targets with namespace BDWgcSteve Youngs2021-07-081-6/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #327 (bdwgc). Create and install CMake support files: export all targets to BDWgcTargets; install the BDWgcTargets.cmake file with namespace BDWgc. * CMakeLists.txt: Include CMakePackageConfigHelpers. * CMakeLists.txt (gc): Specify target_include_directories. * CMakeLists.txt [enable_cplusplus] (gccpp): Likewise. * CMakeLists.txt [enable_cplusplus && enable_throw_bad_alloc_library] (gctba): Likewise. * CMakeLists.txt [build_cord] (cord): Likewise. * CMakeLists.txt [build_cord] (cord): Change install export to BDWgcTargets (export all targets to "BDWgcTargets" instead of separate exports). * CMakeLists.txt (gc): Likewise. * CMakeLists.txt [enable_cplusplus] (gccpp): Likewise. * CMakeLists.txt [enable_cplusplus && enable_throw_bad_alloc_library] (gctba): Likewise. * CMakeLists.txt (BDWgcTargets): Specify export (BDWgcTargets.cmake) with namespace "BDWgc". * CMakeLists.txt (Config.cmake.in): Specify configure package config file and write basic package version file. * CMakeLists.txt (BDWgcConfig.cmake, BDWgcConfigVersion.cmake): Specify install. * Config.cmake.in: New file (used to create BDWgcConfig.cmake). * Makefile.am (EXTRA_DIST): Add Config.cmake.in item. * doc/README.cmake (HOW TO IMPORT BDWGC): Add documentation section.
* Set so-version for installed shared libraries (CMake)Steve Youngs2021-07-081-0/+47
| | | | | | | | | | | | | | | | | | | | | | | Issue #356 (bdwgc). * CMakeLists.txt (LIBCORD_VER_INFO): Define variable (same value as of that in cord/cord.am). * CMakeLists.txt (LIBGC_VER_INFO, LIBGCCPP_VER_INFO): Define variable (same value as of that in Makefile.am). * CMakeLists.txt [BUILD_SHARED_LIBS] (cord_cur, cord_rev, cord_age, CORD_SOVERSION, CORD_VERSION, gc_cur, gc_rev, gc_age, GC_SOVERSION, GC_VERSION, gccpp_cur, gccpp_rev, gccpp_age, GCCPP_SOVERSION, GCCPP_VERSION): Define variable (based on LIBCORD_VER_INFO and LIBGC[CPP]_VER_INFO). * CMakeLists.txt [BUILD_SHARED_LIBS] (CORD_VERSION, GC_VERSION, GCCPP_VERSION): Output value in status message. * CMakeLists.txt [build_cord && BUILD_SHARED_LIBS] (cord): Set [SO]VERSION target property. * CMakeLists.txt [BUILD_SHARED_LIBS] (gc): Likewise. * CMakeLists.txt [enable_cplusplus && BUILD_SHARED_LIBS] (gccpp): Likewise. * CMakeLists.txt [enable_cplusplus && enable_throw_bad_alloc_library && BUILD_SHARED_LIBS] (gctba): Likewise.
* Generate pkg-config metadata file (CMake)Steve Youngs2021-07-081-2/+18
| | | | | | | | | | | | | | | | | | Issue #356 (bdwgc). bdw-gc.pc file is generated and copied to $libdir/pkgconfig/ but only if enable_threads (on by default). * CMakeLists.txt (PACKAGE_VERSION): Define variable (to 8.1.0, same as in configure.ac). * CMakeLists.txt (install_headers): Update description. * CMakeLists.txt (ATOMIC_OPS_LIBS): Define to empty; add TODO item. * CMakeLists.txt [enable_threads] (target_link_libraries(gc)): Add $ATOMIC_OPS_LIBS. * CMakeLists.txt [install_headers] (prefix, exec_prefix, libdir, includedir): Define variable. * CMakeLists.txt [install_headers]: Generate bdw-gc.pc file (using configure_file) and install it.
* Install docs and man page if enable_docs (CMake)Steve Youngs2021-07-081-0/+14
| | | | | | | | | | | Issue #356 (bdwgc). * CMakeLists.txt (enable_docs): New option. * CMakeLists.txt [enable_docs]: Install AUTHORS, README.md to ${CMAKE_INSTALL_DOCDIR}. * CMakeLists.txt [enable_docs]: Install README.* and *.md from "doc/" folder to ${CMAKE_INSTALL_DOCDIR}. * CMakeLists.txt [enable_docs]: Install doc/gc.man (as "gc.3").