Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation breaks in Ubuntu 11.10 #257

Closed
otoburb opened this issue Oct 14, 2011 · 2 comments
Closed

Compilation breaks in Ubuntu 11.10 #257

otoburb opened this issue Oct 14, 2011 · 2 comments

Comments

@otoburb
Copy link
Contributor

otoburb commented Oct 14, 2011

https://wiki.ubuntu.com/NattyNarwhal/ToolchainTransition

This seems to be a deliberate move by Canonical in an attempt to reduce indirect linking for shared libraries. This was done supposedly to increase the robustness of dependencies by forcing direct linking in the command line.

@mrjbq7
Copy link
Member

mrjbq7 commented Oct 14, 2011

From http://paste.factorcode.org/paste?id=2368

g++ -ldl -lm -lrt -lpthread -lpango-1.0 -lpangocairo-1.0 -lcairo -lglib-2.0 -lgobject-2.0 -lgtk-x11-2.0 -lgdk-x11-2.0 -lgdk_pixbuf-2.0 -lgtkglext-x11-1.0 -latk-1.0 -lgio-2.0 -lgdkglext-x11-1.0 -lGL -Wl,--export-dynamic -L/usr/X11R6/lib64 -L/usr/X11R6/lib -L. vm/os-unix.o vm/os-genunix.o vm/os-linux.o vm/mvm-unix.o vm/aging_collector.o vm/alien.o vm/arrays.o vm/bignum.o vm/booleans.o vm/byte_arrays.o vm/callbacks.o vm/callstack.o vm/code_blocks.o vm/code_heap.o vm/compaction.o vm/contexts.o vm/data_heap.o vm/data_heap_checker.o vm/debug.o vm/dispatch.o vm/entry_points.o vm/errors.o vm/factor.o vm/free_list.o vm/full_collector.o vm/gc.o vm/gc_info.o vm/image.o vm/inline_cache.o vm/instruction_operands.o vm/io.o vm/jit.o vm/math.o vm/mvm.o vm/nursery_collector.o vm/object_start_map.o vm/objects.o vm/primitives.o vm/profiler.o vm/quotations.o vm/run.o vm/strings.o vm/to_tenured_collector.o vm/tuples.o vm/utilities.o vm/vm.o vm/words.o \
                -Wall  -O3 -fomit-frame-pointer -o factor vm/main-unix.o
ar rcs libfactor.a vm/os-unix.o vm/os-genunix.o vm/os-linux.o vm/mvm-unix.o vm/aging_collector.o vm/alien.o vm/arrays.o vm/bignum.o vm/booleans.o vm/byte_arrays.o vm/callbacks.o vm/callstack.o vm/code_blocks.o vm/code_heap.o vm/compaction.o vm/contexts.o vm/data_heap.o vm/data_heap_checker.o vm/debug.o vm/dispatch.o vm/entry_points.o vm/errors.o vm/factor.o vm/free_list.o vm/full_collector.o vm/gc.o vm/gc_info.o vm/image.o vm/inline_cache.o vm/instruction_operands.o vm/io.o vm/jit.o vm/math.o vm/mvm.o vm/nursery_collector.o vm/object_start_map.o vm/objects.o vm/primitives.o vm/profiler.o vm/quotations.o vm/run.o vm/strings.o vm/to_tenured_collector.o vm/tuples.o vm/utilities.o vm/vm.o vm/words.o
vm/os-unix.o: In function `factor::start_thread(void* (*)(void*), void*)':
os-unix.cpp:(.text+0x3eb): undefined reference to `pthread_create'
vm/os-unix.o: In function `factor::factor_vm::init_ffi()':
os-unix.cpp:(.text+0x50c): undefined reference to `dlopen'
vm/os-unix.o: In function `factor::factor_vm::ffi_dlopen(factor::dll*)':
os-unix.cpp:(.text+0x536): undefined reference to `dlopen'
vm/os-unix.o: In function `factor::factor_vm::ffi_dlclose(factor::dll*)':
os-unix.cpp:(.text+0x599): undefined reference to `dlclose'
vm/os-unix.o: In function `factor::open_console()':
os-unix.cpp:(.text+0xe21): undefined reference to `pthread_create'
vm/os-unix.o: In function `factor::factor_vm::ffi_dlsym_raw(factor::dll*, char*)':
os-unix.cpp:(.text+0x554): undefined reference to `dlsym'
vm/os-unix.o: In function `factor::factor_vm::ffi_dlsym(factor::dll*, char*)':
os-unix.cpp:(.text+0x574): undefined reference to `dlsym'
vm/os-genunix.o: In function `factor::nano_count()':
os-genunix.cpp:(.text+0xcd): undefined reference to `clock_gettime'
vm/mvm-unix.o: In function `factor::init_mvm()':
mvm-unix.cpp:(.text+0xc): undefined reference to `pthread_key_create'
vm/mvm-unix.o: In function `factor::current_vm()':
mvm-unix.cpp:(.text+0x4b): undefined reference to `pthread_getspecific'
vm/mvm-unix.o: In function `factor::register_vm_with_thread(factor::factor_vm*)':
mvm-unix.cpp:(.text+0x3a): undefined reference to `pthread_setspecific'
collect2: ld returned 1 exit status
make[1]: *** [factor] Error 1
make[1]: Leaving directory `/home/otoburb/factor'
make: *** [linux-x86-64] Error 2
make failed

@otoburb
Copy link
Contributor Author

otoburb commented Oct 14, 2011

This is fixed by modifying GNUmakefile and moving $(LIBS) after the .o files are listed.

--- a/GNUmakefile
+++ b/GNUmakefile
@@ -177,12 +177,12 @@ $(ENGINE): $(DLL_OBJS)
factor-lib: $(ENGINE)

factor: $(EXE_OBJS) $(DLL_OBJS)

  •   $(TOOLCHAIN_PREFIX)$(CPP) $(LIBS) $(LIBPATH) -L. $(DLL_OBJS) \
    
  •           $(CFLAGS) -o $(EXECUTABLE) $(EXE_OBJS)
    
  •   $(TOOLCHAIN_PREFIX)$(CPP) $(LIBPATH) -L. $(DLL_OBJS) \
    
  •           $(CFLAGS) -o $(EXECUTABLE) $(LIBS) $(EXE_OBJS)
    

    factor-console: $(EXE_OBJS) $(DLL_OBJS)

  •   $(TOOLCHAIN_PREFIX)$(CPP) $(LIBS) $(LIBPATH) -L. $(DLL_OBJS) \
    
  •           $(CFLAGS) $(CFLAGS_CONSOLE) -o $(CONSOLE_EXECUTABLE) $(EXE_OBJS)
    
  •   $(TOOLCHAIN_PREFIX)$(CPP) $(LIBPATH) -L. $(DLL_OBJS) \
    
  •           $(CFLAGS) $(CFLAGS_CONSOLE) -o $(CONSOLE_EXECUTABLE) $(LIBS) $(EXE_OBJS)
    

    factor-ffi-test: $(FFI_TEST_LIBRARY)

@otoburb otoburb closed this as completed Oct 14, 2011
@otoburb otoburb reopened this Oct 14, 2011
@otoburb otoburb closed this as completed Oct 14, 2011
mrjbq7 added a commit to mrjbq7/factor that referenced this issue Oct 14, 2011
mrjbq7 added a commit that referenced this issue Jun 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants