Closed FrankC01 closed 5 years ago
I can't reproduce it on OS X 10.13.3 x64 (see https://travis-ci.org/ivmai/bdwgc/jobs/489410671 - for master, https://travis-ci.org/ivmai/bdwgc/jobs/489413946 - for release-8_0 branch)
Did you do make clean?
I did do a make clean and tried again, same error.
Could you please recheck it on master from github?
git clone https://github.com/ivmai/bdwgc.git
cd bdwgc
./autogen.sh
./configure --enable-static --disable-shared --enable-cplusplus && make check
Getting similar error
/bin/sh ./libtool --tag=CC --mode=link gcc -fexceptions -Wall -Wextra -Wpedantic -Wno-long-long -g -O2 -fno-strict-aliasing -o cordtest cord/tests/cordtest.o ./libgc.la ./libcord.la
libtool: link: gcc -fexceptions -Wall -Wextra -Wpedantic -Wno-long-long -g -O2 -fno-strict-aliasing -o cordtest cord/tests/cordtest.o ./.libs/libgc.a ./.libs/libcord.a /Users/frankcastellucci/bdwgc/.libs/libgc.a -lpthread
ld: warning: ignoring file ./.libs/libgc.a, file was built for archive which is not the architecture being linked (x86_64): ./.libs/libgc.ald: warning: ignoring file /Users/frankcastellucci/bdwgc/.libs/libgc.a, file was built for archive which is not the architecture being linked (x86_64): /Users/frankcastellucci/bdwgc/.libs/libgc.a
ld: warning: ignoring file ./.libs/libcord.a, file was built for archive which is not the architecture being linked (x86_64): ./.libs/libcord.a
Undefined symbols for architecture x86_64:
"_CORD__next", referenced from:
_test_basics in cordtest.o
"_CORD__pos_fetch", referenced from:
_test_basics in cordtest.o
"_CORD_balance", referenced from:
_test_basics in cordtest.o
_test_extras in cordtest.o
"_CORD_cat", referenced from:
_test_basics in cordtest.o
_test_extras in cordtest.o
_test_printf in cordtest.o
"_CORD_catn", referenced from:
_test_extras in cordtest.o
"_CORD_chars", referenced from:
_test_extras in cordtest.o
"_CORD_chr", referenced from:
_test_extras in cordtest.o
"_CORD_cmp", referenced from:
_test_extras in cordtest.o
_test_printf in cordtest.o
"_CORD_fprintf", referenced from:
_main in cordtest.o
"_CORD_from_char_star", referenced from:
_test_basics in cordtest.o
"_CORD_from_file", referenced from:
_test_extras in cordtest.o
"_CORD_from_file_lazy", referenced from:
_test_extras in cordtest.o
"_CORD_from_fn", referenced from:
_test_basics in cordtest.o
"_CORD_iter5", referenced from:
_test_basics in cordtest.o
"_CORD_len", referenced from:
_test_basics in cordtest.o
_test_extras in cordtest.o
"_CORD_printf", referenced from:
_test_printf in cordtest.o
"_CORD_put", referenced from:
_test_extras in cordtest.o
"_CORD_rchr", referenced from:
_test_extras in cordtest.o
"_CORD_set_pos", referenced from:
_test_basics in cordtest.o
"_CORD_sprintf", referenced from:
_test_printf in cordtest.o
"_CORD_str", referenced from:
_test_extras in cordtest.o
"_CORD_substr", referenced from:
_test_basics in cordtest.o
_test_extras in cordtest.o
"_CORD_to_char_star", referenced from:
_test_extras in cordtest.o
_test_printf in cordtest.o
"_CORD_vfprintf", referenced from:
_wrap_vfprintf in cordtest.o
"_CORD_vprintf", referenced from:
_wrap_vprintf in cordtest.o
"_GC_enable_incremental", referenced from:
_main in cordtest.o
"_GC_gcollect", referenced from:
_test_extras in cordtest.o
"_GC_get_find_leak", referenced from:
_main in cordtest.o
"_GC_init", referenced from:
_main in cordtest.o
"_GC_invoke_finalizers", referenced from:
_test_extras in cordtest.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [cordtest] Error 1
make[1]: *** [check-am] Error 2
make: *** [check-recursive] Error 1
I see. It seems the issue affects only public symbols (attributed by GC_API, CORD_API).
Is gctest linked successfully (make gctest)?
No, I think because the lib error noted above, it's just not loading a libary
Undefined symbols for architecture x86_64:
"_GC_base", referenced from:
_run_one_test in test.o
_reachable_objs_counter in test.o
"_GC_call_with_alloc_lock", referenced from:
_run_one_test in test.o
_check_heap_stats in test.o
"_GC_call_with_gc_active", referenced from:
_reverse_test_inner in test.o
"_GC_calloc_explicitly_typed", referenced from:
_typed_test in test.o
"_GC_collect_a_little", referenced from:
_check_heap_stats in test.o
"_GC_disable", referenced from:
_run_one_test in test.o
"_GC_do_blocking", referenced from:
_reverse_test in test.o
_run_one_test in test.o
"_GC_enable", referenced from:
_run_one_test in test.o
"_GC_end_stubborn_change", referenced from:
_mktree in test.o
_test_tinyfl in test.o
_run_one_test in test.o
"_GC_enumerate_reachable_objects_inner", referenced from:
_reachable_objs_count_enumerator in test.o
"_GC_free", referenced from:
_test_generic_malloc_or_special in test.o
_reverse_test_inner in test.o
_run_one_test in test.o
"_GC_gcj_malloc", referenced from:
_gcj_cons in test.o
_gcj_reverse1 in test.o
_gcj_reverse in test.o
_gcj_ints in test.o
_reverse_test_inner in test.o
"_GC_gcollect", referenced from:
_tiny_reverse_test in test.o
_typed_test in test.o
_run_one_test in test.o
_check_heap_stats in test.o
"_GC_general_register_disappearing_link", referenced from:
_mktree in test.o
"_GC_generic_malloc_many", referenced from:
_test_tinyfl in test.o
"_GC_generic_or_special_malloc", referenced from:
_test_generic_malloc_or_special in test.o
"_GC_get_all_interior_pointers", referenced from:
_test_tinyfl in test.o
"_GC_get_debug_header_size", referenced from:
_fake_gcj_mark_proc in test.o
"_GC_get_find_leak", referenced from:
_mktree in test.o
_check_heap_stats in test.o
_main in test.o
"_GC_get_full_gc_total_time", referenced from:
_check_heap_stats in test.o
"_GC_get_gc_no", referenced from:
_check_heap_stats in test.o
"_GC_get_heap_size", referenced from:
_check_heap_stats in test.o
"_GC_get_heap_usage_safe", referenced from:
_check_heap_stats in test.o
"_GC_get_kind_and_size", referenced from:
_test_generic_malloc_or_special in test.o
"_GC_get_manual_vdb_allowed", referenced from:
_main in test.o
"_GC_get_max_prior_attempts", referenced from:
_main in test.o
"_GC_get_memory_use", referenced from:
_check_heap_stats in test.o
"_GC_get_min_bytes_allocd", referenced from:
_main in test.o
"_GC_get_oom_fn", referenced from:
_test_tinyfl in test.o
"_GC_get_parallel", referenced from:
_check_heap_stats in test.o
"_GC_get_prof_stats", referenced from:
_check_heap_stats in test.o
"_GC_get_prof_stats_unsafe", referenced from:
_check_heap_stats in test.o
"_GC_get_rate", referenced from:
_main in test.o
"_GC_get_size_map_at", referenced from:
_check_heap_stats in test.o
"_GC_get_stack_base", referenced from:
_check_heap_stats in test.o
"_GC_get_total_bytes", referenced from:
_check_heap_stats in test.o
"_GC_get_unmapped_bytes", referenced from:
_check_heap_stats in test.o
"_GC_get_version", referenced from:
_main in test.o
"_GC_greatest_plausible_heap_addr", referenced from:
_fake_gcj_mark_proc in test.o
"_GC_init", referenced from:
_main in test.o
"_GC_init_gcj_malloc", referenced from:
_run_one_test in test.o
"_GC_invoke_finalizers", referenced from:
_check_heap_stats in test.o
"_GC_is_heap_ptr", referenced from:
_run_one_test in test.o
"_GC_is_incremental_mode", referenced from:
_main in test.o
"_GC_is_init_called", referenced from:
_run_one_test in test.o
_check_heap_stats in test.o
"_GC_is_marked", referenced from:
_check_marks_int_list in test.o
"_GC_is_valid_displacement", referenced from:
_run_one_test in test.o
"_GC_is_valid_displacement_print_proc", referenced from:
_set_print_procs in test.o
_main in test.o
"_GC_is_visible", referenced from:
_run_one_test in test.o
"_GC_is_visible_print_proc", referenced from:
_set_print_procs in test.o
_main in test.o
"_GC_least_plausible_heap_addr", referenced from:
_fake_gcj_mark_proc in test.o
"_GC_log_printf", referenced from:
_run_one_test in test.o
_check_heap_stats in test.o
"_GC_make_descriptor", referenced from:
_typed_test in test.o
"_GC_malloc", referenced from:
_cons in test.o
_small_cons in test.o
_ints in test.o
_reverse_test_inner in test.o
_mktree in test.o
_chktree in test.o
_run_one_test in test.o
...
"_GC_malloc_atomic", referenced from:
_small_cons_leaf in test.o
_ints in test.o
_uncollectable_ints in test.o
_run_one_test in test.o
"_GC_malloc_atomic_ignore_off_page", referenced from:
_run_one_test in test.o
"_GC_malloc_explicitly_typed", referenced from:
_typed_test in test.o
"_GC_malloc_ignore_off_page", referenced from:
_run_one_test in test.o
"_GC_malloc_kind", referenced from:
_test_tinyfl in test.o
"_GC_malloc_many", referenced from:
_alloc8bytes in test.o
"_GC_malloc_uncollectable", referenced from:
_small_cons_uncollectable in test.o
_uncollectable_ints in test.o
_alloc8bytes in test.o
_run_one_test in test.o
"_GC_mark_and_push", referenced from:
_fake_gcj_mark_proc in test.o
"_GC_memalign", referenced from:
_run_one_test in test.o
"_GC_move_disappearing_link", referenced from:
_mktree in test.o
"_GC_move_long_link", referenced from:
_mktree in test.o
"_GC_noop1", referenced from:
_typed_test in test.o
"_GC_on_abort", referenced from:
_cons in test.o
_check_ints in test.o
_check_uncollectable_ints in test.o
_fork_a_thread in test.o
_test_generic_malloc_or_special in test.o
_reverse_test_inner in test.o
_finalizer in test.o
...
"_GC_printf", referenced from:
_cons in test.o
_small_cons in test.o
_small_cons_leaf in test.o
_small_cons_uncollectable in test.o
_gcj_cons in test.o
_ints in test.o
_gcj_reverse1 in test.o
...
"_GC_pthread_create", referenced from:
_fork_a_thread in test.o
_main in test.o
"_GC_pthread_join", referenced from:
_fork_a_thread in test.o
_main in test.o
"_GC_ptr_store_and_dirty", referenced from:
_cons in test.o
_small_cons in test.o
_small_cons_uncollectable in test.o
_gcj_cons in test.o
_ints in test.o
_gcj_reverse1 in test.o
_gcj_reverse in test.o
...
"_GC_realloc", referenced from:
_reverse_test_inner in test.o
"_GC_register_displacement", referenced from:
_run_one_test in test.o
"_GC_register_finalizer", referenced from:
_mktree in test.o
"_GC_register_long_link", referenced from:
_mktree in test.o
"_GC_same_obj", referenced from:
_run_one_test in test.o
"_GC_set_manual_vdb_allowed", referenced from:
_main in test.o
"_GC_set_max_prior_attempts", referenced from:
_main in test.o
"_GC_set_min_bytes_allocd", referenced from:
_main in test.o
"_GC_set_rate", referenced from:
_main in test.o
"_GC_set_warn_proc", referenced from:
_main in test.o
"_GC_size", referenced from:
_test_generic_malloc_or_special in test.o
_run_one_test in test.o
_reachable_objs_counter in test.o
"_GC_start_performance_measurement", referenced from:
_main in test.o
"_GC_thread_is_registered", referenced from:
_run_one_test in test.o
"_GC_unregister_disappearing_link", referenced from:
_mktree in test.o
"_GC_unregister_long_link", referenced from:
_mktree in test.o
"_GC_unregister_my_thread", referenced from:
_check_heap_stats in test.o
If you do it manually, does it work: gcc -I include -o gc.o extra/gc.c gcc -I include -o gctest tests/test.c gc.o && ./gctest
I've search for this issue in other projects: Here's a similar issue but with libz library: https://github.com/radare/radare2/issues/12044
Just to reconfirm, I used homebrew
and installed llvm
and clang
toolchain. It is not the xcode versions of same
clang -I include -o gc.o extra/gc.c
In file included from extra/gc.c:68:
extra/../dyn_load.c:1503:12: warning: '_dyld_bind_fully_image_containing_address' is deprecated: first deprecated in macOS 10.5 - dlopen(RTLD_NOW) [-Wdeprecated-declarations]
if (!_dyld_bind_fully_image_containing_address(
^
/usr/include/mach-o/dyld.h:244:13: note: '_dyld_bind_fully_image_containing_address' has been explicitly marked deprecated here
extern bool _dyld_bind_fully_image_containing_address(const void* address) __API_UNAVAILABLE(ios, tvos, watchos) __OSX_DEPRECATED(10.1, 10.5, "dlopen(RTLD_NOW)");
^
1 warning generated.
Undefined symbols for architecture x86_64:
"_main", referenced from:
implicit entry/start for main executable
(maybe you meant: _GC_get_main_stack_base, _GC_register_main_static_data )
ld: symbol(s) not found for architecture x86_64
clang-7: error: linker command failed with exit code 1 (use -v to see invocation)
_dyld_bind_fully_image_containing_address is a known item, the warning is suppressed by -Wno-deprecated-declarations
Sorry, I was wrong, I missed "-c", the correct is: clang -I include -Wno-deprecated-declarations -o gc.o -c extra/gc.c
OK, this worked
$> clang -I include -Wno-deprecated-declarations -o gc.o -c extra/gc.c
$> clang -I include -o gctest tests/test.c gc.o && ./gctest
Switched to incremental mode
Emulating dirty bits with mprotect/signals
Completed 1 tests
Allocated 603120 collectable objects
Allocated 203 uncollectable objects
Allocated 1292870 atomic objects
Reallocated 126 objects
Finalized 2203/2203 objects - finalization is probably ok
Total number of bytes allocated is 101396192
Total memory use by allocated blocks is 569344 bytes
Final heap size is 15482880 bytes
Final number of reachable objects is 470
Completed 191 collections in 2 ms
Collector appears to work
Good. Please try this (I assume gc-8.0.2 or master): make -f Makefile.direct clean && make -f Makefile.direct check
Same result on master and 8.0.2
make -f Makefile.direct clean && make -f Makefile.direct check
rm -f gc.a *.i *.o *.exe tests/*.o gctest gctest_dyn_link test_cpp \
setjmp_test mon.out gmon.out a.out core if_not_there if_mach \
base_lib c++ cord/cordbscs.o cord/cordxtra.o cord/cordprnt.o cord/cordtest cord/de cords \
dont_ar_* threadlibs
rm -f *~
cc -O -I./include -I./libatomic_ops/src -DALL_INTERIOR_POINTERS -DENABLE_DISCLAIM -DGC_ATOMIC_UNCOLLECTABLE -DGC_GCJ_SUPPORT -DJAVA_FINALIZATION -DNO_EXECUTE_PERMISSION -DUSE_MMAP -DUSE_MUNMAP -c -I. ./cord/cordbscs.c
mkdir cord || cat /dev/null
mkdir: cord: File exists
mv cordbscs.o cord/cordbscs.o
cc -O -I./include -I./libatomic_ops/src -DALL_INTERIOR_POINTERS -DENABLE_DISCLAIM -DGC_ATOMIC_UNCOLLECTABLE -DGC_GCJ_SUPPORT -DJAVA_FINALIZATION -DNO_EXECUTE_PERMISSION -DUSE_MMAP -DUSE_MUNMAP -c -I. ./cord/cordxtra.c
mkdir cord || cat /dev/null
mkdir: cord: File exists
mv cordxtra.o cord/cordxtra.o
cc -O -I./include -I./libatomic_ops/src -DALL_INTERIOR_POINTERS -DENABLE_DISCLAIM -DGC_ATOMIC_UNCOLLECTABLE -DGC_GCJ_SUPPORT -DJAVA_FINALIZATION -DNO_EXECUTE_PERMISSION -DUSE_MMAP -DUSE_MUNMAP -c -I. ./cord/cordprnt.c
mkdir cord || cat /dev/null
mkdir: cord: File exists
mv cordprnt.o cord/cordprnt.o
cc -O -I./include -I./libatomic_ops/src -DALL_INTERIOR_POINTERS -DENABLE_DISCLAIM -DGC_ATOMIC_UNCOLLECTABLE -DGC_GCJ_SUPPORT -DJAVA_FINALIZATION -DNO_EXECUTE_PERMISSION -DUSE_MMAP -DUSE_MUNMAP -c -o alloc.o alloc.c
cc -O -I./include -I./libatomic_ops/src -DALL_INTERIOR_POINTERS -DENABLE_DISCLAIM -DGC_ATOMIC_UNCOLLECTABLE -DGC_GCJ_SUPPORT -DJAVA_FINALIZATION -DNO_EXECUTE_PERMISSION -DUSE_MMAP -DUSE_MUNMAP -c -o reclaim.o reclaim.c
cc -O -I./include -I./libatomic_ops/src -DALL_INTERIOR_POINTERS -DENABLE_DISCLAIM -DGC_ATOMIC_UNCOLLECTABLE -DGC_GCJ_SUPPORT -DJAVA_FINALIZATION -DNO_EXECUTE_PERMISSION -DUSE_MMAP -DUSE_MUNMAP -c -o allchblk.o allchblk.c
cc -O -I./include -I./libatomic_ops/src -DALL_INTERIOR_POINTERS -DENABLE_DISCLAIM -DGC_ATOMIC_UNCOLLECTABLE -DGC_GCJ_SUPPORT -DJAVA_FINALIZATION -DNO_EXECUTE_PERMISSION -DUSE_MMAP -DUSE_MUNMAP -c -o misc.o misc.c
cc -O -I./include -I./libatomic_ops/src -DALL_INTERIOR_POINTERS -DENABLE_DISCLAIM -DGC_ATOMIC_UNCOLLECTABLE -DGC_GCJ_SUPPORT -DJAVA_FINALIZATION -DNO_EXECUTE_PERMISSION -DUSE_MMAP -DUSE_MUNMAP -o if_mach ./tools/if_mach.c
cc -O -I./include -I./libatomic_ops/src -DALL_INTERIOR_POINTERS -DENABLE_DISCLAIM -DGC_ATOMIC_UNCOLLECTABLE -DGC_GCJ_SUPPORT -DJAVA_FINALIZATION -DNO_EXECUTE_PERMISSION -DUSE_MMAP -DUSE_MUNMAP -o if_not_there ./tools/if_not_there.c
cc -O -I./include -I./libatomic_ops/src -DALL_INTERIOR_POINTERS -DENABLE_DISCLAIM -DGC_ATOMIC_UNCOLLECTABLE -DGC_GCJ_SUPPORT -DJAVA_FINALIZATION -DNO_EXECUTE_PERMISSION -DUSE_MMAP -DUSE_MUNMAP -o threadlibs ./tools/threadlibs.c
rm -f mach_dep.o
./if_mach SPARC SOLARIS cc -c -o mach_dep2.o ./sparc_mach_dep.S
./if_mach SPARC OPENBSD as -o mach_dep2.o ./sparc_sunos4_mach_dep.s
./if_mach SPARC NETBSD as -o mach_dep2.o ./sparc_netbsd_mach_dep.s
./if_mach SPARC "" cc -c -o mach_dep1.o -I./include -I./libatomic_ops/src ./mach_dep.c
./if_mach SPARC "" ld -r -o mach_dep.o mach_dep1.o mach_dep2.o
./if_mach IA64 "" as -o ia64_save_regs_in_stack.o ./ia64_save_regs_in_stack.s
./if_mach IA64 "" cc -c -o mach_dep1.o -I./include -I./libatomic_ops/src ./mach_dep.c
./if_mach IA64 "" ld -r -o mach_dep.o mach_dep1.o ia64_save_regs_in_stack.o
./if_not_there mach_dep.o || cc -c -I./include -I./libatomic_ops/src ./mach_dep.c
^^^^Starting command^^^^
./if_not_there mach_dep.o || `cygpath -w /bin/sh` cc -c -I./include -I./libatomic_ops/src ./mach_dep.c
./if_not_there mach_dep.o || /bin/sh cc -c -I./include -I./libatomic_ops/src ./mach_dep.c
cc -O -I./include -I./libatomic_ops/src -DALL_INTERIOR_POINTERS -DENABLE_DISCLAIM -DGC_ATOMIC_UNCOLLECTABLE -DGC_GCJ_SUPPORT -DJAVA_FINALIZATION -DNO_EXECUTE_PERMISSION -DUSE_MMAP -DUSE_MUNMAP -c -o os_dep.o os_dep.c
rm -f mark_rts.o
./if_mach ALPHA OSF1 cc -c -O -I./include -I./libatomic_ops/src -DALL_INTERIOR_POINTERS -DENABLE_DISCLAIM -DGC_ATOMIC_UNCOLLECTABLE -DGC_GCJ_SUPPORT -DJAVA_FINALIZATION -DNO_EXECUTE_PERMISSION -DUSE_MMAP -DUSE_MUNMAP -Wo,-notail ./mark_rts.c
./if_not_there mark_rts.o || cc -c -O -I./include -I./libatomic_ops/src -DALL_INTERIOR_POINTERS -DENABLE_DISCLAIM -DGC_ATOMIC_UNCOLLECTABLE -DGC_GCJ_SUPPORT -DJAVA_FINALIZATION -DNO_EXECUTE_PERMISSION -DUSE_MMAP -DUSE_MUNMAP ./mark_rts.c
^^^^Starting command^^^^
./if_not_there mark_rts.o || `cygpath -w /bin/sh` cc -c -O -I./include -I./libatomic_ops/src -DALL_INTERIOR_POINTERS -DENABLE_DISCLAIM -DGC_ATOMIC_UNCOLLECTABLE -DGC_GCJ_SUPPORT -DJAVA_FINALIZATION -DNO_EXECUTE_PERMISSION -DUSE_MMAP -DUSE_MUNMAP ./mark_rts.c
./if_not_there mark_rts.o || /bin/sh cc -c -O -I./include -I./libatomic_ops/src -DALL_INTERIOR_POINTERS -DENABLE_DISCLAIM -DGC_ATOMIC_UNCOLLECTABLE -DGC_GCJ_SUPPORT -DJAVA_FINALIZATION -DNO_EXECUTE_PERMISSION -DUSE_MMAP -DUSE_MUNMAP ./mark_rts.c
cc -O -I./include -I./libatomic_ops/src -DALL_INTERIOR_POINTERS -DENABLE_DISCLAIM -DGC_ATOMIC_UNCOLLECTABLE -DGC_GCJ_SUPPORT -DJAVA_FINALIZATION -DNO_EXECUTE_PERMISSION -DUSE_MMAP -DUSE_MUNMAP -c -o headers.o headers.c
cc -O -I./include -I./libatomic_ops/src -DALL_INTERIOR_POINTERS -DENABLE_DISCLAIM -DGC_ATOMIC_UNCOLLECTABLE -DGC_GCJ_SUPPORT -DJAVA_FINALIZATION -DNO_EXECUTE_PERMISSION -DUSE_MMAP -DUSE_MUNMAP -c -o mark.o mark.c
cc -O -I./include -I./libatomic_ops/src -DALL_INTERIOR_POINTERS -DENABLE_DISCLAIM -DGC_ATOMIC_UNCOLLECTABLE -DGC_GCJ_SUPPORT -DJAVA_FINALIZATION -DNO_EXECUTE_PERMISSION -DUSE_MMAP -DUSE_MUNMAP -c -o obj_map.o obj_map.c
cc -O -I./include -I./libatomic_ops/src -DALL_INTERIOR_POINTERS -DENABLE_DISCLAIM -DGC_ATOMIC_UNCOLLECTABLE -DGC_GCJ_SUPPORT -DJAVA_FINALIZATION -DNO_EXECUTE_PERMISSION -DUSE_MMAP -DUSE_MUNMAP -c -o blacklst.o blacklst.c
cc -O -I./include -I./libatomic_ops/src -DALL_INTERIOR_POINTERS -DENABLE_DISCLAIM -DGC_ATOMIC_UNCOLLECTABLE -DGC_GCJ_SUPPORT -DJAVA_FINALIZATION -DNO_EXECUTE_PERMISSION -DUSE_MMAP -DUSE_MUNMAP -c -o finalize.o finalize.c
cc -O -I./include -I./libatomic_ops/src -DALL_INTERIOR_POINTERS -DENABLE_DISCLAIM -DGC_ATOMIC_UNCOLLECTABLE -DGC_GCJ_SUPPORT -DJAVA_FINALIZATION -DNO_EXECUTE_PERMISSION -DUSE_MMAP -DUSE_MUNMAP -c -o new_hblk.o new_hblk.c
cc -O -I./include -I./libatomic_ops/src -DALL_INTERIOR_POINTERS -DENABLE_DISCLAIM -DGC_ATOMIC_UNCOLLECTABLE -DGC_GCJ_SUPPORT -DJAVA_FINALIZATION -DNO_EXECUTE_PERMISSION -DUSE_MMAP -DUSE_MUNMAP -c -o dbg_mlc.o dbg_mlc.c
cc -O -I./include -I./libatomic_ops/src -DALL_INTERIOR_POINTERS -DENABLE_DISCLAIM -DGC_ATOMIC_UNCOLLECTABLE -DGC_GCJ_SUPPORT -DJAVA_FINALIZATION -DNO_EXECUTE_PERMISSION -DUSE_MMAP -DUSE_MUNMAP -c -o malloc.o malloc.c
cc -O -I./include -I./libatomic_ops/src -DALL_INTERIOR_POINTERS -DENABLE_DISCLAIM -DGC_ATOMIC_UNCOLLECTABLE -DGC_GCJ_SUPPORT -DJAVA_FINALIZATION -DNO_EXECUTE_PERMISSION -DUSE_MMAP -DUSE_MUNMAP -c -o checksums.o checksums.c
cc -O -I./include -I./libatomic_ops/src -DALL_INTERIOR_POINTERS -DENABLE_DISCLAIM -DGC_ATOMIC_UNCOLLECTABLE -DGC_GCJ_SUPPORT -DJAVA_FINALIZATION -DNO_EXECUTE_PERMISSION -DUSE_MMAP -DUSE_MUNMAP -c -o pthread_support.o pthread_support.c
cc -O -I./include -I./libatomic_ops/src -DALL_INTERIOR_POINTERS -DENABLE_DISCLAIM -DGC_ATOMIC_UNCOLLECTABLE -DGC_GCJ_SUPPORT -DJAVA_FINALIZATION -DNO_EXECUTE_PERMISSION -DUSE_MMAP -DUSE_MUNMAP -c -o pthread_stop_world.o pthread_stop_world.c
cc -O -I./include -I./libatomic_ops/src -DALL_INTERIOR_POINTERS -DENABLE_DISCLAIM -DGC_ATOMIC_UNCOLLECTABLE -DGC_GCJ_SUPPORT -DJAVA_FINALIZATION -DNO_EXECUTE_PERMISSION -DUSE_MMAP -DUSE_MUNMAP -c -o darwin_stop_world.o darwin_stop_world.c
cc -O -I./include -I./libatomic_ops/src -DALL_INTERIOR_POINTERS -DENABLE_DISCLAIM -DGC_ATOMIC_UNCOLLECTABLE -DGC_GCJ_SUPPORT -DJAVA_FINALIZATION -DNO_EXECUTE_PERMISSION -DUSE_MMAP -DUSE_MUNMAP -c -o typd_mlc.o typd_mlc.c
cc -O -I./include -I./libatomic_ops/src -DALL_INTERIOR_POINTERS -DENABLE_DISCLAIM -DGC_ATOMIC_UNCOLLECTABLE -DGC_GCJ_SUPPORT -DJAVA_FINALIZATION -DNO_EXECUTE_PERMISSION -DUSE_MMAP -DUSE_MUNMAP -c -o ptr_chck.o ptr_chck.c
cc -O -I./include -I./libatomic_ops/src -DALL_INTERIOR_POINTERS -DENABLE_DISCLAIM -DGC_ATOMIC_UNCOLLECTABLE -DGC_GCJ_SUPPORT -DJAVA_FINALIZATION -DNO_EXECUTE_PERMISSION -DUSE_MMAP -DUSE_MUNMAP -c -o mallocx.o mallocx.c
cc -O -I./include -I./libatomic_ops/src -DALL_INTERIOR_POINTERS -DENABLE_DISCLAIM -DGC_ATOMIC_UNCOLLECTABLE -DGC_GCJ_SUPPORT -DJAVA_FINALIZATION -DNO_EXECUTE_PERMISSION -DUSE_MMAP -DUSE_MUNMAP -c -o gcj_mlc.o gcj_mlc.c
cc -O -I./include -I./libatomic_ops/src -DALL_INTERIOR_POINTERS -DENABLE_DISCLAIM -DGC_ATOMIC_UNCOLLECTABLE -DGC_GCJ_SUPPORT -DJAVA_FINALIZATION -DNO_EXECUTE_PERMISSION -DUSE_MMAP -DUSE_MUNMAP -c -o specific.o specific.c
cc -O -I./include -I./libatomic_ops/src -DALL_INTERIOR_POINTERS -DENABLE_DISCLAIM -DGC_ATOMIC_UNCOLLECTABLE -DGC_GCJ_SUPPORT -DJAVA_FINALIZATION -DNO_EXECUTE_PERMISSION -DUSE_MMAP -DUSE_MUNMAP -c -o gc_dlopen.o gc_dlopen.c
cc -O -I./include -I./libatomic_ops/src -DALL_INTERIOR_POINTERS -DENABLE_DISCLAIM -DGC_ATOMIC_UNCOLLECTABLE -DGC_GCJ_SUPPORT -DJAVA_FINALIZATION -DNO_EXECUTE_PERMISSION -DUSE_MMAP -DUSE_MUNMAP -c -o backgraph.o backgraph.c
cc -O -I./include -I./libatomic_ops/src -DALL_INTERIOR_POINTERS -DENABLE_DISCLAIM -DGC_ATOMIC_UNCOLLECTABLE -DGC_GCJ_SUPPORT -DJAVA_FINALIZATION -DNO_EXECUTE_PERMISSION -DUSE_MMAP -DUSE_MUNMAP -c -o win32_threads.o win32_threads.c
cc -O -I./include -I./libatomic_ops/src -DALL_INTERIOR_POINTERS -DENABLE_DISCLAIM -DGC_ATOMIC_UNCOLLECTABLE -DGC_GCJ_SUPPORT -DJAVA_FINALIZATION -DNO_EXECUTE_PERMISSION -DUSE_MMAP -DUSE_MUNMAP -c -o pthread_start.o pthread_start.c
cc -O -I./include -I./libatomic_ops/src -DALL_INTERIOR_POINTERS -DENABLE_DISCLAIM -DGC_ATOMIC_UNCOLLECTABLE -DGC_GCJ_SUPPORT -DJAVA_FINALIZATION -DNO_EXECUTE_PERMISSION -DUSE_MMAP -DUSE_MUNMAP -c -o thread_local_alloc.o thread_local_alloc.c
cc -O -I./include -I./libatomic_ops/src -DALL_INTERIOR_POINTERS -DENABLE_DISCLAIM -DGC_ATOMIC_UNCOLLECTABLE -DGC_GCJ_SUPPORT -DJAVA_FINALIZATION -DNO_EXECUTE_PERMISSION -DUSE_MMAP -DUSE_MUNMAP -c -o fnlz_mlc.o fnlz_mlc.c
make: *** No rule to make target `libatomic_ops/src/atomic_ops.c', needed by `atomic_ops.o'. Stop.
You need either to unpack libatomic_ops (any version) to the current folder or add extra flag like this: make -f Makefile.direct check CFLAGS_EXTRA=-DGC_BUILTIN_ATOMIC
I thought if the compiler supported atomics that the library wasn't needed? Also, does this explain the original error which had to do with the static library?
I thought if the compiler supported atomics that the library wasn't needed?
Correct. configure detects this case and defines GC_BUILTIN_ATOMIC macro automatically if the built-in atomic primitives are supported. If you use an alternate build script (e.g. Makefile.direct), the automatic detection is not supported. That's why you should ether have libatomic_ops source o pass -D GC_BUILTIN_ATOMIC to CFLAGS.
Also, does this explain the original error which had to do with the static library? No. If Makefile.direct works then something is wrong with autotools or configure.ac (or Makefile.am) I think.
I don't know the root cause of the failure and I can't reproduce it, so you are the best person who could figure it out (and, ideally, make a fix).
OK, I will see if I can get Makefile.direct going as per your prescription.
As far as root cause, I will do what I can but I need to get into the world of autoconf and ./configure (a totally foreign area I've never needed to focus on).
Frank
Update: I was able to get Makfile.direct working:
AR
LD
and RANLIB
to LLVM
alternatives: llvm-ar
, llvm-ldd
and llvm-ranlib
respectively make -f Makefile.direct clean && make -f Makefile.direct check
./setjmp_test
This appears to be a X86_64 running DARWIN
Stack appears to grow down, which is the default.
A good guess for STACKBOTTOM on this machine is 0xef098000.
Note that this may vary between machines of ostensibly
the same architecture (e.g. Sun 3/50s and 3/80s).
On many machines the value is not fixed.
A good guess for ALIGNMENT on this machine is 8.
The following is a very dubious test of one root marking strategy.
Results may not be accurate/useful:
Setjmp-based register marking code may work.
Some GC internal configuration stuff:
WORDSZ = 64, ALIGNMENT = 8, GC_GRANULE_BYTES = 16
Using one mark bit per granule.
./gctest
Completed 1 tests
Allocated 602686 collectable objects
Allocated 203 uncollectable objects
Allocated 1292470 atomic objects
Reallocated 126 objects
Finalized 2202/2202 objects - finalization is probably ok
Total number of bytes allocated is 100866169
Total memory use by allocated blocks is 851968 bytes
Final heap size is 147456 bytes
Final number of reachable objects is 473
Completed 96 collections in 7 ms
Collector appears to work
cord/cordtest
GC Warning: Memory unmapping is disabled as incompatible with MPROTECT_VDB
SUCCEEDED
So, as I installed clang
and LLVM 7.0.1
vis-a-vis Homebrew
I have to redirect
OK but this is a workaround of the reported issue, not a fix. So I leave this issue open.
It certainly is and I agree with keeping it open. But the system state that required the workaround is something (hopefully) detectable and incorporated into a fix. As I have the time I am looking into autoconf
and configure
to make it a fix.
Another update in investigation. I've overcome the 'can't find symbol...' with the following:
./configure --enable-static --disable-shared AR=llvm-ar RANLIB=llvm-ranlib
However, with make check
when it goes to link the test, it is showing:
libtool: link: gcc -fexceptions -Wall -Wextra -Wpedantic -Wno-long-long -g -O2 -fno-strict-aliasing -o cordtest cord/tests/cordtest.o ./.libs/libgc.a ./.libs/libcord.a /Users/mymachine/Downloads/gc-8.0.2/.libs/libgc.a -lpthread
duplicate symbol _GC_block_was_dirty in:
./.libs/libgc.a(mark.o)
/Users/mymachinei/Downloads/gc-8.0.2/.libs/libgc.a(mark.o)
And so on for about 290 symbols. Note that the libgc.a
is represented twice in the link and if I remove one of them, as you would expect, it links OK.
I'm not sure to where to look to see why the static library is added twice to the link line.
What's the current folder? I don't understand why 2 libgc.a files were created. (Have you run "make clean"?)
The current folder is either ~/bdwgc
or ~/Downloads/gc-8.0.2
(same issues). There are not 2 libgc.a files, just that from the make it is including it twice with a relative and fully qualified statement.
libtool: link: gcc -fexceptions -Wall -Wextra -Wpedantic -Wno-long-long -g -O2 -fno-strict-aliasing -o cordtest cord/tests/cordtest.o ./.libs/libgc.a ./.libs/libcord.a /Users/mymachine/Downloads/gc-8.0.2/.libs/libgc.a -lpthread
I reproduced it (libgc.a specified twice) on Cygwin. I don't understand the reason though.
I have time this week to see if I can find/fix it.
Good, thank you. I think tests.am and cord.am should be fixed somehow.
The issue should be fixed now in master. Please test it.
On macOS Mojave 10.14.1 clang 7.0.1 (LLVM)
Ran:
Seemed that the tests were compiled but at linking: