Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-1175

Static compilation fails

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.4.0
    • Affects Version/s: 1.3.4
    • Component/s: Build
    • None
    • Environment:
      OSX 10.11.4, clang

      When attempting a static library build, the build fails in the fam step. The same build process works properly if shared libraries are built instead.

      ./configure --enable-shared=no --enable-static=yes

      Grendel% make V=2
      Making all in src/libbson
      make[1]: Entering directory '/Users/alb/Development/Fusion/Depend/mongo-c-driver-1.3.4/src/libbson'
      make[1]: Nothing to be done for 'all'.
      make[1]: Leaving directory '/Users/alb/Development/Fusion/Depend/mongo-c-driver-1.3.4/src/libbson'
      make[1]: Entering directory '/Users/alb/Development/Fusion/Depend/mongo-c-driver-1.3.4'
      /bin/sh ./libtool --tag=CC --mode=link clang -I./src/mongoc -I./src/mongoc -I./src/libbson/src/bson -Isrc/libbson/src/bson -Wno-deprecated-declarations -Wno-cast-align -Wno-unneeded-internal-declaration -O2 -o fam examples/find_and_modify_with_opts/fam-fam.o libmongoc-1.0.la
      libtool: link: clang -I./src/mongoc -I./src/mongoc -I./src/libbson/src/bson -Isrc/libbson/src/bson -Wno-deprecated-declarations -Wno-cast-align -Wno-unneeded-internal-declaration -O2 -o fam examples/find_and_modify_with_opts/fam-fam.o ./.libs/libmongoc-1.0.a /Users/alb/Development/Fusion/Depend/mongo-c-driver-1.3.4/src/libbson/.libs/libbson-1.0.a -lm -lsasl2 -pthread
      clang: warning: argument unused during compilation: '-pthread'
      Undefined symbols for architecture x86_64:
      "___mongoc_counter_auth_failure", referenced from:
      __mongoc_cluster_auth_node in libmongoc-1.0.a(libmongoc_1_0_la-mongoc-cluster.o)
      "___mongoc_counter_auth_success", referenced from:
      __mongoc_cluster_auth_node in libmongoc-1.0.a(libmongoc_1_0_la-mongoc-cluster.o)
      "___mongoc_counter_clients_active", referenced from:
      __mongoc_client_new_from_uri in libmongoc-1.0.a(libmongoc_1_0_la-mongoc-client.o)
      _mongoc_client_destroy in libmongoc-1.0.a(libmongoc_1_0_la-mongoc-client.o)
      "___mongoc_counter_clients_disposed", referenced from:
      _mongoc_client_destroy in libmongoc-1.0.a(libmongoc_1_0_la-mongoc-client.o)
      "___mongoc_counter_cursors_active", referenced from:
      __mongoc_cursor_new in libmongoc-1.0.a(libmongoc_1_0_la-mongoc-cursor.o)
      __mongoc_cursor_destroy in libmongoc-1.0.a(libmongoc_1_0_la-mongoc-cursor.o)
      __mongoc_cursor_clone in libmongoc-1.0.a(libmongoc_1_0_la-mongoc-cursor.o)
      "___mongoc_counter_cursors_disposed", referenced from:
      __mongoc_cursor_destroy in libmongoc-1.0.a(libmongoc_1_0_la-mongoc-cursor.o)
      "___mongoc_counter_dns_failure", referenced from:
      _mongoc_client_default_stream_initiator in libmongoc-1.0.a(libmongoc_1_0_la-mongoc-client.o)
      _mongoc_topology_scanner_node_setup in libmongoc-1.0.a(libmongoc_1_0_la-mongoc-topology-scanner.o)
      "___mongoc_counter_dns_success", referenced from:
      _mongoc_client_default_stream_initiator in libmongoc-1.0.a(libmongoc_1_0_la-mongoc-client.o)
      _mongoc_topology_scanner_node_setup in libmongoc-1.0.a(libmongoc_1_0_la-mongoc-topology-scanner.o)
      "___mongoc_counter_op_egress_delete", referenced from:
      _mongoc_cluster_sendv_to_server in libmongoc-1.0.a(libmongoc_1_0_la-mongoc-cluster.o)
      "___mongoc_counter_op_egress_getmore", referenced from:
      _mongoc_cluster_sendv_to_server in libmongoc-1.0.a(libmongoc_1_0_la-mongoc-cluster.o)
      "___mongoc_counter_op_egress_insert", referenced from:
      _mongoc_cluster_sendv_to_server in libmongoc-1.0.a(libmongoc_1_0_la-mongoc-cluster.o)
      "___mongoc_counter_op_egress_killcursors", referenced from:
      _mongoc_cluster_sendv_to_server in libmongoc-1.0.a(libmongoc_1_0_la-mongoc-cluster.o)
      "___mongoc_counter_op_egress_msg", referenced from:
      _mongoc_cluster_sendv_to_server in libmongoc-1.0.a(libmongoc_1_0_la-mongoc-cluster.o)
      "___mongoc_counter_op_egress_query", referenced from:
      _mongoc_cluster_sendv_to_server in libmongoc-1.0.a(libmongoc_1_0_la-mongoc-cluster.o)
      "___mongoc_counter_op_egress_reply", referenced from:
      _mongoc_cluster_sendv_to_server in libmongoc-1.0.a(libmongoc_1_0_la-mongoc-cluster.o)
      "___mongoc_counter_op_egress_total", referenced from:
      _mongoc_cluster_sendv_to_server in libmongoc-1.0.a(libmongoc_1_0_la-mongoc-cluster.o)
      "___mongoc_counter_op_egress_update", referenced from:
      _mongoc_cluster_sendv_to_server in libmongoc-1.0.a(libmongoc_1_0_la-mongoc-cluster.o)
      "___mongoc_counter_op_ingress_delete", referenced from:
      _mongoc_cluster_try_recv in libmongoc-1.0.a(libmongoc_1_0_la-mongoc-cluster.o)
      "___mongoc_counter_op_ingress_getmore", referenced from:
      _mongoc_cluster_try_recv in libmongoc-1.0.a(libmongoc_1_0_la-mongoc-cluster.o)
      "___mongoc_counter_op_ingress_insert", referenced from:
      _mongoc_cluster_try_recv in libmongoc-1.0.a(libmongoc_1_0_la-mongoc-cluster.o)
      "___mongoc_counter_op_ingress_killcursors", referenced from:
      _mongoc_cluster_try_recv in libmongoc-1.0.a(libmongoc_1_0_la-mongoc-cluster.o)
      "___mongoc_counter_op_ingress_msg", referenced from:
      _mongoc_cluster_try_recv in libmongoc-1.0.a(libmongoc_1_0_la-mongoc-cluster.o)
      "___mongoc_counter_op_ingress_query", referenced from:
      _mongoc_cluster_try_recv in libmongoc-1.0.a(libmongoc_1_0_la-mongoc-cluster.o)
      "___mongoc_counter_op_ingress_reply", referenced from:
      _mongoc_cluster_try_recv in libmongoc-1.0.a(libmongoc_1_0_la-mongoc-cluster.o)
      "___mongoc_counter_op_ingress_total", referenced from:
      _mongoc_cluster_try_recv in libmongoc-1.0.a(libmongoc_1_0_la-mongoc-cluster.o)
      "___mongoc_counter_op_ingress_update", referenced from:
      _mongoc_cluster_try_recv in libmongoc-1.0.a(libmongoc_1_0_la-mongoc-cluster.o)
      "___mongoc_counter_protocol_ingress_error", referenced from:
      _mongoc_cluster_try_recv in libmongoc-1.0.a(libmongoc_1_0_la-mongoc-cluster.o)
      "___mongoc_counter_streams_active", referenced from:
      _mongoc_stream_buffered_new in libmongoc-1.0.a(libmongoc_1_0_la-mongoc-stream-buffered.o)
      _mongoc_stream_buffered_destroy in libmongoc-1.0.a(libmongoc_1_0_la-mongoc-stream-buffered.o)
      "___mongoc_counter_streams_disposed", referenced from:
      _mongoc_stream_buffered_destroy in libmongoc-1.0.a(libmongoc_1_0_la-mongoc-stream-buffered.o)
      "___mongoc_counter_streams_egress", referenced from:
      _mongoc_socket_sendv in libmongoc-1.0.a(libmongoc_1_0_la-mongoc-socket.o)
      "___mongoc_counter_streams_ingress", referenced from:
      _mongoc_socket_recv in libmongoc-1.0.a(libmongoc_1_0_la-mongoc-socket.o)
      ld: symbol(s) not found for architecture x86_64
      clang: error: linker command failed with exit code 1 (use -v to see invocation)
      Makefile:2320: recipe for target 'fam' failed
      make[1]: *** [fam] Error 1

            Assignee:
            bjori Hannes Magnusson
            Reporter:
            alb@neptunesystems.com Allan Bazinet
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: