Ivan Maidanski [Sat, 22 Apr 2017 06:58:56 +0000 (09:58 +0300)]
.gitignore: Ignore cord/tests/de_win.rbj
Ivan Maidanski [Sat, 22 Apr 2017 06:57:36 +0000 (09:57 +0300)]
Move de_win compiled resource files to cord/tests
* NT_MAKEFILE (cord\de_win.rbj, cord\de_win.res, cord\de.exe): Rename
cord\de_win.rbj to cord\tests\de_win.rbj; rename cord\de_win.res to
cord\tests\de_win.res.
* NT_MAKEFILE (clean): Rename cord\*.rbj to cord\tests\*.rbj; rename
cord\*.res to cord\tests\*.res.
Ivan Maidanski [Sat, 22 Apr 2017 06:32:17 +0000 (09:32 +0300)]
Fix tests crash caused by insufficient stack size (NT_MAKEFILE)
(fix commit 8312098)
* NT_MAKEFILE: Refine title comment (list the variables affecting
build configuration).
* NT_MAKEFILE (CPU): Define (uncomment) variable.
* NT_MAKEFILE (LINK_DLL_FLAGS): Remove uuid.lib (not needed).
* NT_MAKEFILE (gctest.exe, cord\de.exe, test_cpp.exe): Remove -stack
option (to use the default stack size); add /MACHINE:$(CPU) option.
Ivan Maidanski [Fri, 21 Apr 2017 21:28:35 +0000 (00:28 +0300)]
Eliminate 'possible loss of data' MS VC warning in disclaim_and_reclaim
* reclaim.c [ENABLE_DISCLAIM] (GC_disclaim_and_reclaim): Change type
of bit_no local variable from int to word (matching that in other
GC_reclaim_* functions).
Ivan Maidanski [Fri, 21 Apr 2017 10:24:42 +0000 (13:24 +0300)]
Collapse multiple NT_*_MAKEFILE scripts into a single NT_MAKEFILE
Now NT_MAKEFILE should support building of static and dynamic,
single- and multi-threaded, 32- and 64-bit GC libraries.
The default is dynamic multi-threaded GC library.
* NT_MAKEFILE: Remove comment about assuming a single thread.
* NT_MAKEFILE (MY_CPU): Replace with CVTRES_CPU; add comment; add
sample for X64.
* NT_MAKEFILE (CPU): Comment out (defined automatically).
* NT_MAKEFILE (CFLAGS_SPECIFIC, GC_DLL, GC_LIB, LINK_GC): New variable;
add samples for X64, static, single-threaded library.
* NT_MAKEFILE (LINK_DLL_FLAGS): New variable (copied from LINK64_FLAGS
of NT_X64_THREADS_MAKEFILE file); remove unneeded system .lib files.
* NT_MAKEFILE (AO_SRC_DIR, AO_INCLUDE_DIR): New variable (copied from
NT_STATIC_THREADS_MAKEFILE file).
* NT_MAKEFILE (OBJS): Add win32_threads.obj, thread_local_alloc.obj.
* NT_MAKEFILE (.c.obj, .cpp.obj): Add -I$(AO_INCLUDE_DIR) option;
replace $(cvars) with $(CFLAGS_SPECIFIC); add /wd4100 /wd4127 /wd4701
options (copied from NT_X64_THREADS_MAKEFILE).
* NT_MAKEFILE (.c.obj): Add -DCORD_NOT_DLL option (copied from
NT_X64_THREADS_MAKEFILE); Add comment about _CRT_SECURE_NO_DEPRECATE
(copied from NT_X64_STATIC_THREADS_MAKEFILE file).
* NT_MAKEFILE (gc_cpp.cpp): Remove target.
* NT_MAKEFILE (gc.lib, gctest.exe, cord\de.exe, test_cpp.exe): Replace
gc.lib with $(GC_LIB).
* NT_MAKEFILE (gc.lib): Replace "lib /MACHINE:i386 /out:gc.lib" with
"$(LINK_GC) /MACHINE:$(CPU)"; remove comment about original NT SDK.
* NT_MAKEFILE (gctest.exe): Remove comments related to win32s.
* NT_MAKEFILE (gctest.exe, cord\de.exe, test_cpp.exe): Replace
"-debug -debugtype:cv" options with $(ldebug).
* NT_MAKEFILE ($(AO_SRC_DIR), clean): New target (copied from
NT_X64_THREADS_MAKEFILE file).
* NT_STATIC_THREADS_MAKEFILE: Remove.
* NT_X64_STATIC_THREADS_MAKEFILE: Likewise.
* NT_X64_THREADS_MAKEFILE: Likewise.
Ivan Maidanski [Thu, 20 Apr 2017 21:54:16 +0000 (00:54 +0300)]
Eliminate 'locally defined symbol imported' MS linker warnings (cord)
* NT_X64_THREADS_MAKEFILE (.c.obj): Add -DCORD_NOT_DLL option.
* include/cord.h [GC_DLL] (CORD_API): Define to "extern" if CORD_NOT_DLL.
Ivan Maidanski [Thu, 20 Apr 2017 21:22:10 +0000 (00:22 +0300)]
Prevent multiple 'Caught ACCESS_VIOLATION in marker' per collection
* mark.c [WRAP_MARK_SOME] (GC_mark_some): Do not call WARN() about
ACCESS_VIOLATION more than once per garbage collection.
Ivan Maidanski [Thu, 20 Apr 2017 21:15:14 +0000 (00:15 +0300)]
Suppress MS VC warnings about unused param, const condition (NT_MAKEFILE)
* NT_X64_STATIC_THREADS_MAKEFILE (.c.obj): Add /wd4100 /wd4127 options
(to suppress "unreferenced formal parameter" and
"conditional expression is constant" compiler warnings).
* NT_X64_THREADS_MAKEFILE (.c.obj): Likewise.
Ivan Maidanski [Thu, 20 Apr 2017 09:05:29 +0000 (12:05 +0300)]
Remove all generated files by NT_X64_THREADS_MAKEFILE 'clean' target
* NT_X64_THREADS_MAKEFILE (clean): Delete also .exe, .log, .pdb, .exp,
.lib, .obj, .rbj, .res, *.dll, test_cpp.cpp files in cord, cord\tests,
extra, tests folders; redirect stderr for "del" utility to nul.
Ivan Maidanski [Thu, 20 Apr 2017 08:50:03 +0000 (11:50 +0300)]
Eliminate 'possible loss of data' compiler warnings in cord (MS VC)
* cord/cordbscs.c (CORD_cat_char_star, CORD_cat, CORD_from_fn_inner):
Add explicit cast in assignment of result->depth, result->len.
* cord/cordbscs.c (CORD_substr_checked): Change type of "j", "lim"
local variables from int to size_t.
* cord/cordbscs.c (CORD_init_min_len): Add explicit cast (to int) in
assignment of CORD_max_len.
* cord/cordxtra.c (CORD_ncmp): Add explicit cast (to long) when "avail"
local variable is updated.
* cord/cordxtra.c (CORD_chr, CORD_rchr, CORD_from_file_eager): Add
explicit cast to char (from int) for "c" local variable in assignment
of d.target and in CORD_ec_append call.
* cord/cordxtra.c (refill_cache): Add explicit cast to long (from
size_t) for line_start in fseek call.
* cord/tests/de.c (line_pos, fix_pos, do_command): Add explicit cast to
int in assignment of *c, line, col.
* cord/tests/de.c (do_command): Reset line, col and file_pos variables
(of different types) in separate statements.
* cord/tests/de_win.c (WinMain): Add explicit cast of msg.wParam to int
in return statement.
Ivan Maidanski [Thu, 20 Apr 2017 08:26:11 +0000 (11:26 +0300)]
Eliminate 'signed/unsigned mismatch' compiler warning in gctest (MS VC)
(fix commit 014d92d)
* tests/test.c (bm_huge): Add explicit casts of GC_signed_word values
to GC_word.
Ivan Maidanski [Thu, 20 Apr 2017 08:17:20 +0000 (11:17 +0300)]
Eliminate 'unused formal parameter' compiler warnings in C++ code (MS VC)
* include/gc_allocator.h (GC_ATTR_UNUSED): Remove.
* tests/test_cpp.cc (ATTR_UNUSED): Likewise.
* include/gc_allocator.h (gc_allocator::deallocate,
gc_allocator_ignore_off_page::deallocate,
traceable_allocator::deallocate): Comment out unused argument name
instead of using GC_ATTR_UNUSED.
* include/gc_cpp.h [_MSC_VER && !GC_DEBUG] (operator new): Comment out
unused argument names.
* tests/test_cpp.cc [(MSWIN32 && !__MINGW32__ || MSWINCE)
&& !NO_WINMAIN_ENTRY] (WinMain): Comment out unused argument names
instead of using ATTR_UNUSED.
Ivan Maidanski [Wed, 19 Apr 2017 21:17:55 +0000 (00:17 +0300)]
.gitignore: Ignore auto-generated test_cpp.cpp
Ivan Maidanski [Wed, 19 Apr 2017 08:43:36 +0000 (11:43 +0300)]
Remove version info in 'de' cord test application
This version (4.1) is outdated and not needed (as it is a test app).
* cord/tests/de_win.rc (ABOUTBOX): Remove information about "de" test
application version.
* cord/tests/de_win.rc: Remove the commented out description adding
"de" icon.
Ivan Maidanski [Wed, 19 Apr 2017 08:27:47 +0000 (11:27 +0300)]
Expand tabs to spaces in de_win.rc (tests)
* cord/tests/de_win.rc: Expand tabs to spaces; remove duplicate blank
lines.
Ivan Maidanski [Tue, 18 Apr 2017 08:42:06 +0000 (11:42 +0300)]
Fix AO_SRC_DIR target name in NT_*_MAKEFILE
* NT_STATIC_THREADS_MAKEFILE (AO_SCR_DIR): Rename target to
$(AO_SRC_DIR).
* NT_X64_STATIC_THREADS_MAKEFILE (AO_SCR_DIR): Likewise.
* NT_X64_THREADS_MAKEFILE (AO_SCR_DIR): Likewise.
Ivan Maidanski [Tue, 18 Apr 2017 08:37:26 +0000 (11:37 +0300)]
Fix a typo in comment in NT_MAKEFILE
* NT_MAKEFILE (gctest.exe): Fix typo ("application") in comment.
* NT_STATIC_THREADS_MAKEFILE (gctest.exe): Likewise.
* NT_X64_STATIC_THREADS_MAKEFILE (gctest.exe): Likewise.
* NT_X64_THREADS_MAKEFILE (gctest.exe): Likewise.
Ivan Maidanski [Mon, 17 Apr 2017 07:32:32 +0000 (10:32 +0300)]
Refine Makefile.direct comment about multi-threaded GC build
* Makefile.direct (CFLAGS): Refine comment how to build multi-threaded
collector in a general case.
Ivan Maidanski [Thu, 13 Apr 2017 16:19:00 +0000 (19:19 +0300)]
Eliminate 'incompatible function pointer' warning in mark_some (MinGW/x86)
* include/private/gc_priv.h [__MINGW32__ && __i386__ && GC_EXTERN]
(__MINGW_EXCPT_DEFINE_PSDK): Define (before any system header include);
this macro definition is needed only when extra/gc.c is compiled.
* mark.c [__MINGW32__ && __i386__] (__MINGW_EXCPT_DEFINE_PSDK): Define
(before include gc_pmark.h).
Ivan Maidanski [Thu, 13 Apr 2017 15:33:20 +0000 (18:33 +0300)]
Update AUTHORS file (add Ryan Gonzalez)
Ryan Gonzalez [Thu, 13 Apr 2017 15:31:00 +0000 (18:31 +0300)]
Fix crash in FirstDLOpenedLinkMap if app linked statically (Alpine Linux)
Issue #154 (bdwgc).
* dyn_load.c [SOLARISDL && !USE_PROC_FOR_LIBRARIES]
(GC_FirstDLOpenedLinkMap): Do not dereference d_un.d_ptr if it is null.
* dyn_load.c [(SCO_ELF || DGUX || HURD || LINUX || FREEBSD || NACL
|| NETBSD || OPENBSD) && !USE_PROC_FOR_LIBRARIES]
(GC_FirstDLOpenedLinkMap): Likewise.
Ivan Maidanski [Thu, 13 Apr 2017 08:20:34 +0000 (11:20 +0300)]
Update ChangeLog file
Ivan Maidanski [Wed, 12 Apr 2017 22:07:27 +0000 (01:07 +0300)]
Update ChangeLog file (v7.6 changes only)
Ivan Maidanski [Wed, 12 Apr 2017 07:15:05 +0000 (10:15 +0300)]
Update ChangeLog file (v7.2 - v7.4 changes only)
Ivan Maidanski [Wed, 5 Apr 2017 20:49:23 +0000 (23:49 +0300)]
Travis CI: Test also with mingw-w64 32/64-bit cross-compilers
Ivan Maidanski [Wed, 5 Apr 2017 08:18:36 +0000 (11:18 +0300)]
Travis CI: Replace MAKEFILE_EXTRA_TARGETS with MAKEFILE_TARGETS
(refactor commits fd3002d, 3891855, 0b814a8)
Ivan Maidanski [Wed, 5 Apr 2017 08:01:48 +0000 (11:01 +0300)]
ChangeLog: remove trailing dots
Ivan Maidanski [Fri, 31 Mar 2017 15:46:43 +0000 (18:46 +0300)]
Fix 'implicit declaration of pthread_sigmask' compiler warning
(fix commit 1554297)
* include/gc_pthread_redirects.h [GC_NO_PTHREAD_SIGMASK]: Include
signal.h even GC_pthread_sigmask is not declared (otherwise
pthread_sigmask is redefined to GC_pthread_sigmask first and then
signal.h is included thus causing REAL(pthread_sigmask) to stay
undefined).
* include/gc_pthread_redirects.h [GC_NO_PTHREAD_SIGMASK]
(GC_pthread_sigmask): Define it also if _BSD_SOURCE or _GNU_SOURCE.
* tests/test.c [CPPCHECK] (GC_PTHREAD_SIGMASK_NEEDED): Do not define
(because defining _GNU_SOURCE is sufficient to have GC_pthread_sigmask
declared).
* tests/test.c [CPPCHECK] (_GNU_SOURCE): Do not define unless GC_PTHREADS.
Ivan Maidanski [Thu, 30 Mar 2017 22:18:33 +0000 (01:18 +0300)]
Travis CI: Use 'dist:trusty' for build with -std=c11 flag
(fix commit 47483e7)
Ivan Maidanski [Thu, 30 Mar 2017 21:11:04 +0000 (00:11 +0300)]
Fix gc.h compliance to strict ANSI (pthreads)
If -std=cXX option is passed to gcc/clang then sigset_t is undefined,
thus GC_pthread_sigmask declaration should be omitted. However, this
symbol should be available during GC source code audit by cppcheck.
* include/gc_pthread_redirects.h [!GC_NO_PTHREAD_SIGMASK]
(GC_pthread_sigmask): Declare only if GC_PTHREAD_SIGMASK_NEEDED or
_POSIX_C_SOURCE >= 199506 or _XOPEN_SOURCE >= 500.
* tests/test.c [CPPCHECK] (GC_PTHREAD_SIGMASK_NEEDED): Define (before
include gc.h).
* tests/test.c [CPPCHECK && !_GNU_SOURCE] (_GNU_SOURCE): Likewise.
Ivan Maidanski [Thu, 30 Mar 2017 19:06:09 +0000 (22:06 +0300)]
Fix mixed include of GC public header and gc_priv.h in disclaim bench/test
Include gc_priv.h should be avoided in tests (if possible) or, at
least, this include should not precede include of the public GC
headers (because, e.g., gc_priv.h define GC_BUILD which influences
declspec of the GC public symbols in case of a shared library).
* tests/disclaim_bench.c: Move include gc_priv.h to be after
gc_disclaim.h; add comment .
* tests/disclaim_bench.c [HAVE_CONFIG_H]: Include "config.h" (before
include gc_disclaim.h).
* tests/disclaim_test.c [LINT2]: Do not include gc_priv.h; include
config.h instead.
* tests/disclaim_test.c [LINT2] (GC_API_PRIV): Define.
* tests/disclaim_test.c [LINT2] (GC_random): Declare the function
(instead of including gc_priv.h to get the prototype).
Ivan Maidanski [Thu, 30 Mar 2017 07:27:43 +0000 (10:27 +0300)]
Check that GC_WIN32_PTHREADS is not specified for Cygwin
* include/private/gcconfig.h [!CPPCHECK && GC_WIN32_PTHREADS
&& CYGWIN32]: Issue #error (because GC_WIN32_PTHREADS should not be
specified for Cygwin).
Ivan Maidanski [Wed, 29 Mar 2017 20:33:42 +0000 (23:33 +0300)]
Travis CI: Test also Intel x32 builds (Linux)
Ivan Maidanski [Wed, 29 Mar 2017 20:29:47 +0000 (23:29 +0300)]
Travis CI: Test also 32-bit, 64-bit builds with clang-4.0, gcc-5 (Linux)
Ivan Maidanski [Wed, 29 Mar 2017 20:22:14 +0000 (23:22 +0300)]
Travis CI: Also test with Address and Memory sanitizers
Ivan Maidanski [Wed, 29 Mar 2017 20:16:17 +0000 (23:16 +0300)]
Travis CI: Workaround incorrect CC, disable parallel-mark for musl build
(fix commit 07d9895)
Ivan Maidanski [Wed, 29 Mar 2017 09:10:12 +0000 (12:10 +0300)]
Travis CI: Workaround incorrect CC in CSA v4 build
(fix commit e72a7bc)
Ivan Maidanski [Tue, 28 Mar 2017 20:22:17 +0000 (23:22 +0300)]
Travis CI: Test also with -std=c11 (in single-threaded mode only)
Ivan Maidanski [Tue, 28 Mar 2017 20:09:13 +0000 (23:09 +0300)]
Travis CI: Replace multiple CONF_x with a single CONF_OPTIONS variable
(code refactoring)
Ivan Maidanski [Mon, 27 Mar 2017 22:07:10 +0000 (01:07 +0300)]
Travis CI: Also test with musl-gcc (Linux)
Ivan Maidanski [Mon, 27 Mar 2017 21:46:20 +0000 (00:46 +0300)]
Travis CI: Run CSA for a 32-bit target on OS X
(fix commits 369d606, e72a7bc)
Note: both C and C++ code is checked (regardless of --enable-cplusplus).
Ivan Maidanski [Mon, 27 Mar 2017 21:38:01 +0000 (00:38 +0300)]
Travis CI: Test builds with -D LINT2 without -D CPPCHECK
Ivan Maidanski [Mon, 27 Mar 2017 07:44:03 +0000 (10:44 +0300)]
Travis CI: Use CSA v4.0 (clang-4.0)
Ivan Maidanski [Mon, 27 Mar 2017 07:31:55 +0000 (10:31 +0300)]
Travis CI: Install gcc-multilib for CSA check with '-m32' option
(fix commit 369d606)
Ivan Maidanski [Fri, 24 Mar 2017 16:56:37 +0000 (19:56 +0300)]
Travis CI: Run CSA once per build configuration
(refactoring of commit 3663fd5)
Ivan Maidanski [Fri, 24 Mar 2017 15:34:09 +0000 (18:34 +0300)]
Travis CI: Specify test configurations using 'matrix:include'
(code refactoring)
Also, require "sudo" only where needed.
Ivan Maidanski [Thu, 23 Mar 2017 22:20:55 +0000 (01:20 +0300)]
Use __int64 instead of 'long long' in LONG_MULT if appropriate
* include/private/gc_pmark.h [!I386 || !__GNUC__ || NACL] (ULONG_MULT_T):
Define new private macro (to unsigned __int64 or unsigned long long).
* include/private/gc_pmark.h [!I386 || !__GNUC__ || NACL] (LONG_MULT):
Use ULONG_MULT_T instead of unsigned long long.
Ivan Maidanski [Thu, 23 Mar 2017 20:12:07 +0000 (23:12 +0300)]
Fix finalize.c compilation in 'strict ANSI' mode
This and some other GC .c files include gc_pmark.h directly (not
gc_priv.h), so the compiler complains that sigset_t (used in
gc_pthread_redirects.h) is undefined if 'strict ANSI' mode is on and
_GNU_SOURCE is not defined before including system headers.
* include/private/gc_pmark.h [(__linux__ || __GLIBC__ || __GNU__)
&& GC_PTHREADS && !GC_NO_PTHREAD_SIGMASK] (_GNU_SOURCE): Define (before
including other headers).
Ivan Maidanski [Thu, 23 Mar 2017 19:44:11 +0000 (22:44 +0300)]
Fix static assertion violation in LONG_MULT for 64-bit targets
* include/private/gc_pmark.h [MARK_BIT_PER_OBJ] (PUSH_CONTENTS_HDR):
Cast displ to unsigned32 when passed to LONG_MULT (it is safe because
displ is less than HBLKSIZE).
Ivan Maidanski [Thu, 23 Mar 2017 19:34:15 +0000 (22:34 +0300)]
Travis CI: Add _FORTIFY_SOURCE to exclude GC_BUILTIN_ATOMIC build for gcc
(fix commit 2897743)
Ivan Maidanski [Thu, 23 Mar 2017 08:45:31 +0000 (11:45 +0300)]
Detect sigsetjmp() availability by configure
* configure.ac (AC_TRY_LINK(sigsetjmp)): Add (define GC_NO_SIGSETJMP
if sigsetjmp is not available).
Ivan Maidanski [Thu, 23 Mar 2017 08:38:38 +0000 (11:38 +0300)]
Support CFLAGS_EXTRA when checking for inline and dladdr (configure)
(fix commits 0e175f3, 5dedb24)
* configure.ac (AC_C_INLINE, AC_TRY_COMPILE(dladdr)): Add $CFLAGS_EXTRA
to CFLAGS temporarily (restore CFLAGS after the check).
Ivan Maidanski [Thu, 23 Mar 2017 08:25:52 +0000 (11:25 +0300)]
Travis CI: Test also with -D _FORTIFY_SOURCE
Ivan Maidanski [Thu, 23 Mar 2017 08:24:06 +0000 (11:24 +0300)]
Use C11 static_assert if available
(code refactoring)
* include/private/gc_priv.h [static_assert && __STDC_VERSION__>=201112]
(GC_STATIC_ASSERT): Define to static_assert (with an empty message);
update comment.
Ivan Maidanski [Thu, 23 Mar 2017 08:15:45 +0000 (11:15 +0300)]
Use longjmp in fault_handler_openbsd if siglongjmp unavailable (OpenBSD)
* os_dep.c [OPENBSD] (GC_jmp_buf_openbsd): Use JMP_BUF instead of
sigjmp_buf.
* os_dep.c [OPENBSD] (GC_fault_handler_openbsd): Use LONGJMP() instead
of siglongjmp().
* os_dep.c [OPENBSD] (GC_find_limit_openbsd, GC_skip_hole_openbsd): Use
SETJMP(buf) instead of sigsetjmp(buf, 1).
Ivan Maidanski [Thu, 23 Mar 2017 08:09:40 +0000 (11:09 +0300)]
Use sigsetjmp() in setjmp_t tool if available
* tools/setjmp_t.c (main): Replace jmp_buf, setjmp(), longjmp() to
JMP_BUF, SETJMP(), LONGJMP(), respectively; cast result of SETJMP() to
void type.
Ivan Maidanski [Thu, 23 Mar 2017 00:24:49 +0000 (03:24 +0300)]
Fix typo in comment at GC_setup_temporary_fault_handler declaration
* include/private/gc_priv.h (GC_setup_temporary_fault_handler): Fix typo
in comment (replace trailing ';' with a dot).
Ivan Maidanski [Thu, 23 Mar 2017 00:16:12 +0000 (03:16 +0300)]
Fix tools/setjmp_t hang (OS X)
* tools/setjmp_t.c (main): Declare "y" static variable as volatile (to
prevent reordering/optimization of y++).
Ivan Maidanski [Thu, 23 Mar 2017 00:07:36 +0000 (03:07 +0300)]
Travis CI: Build also cord/de target of Makefile.direct
Ivan Maidanski [Wed, 22 Mar 2017 22:41:25 +0000 (01:41 +0300)]
Remove EMX_MAKEFILE (add EMX support to Makefile.direct)
* EMX_MAKEFILE: Remove.
* Makefile.am (EXTRA_DIST): Remove EMX_MAKEFILE entity.
* Makefile.direct (OTHER_MAKEFILES): Likewise.
* Makefile.direct (CC, RANLIB): Add comment for EMX target.
* Makefile.direct (EXEEXT): New variable (empty by default).
* Makefile.direct (UTILS, all, cords, test_cpp, check-cpp, c++-t,
dyn_test, cord/cordtest, cord/de, if_mach, threadlibs, if_not_there,
gctest, setjmp_test, check): Add $(EXEEXT) suffix to if_mach,
if_not_there, threadlibs, gctest, cord/cordtest, test_cpp, cord/de,
setjmp_test.
Ivan Maidanski [Wed, 22 Mar 2017 23:55:33 +0000 (02:55 +0300)]
Revert 'Remove unnecessary rm commands in Makefile.direct'
This reverts commit
72e01227a4bf011fb28848b752a3cc599cba7224.
Because 'rm' is needed in these Makefile targets to let if_not_there
command work properly in case of the target dependencies are updated.
Ivan Maidanski [Wed, 22 Mar 2017 08:40:56 +0000 (11:40 +0300)]
Travis CI: Build check-cpp target of Makefile.direct
Ivan Maidanski [Wed, 22 Mar 2017 08:31:16 +0000 (11:31 +0300)]
.gitignore: Ignore gctest_* and lib*gc.so produced by Makefile.direct
Ivan Maidanski [Wed, 22 Mar 2017 08:23:37 +0000 (11:23 +0300)]
New target (check-cpp) to avoid Makefile.direct parallel build issue
* Makefile.direct: Add comment about check-cpp.
* Makefile.direct (test_cpp): Replace dependency on "c++" with
"gc_cpp.o base_lib"; link with gc_cpp.o directly.
* Makefile.direct (check-cpp): New target (same as c++-t but do not
depend on c++ target and pass no arguments to test_cpp).
Ivan Maidanski [Tue, 21 Mar 2017 21:37:06 +0000 (00:37 +0300)]
Remove lint-specific code
Note: cppcheck and CSA replace lint tool.
* Makefile.direct (lint): Remove.
* dyn_load.c [SOLARISDL && !USE_PROC_FOR_LIBRARIES && LINT] (_DYNAMIC):
Remove.
* dyn_load.c [IRIX5 || (USE_PROC_FOR_LIBRARIES && !LINUX)]
(GC_register_dynamic_libraries): Remove comment about a false warning
reported by lint.
* mach_dep.c [ASM_CLEAR_CODE && LINT] (GC_clear_stack_inner): Remove.
* tests/test.c (typed_test): Call GC_make_descriptor unconditionally.
* tests/test.c (run_one_test): Set y to fail_proc1 unconditionally.
* tests/test.c (main): Do not check whether LINT is defined.
Ivan Maidanski [Tue, 21 Mar 2017 08:58:30 +0000 (11:58 +0300)]
Fix cord/de build in Makefile.direct (Linux)
As of Ubuntu 14, termlib package is missing and not needed to
build 'de' test application (the required symbols are provided in
libcurses).
* Makefile.direct (CURSES): Remove -ltermlib; add comment about it.
* Makefile.direct [DRSNX, HPUX] (cord/de): Replace $(CURSES) with
"-lcurses -ltermlib".
Ivan Maidanski [Mon, 20 Mar 2017 20:10:48 +0000 (23:10 +0300)]
.gitignore: Ignore bsd-libgc.a, bsd-libleak.a
Ivan Maidanski [Mon, 20 Mar 2017 08:33:37 +0000 (11:33 +0300)]
Fix test_cpp and c++ parallel build in Makefile.direct
* Makefile.direct (test_cpp): Add dependency on c++ (and remove
dependency on base_lib and gc_cpp.o); do not link with gc_cpp.o
directly (it should be in gc.a).
Ivan Maidanski [Fri, 17 Mar 2017 13:58:59 +0000 (16:58 +0300)]
Travis CI: Do not test --enable-redirect with threads on 32-bit and Darwin
(fix commit c62abbb)
Ivan Maidanski [Fri, 17 Mar 2017 08:53:25 +0000 (11:53 +0300)]
Fix BIG definition in gctest (MS VC)
(fix commit 3bfeb8a)
* tests/test.c [NO_GETCONTEXT] (BIG): Move comment out of defined();
do not define (to 1000) unless UNIX_LIKE.
Ivan Maidanski [Fri, 17 Mar 2017 08:21:13 +0000 (11:21 +0300)]
Fix GC shared library tests failure (musl)
Detect dl_iterate_phdr() presence by configure.
* configure.ac (dl_iterate_phdr): Add AC_CHECK_FUNCS for.
* configure.ac [ac_cv_func_dl_iterate_phdr] (HAVE_DL_ITERATE_PHDR):
AC_DEFINE it.
Ivan Maidanski [Fri, 17 Mar 2017 08:05:56 +0000 (11:05 +0300)]
Allow HAVE_DL_ITERATE_PHDR to be defined by client (musl)
Do not redefine HAVE_DL_ITERATE_PHDR macro if already defined.
* dyn_load.c [OPENBSD>=200519] (HAVE_DL_ITERATE_PHDR): Do not define
if already defined.
* dyn_load.c [!USE_PROC_FOR_LIBRARIES && (__GLIBC__>=2
|| PLATFORM_ANDROID)] (HAVE_DL_ITERATE_PHDR): Likewise.
* dyn_load.c [!USE_PROC_FOR_LIBRARIES && HAVE_DL_ITERATE_PHDR
&& !DL_ITERATE_PHDR_STRONG] (dl_iterate_phdr): Define as weak symbol
(even if HAVE_DL_ITERATE_PHDR is defined outside this file).
Ivan Maidanski [Fri, 17 Mar 2017 07:39:57 +0000 (10:39 +0300)]
Fix gctest thread stack overflow (musl-gcc)
* tests/test.c (BIG): Remove commented out defined(MSWIN32); define
to 1000 if NO_GETCONTEXT; update comment.
Ivan Maidanski [Fri, 17 Mar 2017 07:25:58 +0000 (10:25 +0300)]
Travis CI: Test also -D DBG_HDRS_ALL -D SHORT_DBG_HDRS
Ivan Maidanski [Fri, 17 Mar 2017 07:21:37 +0000 (10:21 +0300)]
Travis CI: Remove -D DEBUG_DISCLAIM_DESTRUCT, add -D GC_LOG_TO_FILE_ALWAYS
(fix commit 19db2c6)
Otherwise Travis log is overflowed.
Ivan Maidanski [Thu, 16 Mar 2017 22:20:11 +0000 (01:20 +0300)]
Workaround 'WinMain() is never used' cppcheck false warning (de_win)
* cord/tests/de_win.c (WinMain): Call GC_noop1(&WinMain) if CPPCHECK.
Ivan Maidanski [Thu, 16 Mar 2017 22:10:41 +0000 (01:10 +0300)]
Fix gctest failure for Darwin if CPPCHECK is defined
(fix commits c5d4ef9, 857bb8a)
* tests/test.c [TEST_FORK_WITHOUT_ATFORK] (NO_TEST_HANDLE_FORK):
Define even if CPPCHECK (i.e., CPPCHECK should not imply testing of
HANDLE_FORK).
* tests/test.c [GC_PTHREADS && CPPCHECK] (main): Remove duplicate check
for GC_PTHREADS.
* tests/test.c [GC_PTHREADS && CPPCHECK && NO_TEST_HANDLE_FORK] (main):
Call UNTESTED() for GC_atfork_child, GC_atfork_parent,
GC_atfork_prepare, GC_set_handle_fork, GC_start_mark_threads.
Ivan Maidanski [Thu, 16 Mar 2017 21:42:52 +0000 (00:42 +0300)]
Travis CI: Test also --enable-redirect-malloc
Ivan Maidanski [Thu, 16 Mar 2017 08:33:49 +0000 (11:33 +0300)]
Travis CI: Test also -D POINTER_MASK
Ivan Maidanski [Thu, 16 Mar 2017 08:31:48 +0000 (11:31 +0300)]
Travis CI: Test also ENABLE_TRACE and other misc macros
Ivan Maidanski [Thu, 16 Mar 2017 08:18:58 +0000 (11:18 +0300)]
Travis CI: Test also various -D DEBUG_x
Ivan Maidanski [Thu, 16 Mar 2017 08:05:18 +0000 (11:05 +0300)]
Remove unnecessary 'rm' commands in Makefile.direct
(code refactoring)
A makefile target is executed only if the target file is not created
yet thus removal of the target file ("rm -f <target>") is a no-op.
* Makefile.direct (test_cpp, mach_dep.o, mark_rts.o, cord/cordtest,
cord/de, gctest): Remove deletion of the target file.
Ivan Maidanski [Thu, 16 Mar 2017 07:53:28 +0000 (10:53 +0300)]
Run test_cpp only if requested (Makefile.direct)
* Makefile.direct (c++-t): Add dependency on test_cpp target.
* Makefile.direct (c++): Remove dependency on test_cpp target; do not
execute test_cpp.
Ivan Maidanski [Thu, 16 Mar 2017 07:45:09 +0000 (10:45 +0300)]
Fix parallel build in Makefile.direct
* Makefile.direct (all, cord/cordtest, cord/de, gctest): Depend on
base_lib instead of gc.a target.
* Makefile.direct (base_lib): Generate "base_lib" file after
"runlib gc.a".
* Makefile.direct (cords, c++): Add dependency on base_lib target.
Ivan Maidanski [Thu, 16 Mar 2017 07:22:29 +0000 (10:22 +0300)]
Eliminate 'ISO C forbids object to function pointer conversion' warning
* dyn_load.c [SOLARISDL && !USE_PROC_FOR_LIBRARIES
&& SUNOS53_SHARED_LIB] (GC_FirstDLOpenedLinkMap): Cast result of dlsym()
to word type before casting it to a function pointer.
* pthread_support.c [GC_USE_DLOPEN_WRAP] (GC_init_real_syms): Likewise.
Ivan Maidanski [Thu, 16 Mar 2017 07:11:15 +0000 (10:11 +0300)]
Update AUTHORS file
Romain Naour [Sat, 6 Aug 2016 21:24:35 +0000 (23:24 +0200)]
configure: match uclinux pattern
BDWGC does not recognize "uclinux" as a valid OS part of the target
tuple which is used by some arm cortex-M toolchains.
* configure.ac [$THREADS=pthreads] (GC_LINUX_THREADS, _REENTRANT): Define
for hosts matching "*-*-*linux*" (instead of "*-*-linux*").
Ivan Maidanski [Wed, 15 Mar 2017 22:02:12 +0000 (01:02 +0300)]
Eliminate 'type defaults to int in declaration' warning (REDIRECT_MALLOC)
* os_dep.c [REDIRECT_MALLOC] (GC_in_save_callers): Add missing type
(GC_bool) of the declared variable.
Ivan Maidanski [Wed, 15 Mar 2017 21:49:22 +0000 (00:49 +0300)]
Use AC_DEFINE for defining NO_GETCONTEXT in configure
(code refactoring of commit 7c13fb8)
* configure.ac [!ac_cv_func_getcontext]: Use AC_DEFINE(NO_GETCONTEXT)
instead of directly adding -D NO_GETCONTEXT to CFLAGS.
Ivan Maidanski [Wed, 15 Mar 2017 21:41:11 +0000 (00:41 +0300)]
Update AUTHORS file
Samuel Martin [Wed, 15 Mar 2017 21:39:37 +0000 (00:39 +0300)]
configure.ac: add check for NO_GETCONTEXT definition
* configure.ac: Add AC_CHECK_FUNCS(getcontext); add -DNO_GETCONTEXT to
CFLAGS if $ac_cv_func_getcontext is "no".
Ivan Maidanski [Tue, 14 Mar 2017 22:58:41 +0000 (01:58 +0300)]
Fix GC_SIZE_MAX definition (Linux/musl-gcc)
* include/private/gc_priv.h [SIZE_MAX && !CPPCHECK] (GC_SIZE_MAX): Cast
SIZE_MAX to size_t explicitly (to workaround incorrect definition
of SIZE_MAX - e.g. it is defined as ~0ULL in musl-tools which is not
correct for a 32-bit target).
Ivan Maidanski [Tue, 14 Mar 2017 22:45:16 +0000 (01:45 +0300)]
Refine configure messages when checking for compiler option support
* configure.ac (AC_MSG_CHECKING): Refine message when checking for
a compiler option support (replace "gcc" with "compiler").
Ivan Maidanski [Tue, 14 Mar 2017 08:57:14 +0000 (11:57 +0300)]
Travis CI: Test also build system based on Makefile.direct
Ivan Maidanski [Tue, 14 Mar 2017 06:56:51 +0000 (09:56 +0300)]
Travis CI: Test MARK_BIT_PER_OBJ and SMALL_CONFIG in separate builds
(fix commit 817ea6f)
Perform MARK_BIT_PER_OBJ testing only in 32-bit mode (for now).
Also test -D NO_GETENV.
Ivan Maidanski [Tue, 14 Mar 2017 06:50:09 +0000 (09:50 +0300)]
Travis CI: Test also compilation of PROC_VDB code
Ivan Maidanski [Tue, 14 Mar 2017 06:43:28 +0000 (09:43 +0300)]
Allow compilation of PROC_VDB code on Linux host (GC_NO_SYS_FAULT_H)
This is to check that PROC_VDB code compilation is ok. The code will
not work on a non-Solaris host, of course, because of lack of "pagedata"
file, so -D NO_INCREMENTAL should be additionally specified to avoid
abort during GC initialization (in gctest).
* os_dep.c [PROC_VDB && GC_NO_SYS_FAULT_H]: Do not include sys/fault.h
and sys/procfs.h.
* os_dep.c [PROC_VDB && GC_NO_SYS_FAULT_H] (PG_MODIFIED,
struct prpageheader, struct prasmap): Define explicitly.
* os_dep.c [PROC_VDB && GC_NO_SYS_FAULT_H && CPPCHECK] (GC_read_dirty):
Call GC_noop1 for dummy fields of prpageheader and prasmap.
Ivan Maidanski [Mon, 13 Mar 2017 21:31:08 +0000 (00:31 +0300)]
Fix 'ISO C90 forbids mixed declarations/code' compiler warning (gc_pmark)
* include/private/gc_pmark.h [MARK_BIT_PER_OBJ] (PUSH_CONTENTS_HDR):
Declare "obj_displ" local variable at the beginning of the block (not
after GC_STATIC_ASSERT).
Ivan Maidanski [Mon, 13 Mar 2017 21:08:26 +0000 (00:08 +0300)]
Rename 'test' to 'check' target in Makefile.direct
This is to match the target name in Makefile generated by configure.
* Makefile.direct: Update comment about testing (rename "test" target
to "check").
* Makefile.direct (check): Renamed from "test".
* Makefile.direct (test): Depend on check; add comment.
* README.QUICK (INSTALLATION): Leave information only about the recent
GC version.
* README.QUICK (INSTALLATION): Replace "make test" with "make check".
* README.md (Installation and Portability): Likewise.
Ivan Maidanski [Fri, 10 Mar 2017 21:54:45 +0000 (00:54 +0300)]
Travis CI: Test also -D CHECKSUMS, -D SMALL_CONFIG -D MARK_BIT_PER_OBJ