gearman / gearmand

http://gearman.org/
Other
740 stars 137 forks source link

It's complicated to build a statically linked gearmand #285

Open thibaultduponchelle opened 4 years ago

thibaultduponchelle commented 4 years ago

Hello,

First thank you for gearmand :)

Simple question, can we build gearmand statically ?

I'm personally not able to make it with :

./configure --disable-shared
make

(I tried also some alternative like --all-static).

I'm able to compile a very old version (0.12) but 1.1.18 and 1.1.19 fails with errors.

I suspect a "static linking name collision" or a problem with C and C++ mixed code (missing extern C?).

Are you aware of somebody able to compile recent gearmand statically? I'm doing something wrong? What do you think?

Thank you a lot in advance, sorry for annoyance.

Thibault

  CCLD     docs/source/libgearman/examples/gearman_execute_partition
libgearman/.libs/libgearman.a(libgearman_libgearman_la-client.o): In function `_client_allocate(gearman_client_st*, bool)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/client.cc:62: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/client.cc:62: undefined reference to `operator new(unsigned long, std::nothrow_t const&)'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/client.cc:62: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/client.cc:62: undefined reference to `operator delete(void*, std::nothrow_t const&)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-client.o): In function `gearman_client_free.part.11':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/client.cc:321: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-client.o):(.data.rel.local.DW.ref.__gxx_personality_v0[DW.ref.__gxx_personality_v0]+0x0): undefined reference to `__gxx_personality_v0'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-connection.o): In function `gearman_connection_copy(gearman_universal_st&, gearman_connection_st const&)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/connection.cc:175: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/connection.cc:175: undefined reference to `operator new(unsigned long, std::nothrow_t const&)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-connection.o): In function `gearman_connection_create(gearman_universal_st&, char const*, char const*)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/connection.cc:134: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/connection.cc:134: undefined reference to `operator new(unsigned long, std::nothrow_t const&)'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/connection.cc:139: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-packet.o): In function `gearman_packet_free(gearman_packet_st*)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/packet.cc:257: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-task.o): In function `Task::~Task()':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:442: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-task.o): In function `gearman_task_internal_create(Client*, gearman_task_st*)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:59: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:59: undefined reference to `operator new(unsigned long, std::nothrow_t const&)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-task.o): In function `Task::result(gearman_result_st*)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:442: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-task.o): In function `Task::create_result(unsigned long)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:455: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:455: undefined reference to `operator new(unsigned long, std::nothrow_t const&)'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:455: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:455: undefined reference to `operator delete(void*, std::nothrow_t const&)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-task.o): In function `gearman_task_free':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:127: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-server_options.o): In function `gearman_request_option(gearman_universal_st&, gearman_string_t&)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/server_options.cc:54: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/server_options.cc:54: undefined reference to `operator new(unsigned long, std::nothrow_t const&)'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/server_options.cc:54: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/server_options.cc:54: undefined reference to `operator delete(void*, std::nothrow_t const&)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-universal.o): In function `gearman_free_all_cons(gearman_universal_st&)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/universal.cc:225: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-universal.o): In function `gearman_universal_free(gearman_universal_st&)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/universal.cc:137: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-vector.o): In function `gearman_string_free':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/vector.cc:399: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-vector.o): In function `gearman_string_create(gearman_vector_st*, unsigned long)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/vector.cc:147: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/vector.cc:147: undefined reference to `operator new(unsigned long, std::nothrow_t const&)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-check.o): In function `OptionCheck::~OptionCheck()':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/./libgearman/check.h:60: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-check.o): In function `CancelCheck::~CancelCheck()':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/./libgearman/check.h:80: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-check.o): In function `EchoCheck::~EchoCheck()':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/./libgearman/check.h:47: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-check.o):(.data.rel.ro._ZTI5Check[_ZTI5Check]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-check.o):(.data.rel.ro._ZTI9EchoCheck[_ZTI9EchoCheck]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-check.o):(.data.rel.ro._ZTI11OptionCheck[_ZTI11OptionCheck]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-check.o):(.data.rel.ro._ZTI11CancelCheck[_ZTI11CancelCheck]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
collect2: error: ld returned 1 exit status
Makefile:4370: recipe for target 'docs/source/libgearman/examples/gearman_client_do_background_example' failed
make[2]: *** [docs/source/libgearman/examples/gearman_client_do_background_example] Error 1
make[2]: *** Waiting for unfinished jobs....
libgearman/.libs/libgearman.a(libgearman_libgearman_la-client.o): In function `_client_allocate(gearman_client_st*, bool)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/client.cc:62: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/client.cc:62: undefined reference to `operator new(unsigned long, std::nothrow_t const&)'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/client.cc:62: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/client.cc:62: undefined reference to `operator delete(void*, std::nothrow_t const&)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-client.o): In function `gearman_client_free.part.11':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/client.cc:321: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-client.o):(.data.rel.local.DW.ref.__gxx_personality_v0[DW.ref.__gxx_personality_v0]+0x0): undefined reference to `__gxx_personality_v0'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-connection.o): In function `gearman_connection_copy(gearman_universal_st&, gearman_connection_st const&)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/connection.cc:175: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/connection.cc:175: undefined reference to `operator new(unsigned long, std::nothrow_t const&)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-connection.o): In function `gearman_connection_create(gearman_universal_st&, char const*, char const*)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/connection.cc:134: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/connection.cc:134: undefined reference to `operator new(unsigned long, std::nothrow_t const&)'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/connection.cc:139: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-packet.o): In function `gearman_packet_free(gearman_packet_st*)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/packet.cc:257: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-task.o): In function `Task::~Task()':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:442: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-task.o): In function `gearman_task_internal_create(Client*, gearman_task_st*)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:59: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:59: undefined reference to `operator new(unsigned long, std::nothrow_t const&)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-task.o): In function `Task::result(gearman_result_st*)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:442: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-task.o): In function `Task::create_result(unsigned long)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:455: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:455: undefined reference to `operator new(unsigned long, std::nothrow_t const&)'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:455: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:455: undefined reference to `operator delete(void*, std::nothrow_t const&)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-task.o): In function `gearman_task_free':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:127: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-server_options.o): In function `gearman_request_option(gearman_universal_st&, gearman_string_t&)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/server_options.cc:54: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/server_options.cc:54: undefined reference to `operator new(unsigned long, std::nothrow_t const&)'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/server_options.cc:54: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/server_options.cc:54: undefined reference to `operator delete(void*, std::nothrow_t const&)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-universal.o): In function `gearman_free_all_cons(gearman_universal_st&)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/universal.cc:225: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-universal.o): In function `gearman_universal_free(gearman_universal_st&)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/universal.cc:137: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-vector.o): In function `gearman_string_free':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/vector.cc:399: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-vector.o): In function `gearman_string_create(gearman_vector_st*, unsigned long)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/vector.cc:147: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/vector.cc:147: undefined reference to `operator new(unsigned long, std::nothrow_t const&)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-check.o): In function `OptionCheck::~OptionCheck()':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/./libgearman/check.h:60: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-check.o): In function `CancelCheck::~CancelCheck()':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/./libgearman/check.h:80: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-check.o): In function `EchoCheck::~EchoCheck()':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/./libgearman/check.h:47: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-check.o):(.data.rel.ro._ZTI5Check[_ZTI5Check]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-check.o):(.data.rel.ro._ZTI9EchoCheck[_ZTI9EchoCheck]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-check.o):(.data.rel.ro._ZTI11OptionCheck[_ZTI11OptionCheck]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-check.o):(.data.rel.ro._ZTI11CancelCheck[_ZTI11CancelCheck]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
collect2: error: ld returned 1 exit status
Makefile:4377: recipe for target 'docs/source/libgearman/examples/gearman_client_do_example' failed
make[2]: *** [docs/source/libgearman/examples/gearman_client_do_example] Error 1
libgearman/.libs/libgearman.a(libgearman_libgearman_la-client.o): In function `_client_allocate(gearman_client_st*, bool)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/client.cc:62: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/client.cc:62: undefined reference to `operator new(unsigned long, std::nothrow_t const&)'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/client.cc:62: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/client.cc:62: undefined reference to `operator delete(void*, std::nothrow_t const&)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-client.o): In function `gearman_client_free.part.11':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/client.cc:321: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-client.o):(.data.rel.local.DW.ref.__gxx_personality_v0[DW.ref.__gxx_personality_v0]+0x0): undefined reference to `__gxx_personality_v0'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-connection.o): In function `gearman_connection_copy(gearman_universal_st&, gearman_connection_st const&)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/connection.cc:175: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/connection.cc:175: undefined reference to `operator new(unsigned long, std::nothrow_t const&)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-connection.o): In function `gearman_connection_create(gearman_universal_st&, char const*, char const*)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/connection.cc:134: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/connection.cc:134: undefined reference to `operator new(unsigned long, std::nothrow_t const&)'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/connection.cc:139: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-packet.o): In function `gearman_packet_free(gearman_packet_st*)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/packet.cc:257: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-task.o): In function `Task::~Task()':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:442: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-task.o): In function `gearman_task_internal_create(Client*, gearman_task_st*)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:59: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:59: undefined reference to `operator new(unsigned long, std::nothrow_t const&)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-task.o): In function `Task::result(gearman_result_st*)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:442: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-task.o): In function `Task::create_result(unsigned long)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:455: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:455: undefined reference to `operator new(unsigned long, std::nothrow_t const&)'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:455: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:455: undefined reference to `operator delete(void*, std::nothrow_t const&)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-task.o): In function `gearman_task_free':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:127: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-server_options.o): In function `gearman_request_option(gearman_universal_st&, gearman_string_t&)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/server_options.cc:54: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/server_options.cc:54: undefined reference to `operator new(unsigned long, std::nothrow_t const&)'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/server_options.cc:54: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/server_options.cc:54: undefined reference to `operator delete(void*, std::nothrow_t const&)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-universal.o): In function `gearman_free_all_cons(gearman_universal_st&)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/universal.cc:225: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-universal.o): In function `gearman_universal_free(gearman_universal_st&)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/universal.cc:137: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-vector.o): In function `gearman_string_free':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/vector.cc:399: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-vector.o): In function `gearman_string_create(gearman_vector_st*, unsigned long)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/vector.cc:147: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/vector.cc:147: undefined reference to `operator new(unsigned long, std::nothrow_t const&)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-check.o): In function `OptionCheck::~OptionCheck()':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/./libgearman/check.h:60: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-check.o): In function `CancelCheck::~CancelCheck()':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/./libgearman/check.h:80: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-check.o): In function `EchoCheck::~EchoCheck()':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/./libgearman/check.h:47: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-check.o):(.data.rel.ro._ZTI5Check[_ZTI5Check]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-check.o):(.data.rel.ro._ZTI9EchoCheck[_ZTI9EchoCheck]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-check.o):(.data.rel.ro._ZTI11OptionCheck[_ZTI11OptionCheck]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-check.o):(.data.rel.ro._ZTI11CancelCheck[_ZTI11CancelCheck]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
collect2: error: ld returned 1 exit status
Makefile:4384: recipe for target 'docs/source/libgearman/examples/gearman_execute_example' failed
make[2]: *** [docs/source/libgearman/examples/gearman_execute_example] Error 1
libgearman/.libs/libgearman.a(libgearman_libgearman_la-client.o): In function `_client_allocate(gearman_client_st*, bool)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/client.cc:62: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/client.cc:62: undefined reference to `operator new(unsigned long, std::nothrow_t const&)'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/client.cc:62: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/client.cc:62: undefined reference to `operator delete(void*, std::nothrow_t const&)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-client.o): In function `gearman_client_free.part.11':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/client.cc:321: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-client.o):(.data.rel.local.DW.ref.__gxx_personality_v0[DW.ref.__gxx_personality_v0]+0x0): undefined reference to `__gxx_personality_v0'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-connection.o): In function `gearman_connection_copy(gearman_universal_st&, gearman_connection_st const&)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/connection.cc:175: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/connection.cc:175: undefined reference to `operator new(unsigned long, std::nothrow_t const&)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-connection.o): In function `gearman_connection_create(gearman_universal_st&, char const*, char const*)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/connection.cc:134: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/connection.cc:134: undefined reference to `operator new(unsigned long, std::nothrow_t const&)'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/connection.cc:139: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-packet.o): In function `gearman_packet_free(gearman_packet_st*)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/packet.cc:257: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-task.o): In function `Task::~Task()':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:442: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-task.o): In function `gearman_task_internal_create(Client*, gearman_task_st*)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:59: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:59: undefined reference to `operator new(unsigned long, std::nothrow_t const&)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-task.o): In function `Task::result(gearman_result_st*)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:442: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-task.o): In function `Task::create_result(unsigned long)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:455: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:455: undefined reference to `operator new(unsigned long, std::nothrow_t const&)'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:455: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:455: undefined reference to `operator delete(void*, std::nothrow_t const&)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-task.o): In function `gearman_task_free':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:127: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-server_options.o): In function `gearman_request_option(gearman_universal_st&, gearman_string_t&)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/server_options.cc:54: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/server_options.cc:54: undefined reference to `operator new(unsigned long, std::nothrow_t const&)'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/server_options.cc:54: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/server_options.cc:54: undefined reference to `operator delete(void*, std::nothrow_t const&)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-universal.o): In function `gearman_free_all_cons(gearman_universal_st&)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/universal.cc:225: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-universal.o): In function `gearman_universal_free(gearman_universal_st&)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/universal.cc:137: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-vector.o): In function `gearman_string_free':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/vector.cc:399: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-vector.o): In function `gearman_string_create(gearman_vector_st*, unsigned long)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/vector.cc:147: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/vector.cc:147: undefined reference to `operator new(unsigned long, std::nothrow_t const&)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-check.o): In function `OptionCheck::~OptionCheck()':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/./libgearman/check.h:60: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-check.o): In function `CancelCheck::~CancelCheck()':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/./libgearman/check.h:80: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-check.o): In function `EchoCheck::~EchoCheck()':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/./libgearman/check.h:47: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-check.o):(.data.rel.ro._ZTI5Check[_ZTI5Check]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-check.o):(.data.rel.ro._ZTI9EchoCheck[_ZTI9EchoCheck]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-check.o):(.data.rel.ro._ZTI11OptionCheck[_ZTI11OptionCheck]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-check.o):(.data.rel.ro._ZTI11CancelCheck[_ZTI11CancelCheck]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
collect2: error: ld returned 1 exit status
Makefile:4391: recipe for target 'docs/source/libgearman/examples/gearman_execute_partition' failed
make[2]: *** [docs/source/libgearman/examples/gearman_execute_partition] Error 1
make[2]: Leaving directory '/home/tduponchelle/Downloads/gearmand-1.1.19.1'
Makefile:8322: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/tduponchelle/Downloads/gearmand-1.1.19.1'
Makefile:3085: recipe for target 'all' failed
make: *** [all] Error 2
esabol commented 4 years ago

I'm not aware of anyone who has compiled gearmand statically or even expressed interest in doing so.

What's the use-case for this?

thibaultduponchelle commented 4 years ago

Thank you for the quick lightning fast feedback :)

It is for the Perl packaging using “Alien system”. Precisely it is to upgrade Alien::Gearman from 0.12 to latest gearmand

https://metacpan.org/release/Alien-Gearman

esabol commented 4 years ago

That sounds like a worthy goal. So why does it need to be static?

https://metacpan.org/pod/distribution/Alien-Gearman/README.pod says it's a wrapper for libgearman, not gearmand. Are you trying to compile a libgearman.a?

thibaultduponchelle commented 4 years ago

From the Alien doc:

`When building from source code, build static libraries whenever possible

Or at least isolate the dynamic libraries so they can be used by FFI, but do not use them to build XS modules. The reason for this is that if an end user upgrades their version of Alien::Foo it may break the already installed version of Foo::XS that used it when it was installed.`

(Here it is not for FFI)

Yes I want libgearman.a

Do you propose to only compile this part?

esabol commented 4 years ago

Well, you certainly don't need docs/source/libgearman/examples/gearman_execute_partition. That's sample code.

In order to compile C++ programs statically, I think you need to install static versions of libg++ and libc (yum install glibc-static libstdc++-static or the equivalent).

Anyway, I tried the following on CentOS 7.8:

env CXXLDFLAGS='--all-static' ./configure --enable-static --disable-shared --with-postgresql=no
env LDFLAGS='--all-static' CXXLDFLAGS='--all-static' make

And it got fairly far along, but it errored out in some libtest code. When it was done, there was a ./libgearman/.libs/libgearman.a however. I have no idea if it works or not though.

% nm ./libgearman/.libs/libgearman.a | head

libgearman_libgearman_la-check.o:
                 U __cxa_pure_virtual
                 U _GLOBAL_OFFSET_TABLE_
0000000000000000 r .LC0
0000000000000010 r .LC1
00000000000000a6 r .LC10
0000000000000098 r .LC11
00000000000000be r .LC12
00000000000000d8 r .LC13

I'm afraid you'll have to do the heavy lifting here.

thibaultduponchelle commented 4 years ago

Wow thank you a lot for this investigation. I will do further tests tomorrow and keep you informed.

Once again thank you a lot.

thibaultduponchelle commented 4 years ago

I got it.

The command :

/bin/bash ./libtool --silent --tag=CC   --mode=link cc  -g -O2  -Wno-unknown-pragmas -Wno-pragmas -Wall -Wextra -Wunsuffixed-float-constants -Wjump-misses-init -Wno-attributes -Waddress -Wvarargs -Warray-bounds -Wbad-function-cast -Wchar-subscripts -Wcomment -Wfloat-equal -Wformat-security -Wformat=2 -Wformat-y2k -Wlogical-op -Wmaybe-uninitialized -Wmissing-field-initializers -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs -Wnormalized=id -Woverride-init -Wpointer-arith -Wpointer-sign -Wredundant-decls -Wshadow -Wsign-compare -Wstrict-overflow=1 -Wswitch-enum -Wtrampolines -Wundef -funsafe-loop-optimizations -Wclobbered -Wunused -Wunused-result -Wunused-variable -Wunused-parameter -Wunused-local-typedefs -Wwrite-strings -fwrapv -pipe -fPIE -pie -Wsizeof-pointer-memaccess -Wpacked   -o docs/source/libgearman/examples/gearman_execute_partition docs/source/libgearman/examples/gearman_execute_partition.o libgearman/libgearman.la

is crashing because of c compiler :

libgearman/.libs/libgearman.a(libgearman_libgearman_la-client.o): In function `_client_allocate(gearman_client_st*, bool)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/client.cc:62: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/client.cc:62: undefined reference to `operator new(unsigned long, std::nothrow_t const&)'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/client.cc:62: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/client.cc:62: undefined reference to `operator delete(void*, std::nothrow_t const&)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-client.o): In function `gearman_client_free.part.11':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/client.cc:321: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-client.o):(.data.rel.local.DW.ref.__gxx_personality_v0[DW.ref.__gxx_personality_v0]+0x0): undefined reference to `__gxx_personality_v0'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-connection.o): In function `gearman_connection_copy(gearman_universal_st&, gearman_connection_st const&)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/connection.cc:175: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/connection.cc:175: undefined reference to `operator new(unsigned long, std::nothrow_t const&)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-connection.o): In function `gearman_connection_create(gearman_universal_st&, char const*, char const*)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/connection.cc:134: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/connection.cc:134: undefined reference to `operator new(unsigned long, std::nothrow_t const&)'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/connection.cc:139: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-packet.o): In function `gearman_packet_free(gearman_packet_st*)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/packet.cc:257: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-task.o): In function `Task::~Task()':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:442: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-task.o): In function `gearman_task_internal_create(Client*, gearman_task_st*)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:59: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:59: undefined reference to `operator new(unsigned long, std::nothrow_t const&)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-task.o): In function `Task::result(gearman_result_st*)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:442: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-task.o): In function `Task::create_result(unsigned long)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:455: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:455: undefined reference to `operator new(unsigned long, std::nothrow_t const&)'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:455: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:455: undefined reference to `operator delete(void*, std::nothrow_t const&)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-task.o): In function `gearman_task_free':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/task.cc:127: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-server_options.o): In function `gearman_request_option(gearman_universal_st&, gearman_string_t&)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/server_options.cc:54: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/server_options.cc:54: undefined reference to `operator new(unsigned long, std::nothrow_t const&)'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/server_options.cc:54: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/server_options.cc:54: undefined reference to `operator delete(void*, std::nothrow_t const&)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-universal.o): In function `gearman_free_all_cons(gearman_universal_st&)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/universal.cc:225: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-universal.o): In function `gearman_universal_free(gearman_universal_st&)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/universal.cc:137: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-vector.o): In function `gearman_string_free':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/vector.cc:399: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-vector.o): In function `gearman_string_create(gearman_vector_st*, unsigned long)':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/vector.cc:147: undefined reference to `std::nothrow'
/home/tduponchelle/Downloads/gearmand-1.1.19.1/libgearman/vector.cc:147: undefined reference to `operator new(unsigned long, std::nothrow_t const&)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-check.o): In function `OptionCheck::~OptionCheck()':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/./libgearman/check.h:60: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-check.o): In function `CancelCheck::~CancelCheck()':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/./libgearman/check.h:80: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-check.o): In function `EchoCheck::~EchoCheck()':
/home/tduponchelle/Downloads/gearmand-1.1.19.1/./libgearman/check.h:47: undefined reference to `operator delete(void*)'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-check.o):(.data.rel.ro._ZTI5Check[_ZTI5Check]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-check.o):(.data.rel.ro._ZTI9EchoCheck[_ZTI9EchoCheck]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-check.o):(.data.rel.ro._ZTI11OptionCheck[_ZTI11OptionCheck]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
libgearman/.libs/libgearman.a(libgearman_libgearman_la-check.o):(.data.rel.ro._ZTI11CancelCheck[_ZTI11CancelCheck]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
collect2: error: ld returned 1 exit status

But the same with c++ compiler does not :

/bin/bash ./libtool --silent --tag=CC   --mode=link c++  -g -O2  -Wno-unknown-pragmas -Wno-pragmas -Wall -Wextra -Wunsuffixed-float-constants -Wjump-misses-init -Wno-attributes -Waddress -Wvarargs -Warray-bounds -Wbad-function-cast -Wchar-subscripts -Wcomment -Wfloat-equal -Wformat-security -Wformat=2 -Wformat-y2k -Wlogical-op -Wmaybe-uninitialized -Wmissing-field-initializers -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs -Wnormalized=id -Woverride-init -Wpointer-arith -Wpointer-sign -Wredundant-decls -Wshadow -Wsign-compare -Wstrict-overflow=1 -Wswitch-enum -Wtrampolines -Wundef -funsafe-loop-optimizations -Wclobbered -Wunused -Wunused-result -Wunused-variable -Wunused-parameter -Wunused-local-typedefs -Wwrite-strings -fwrapv -pipe -fPIE -pie -Wsizeof-pointer-memaccess -Wpacked   -o docs/source/libgearman/examples/gearman_execute_partition docs/source/libgearman/examples/gearman_execute_partition.o libgearman/libgearman.la

I can also fix the line with -lstdc++ (while keeping the c compiler):

/bin/bash ./libtool --silent --tag=CC   --mode=link cc  -g -O2  -Wno-unknown-pragmas -Wno-pragmas -Wall -Wextra -Wunsuffixed-float-constants -Wjump-misses-init -Wno-attributes -Waddress -Wvarargs -Warray-bounds -Wbad-function-cast -Wchar-subscripts -Wcomment -Wfloat-equal -Wformat-security -Wformat=2 -Wformat-y2k -Wlogical-op -Wmaybe-uninitialized -Wmissing-field-initializers -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs -Wnormalized=id -Woverride-init -Wpointer-arith -Wpointer-sign -Wredundant-decls -Wshadow -Wsign-compare -Wstrict-overflow=1 -Wswitch-enum -Wtrampolines -Wundef -funsafe-loop-optimizations -Wclobbered -Wunused -Wunused-result -Wunused-variable -Wunused-parameter -Wunused-local-typedefs -Wwrite-strings -fwrapv -pipe -fPIE -pie -Wsizeof-pointer-memaccess -Wpacked   -o docs/source/libgearman/examples/gearman_execute_partition docs/source/libgearman/examples/gearman_execute_partition.o libgearman/libgearman.la -lstdc++

And warning, -lstdc++ has to be the very last thing one the line or it's still fails.

This is because docs/source/libgearman/examples/* are C files that includes libgearman that has some C++ at some point (client.cc for instance).

Long story short, this is the working commands:

./configure --disable-shared
make LIBS=-lstdc++

If you want to consider compiling examples with C++ instead C it would be more than perfect, but I'm not asking you to do as I have a way to achieve what I need. :+1:

Thank you A LOT @esabol for the support :smiley:

I will close this issue right now.

Best regards.

Thibault

esabol commented 4 years ago

Great! I'm happy to help.

Could you reopen the issue? We really should fix how those sample executables are compiled, I think.

thibaultduponchelle commented 4 years ago

OK I reopen, thank you :+1:

manarth commented 2 months ago

Here's the configure command I've been using to generate a static-linked build under Alpine:

./configure \
        --prefix=/usr \
        --sysconfdir=/etc \
        --mandir=/usr/share/man \
        --localstatedir=/var \
        --disable-shared \
        --enable-static \
        --with-pic=yes \
        --with-memcached \
        --without-mysql \
        --without-postgresql \
        --disable-libpq \
        --disable-libtokyocabinet \
        --disable-libdrizzle \
        --disable-hiredis \
        --enable-ssl \
        --enable-jobserver=no \
        LDFLAGS="--static" \
        LIBS="-lstdc++"

The template for pkgconfig doesn't include a line for static-linked libraries so when building against the static libgearman.a library, you would need to manually specify the dependencies:

esabol commented 2 months ago

@manarth : Are you suggesting something that should be changed?