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

The library exports "TRACE" as an un-prefixed global symbol (define)

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.5.0
    • Affects Version/s: 1.4.0
    • Component/s: Build
    • None

      The driver defines "TRACE", without prefixing it with a library specific prefix. This causes issues with HHVM (at least, 3.13.1), as it does the same.

      I am now getting the following compile errors:

      derick@whisky:~/dev/php/derickr-mongo-hhvm-driver $ make
      [  0%] Building CXX object CMakeFiles/mongodb.dir/mongodb.cpp.o
      In file included from /home/derick/dev/php/derickr-mongo-hhvm-driver/src/MongoDB/Driver/../../../libmongoc/src/mongoc/mongoc.h:54:0,
                       from /home/derick/dev/php/derickr-mongo-hhvm-driver/src/MongoDB/Driver/BulkWrite.h:21,
                       from /home/derick/dev/php/derickr-mongo-hhvm-driver/mongodb.cpp:21:
      /home/derick/dev/php/derickr-mongo-hhvm-driver/src/MongoDB/Driver/../../../libmongoc/src/mongoc/mongoc-trace.h:42:0: warning: "TRACE" redefined
       #define TRACE(msg,...)
       ^
      In file included from /usr/local/hhvm/3.13.1/include/hphp/runtime/base/memory-manager.h:31:0,
                       from /usr/local/hhvm/3.13.1/include/hphp/runtime/base/array-data.h:25,
                       from /usr/local/hhvm/3.13.1/include/hphp/runtime/base/type-array.h:20,
                       from /usr/local/hhvm/3.13.1/include/hphp/runtime/base/exceptions.h:28,
                       from /usr/local/hhvm/3.13.1/include/hphp/runtime/base/string-data.h:30,
                       from /usr/local/hhvm/3.13.1/include/hphp/runtime/base/type-string.h:22,
                       from /usr/local/hhvm/3.13.1/include/hphp/runtime/base/debuggable.h:19,
                       from /usr/local/hhvm/3.13.1/include/hphp/runtime/ext/extension.h:21,
                       from /home/derick/dev/php/derickr-mongo-hhvm-driver/mongodb.cpp:17:
      /usr/local/hhvm/3.13.1/include/hphp/util/trace.h:386:0: note: this is the location of the previous definition
       #define TRACE(...)        do { } while (0)
       ^
      In file included from /home/derick/dev/php/derickr-mongo-hhvm-driver/mongodb.cpp:34:0:
      /home/derick/dev/php/derickr-mongo-hhvm-driver/src/MongoDB/BSON/Decimal128.h:34:3: error: ‘bson_decimal128_t’ does not name a type
         bson_decimal128_t m_decimal;
         ^
      CMakeFiles/mongodb.dir/build.make:62: recipe for target 'CMakeFiles/mongodb.dir/mongodb.cpp.o' failed
      make[2]: *** [CMakeFiles/mongodb.dir/mongodb.cpp.o] Error 1
      CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/mongodb.dir/all' failed
      make[1]: *** [CMakeFiles/mongodb.dir/all] Error 2
      Makefile:127: recipe for target 'all' failed
      make: *** [all] Error 2
      

      The driver should prefix this with something, as to prevent symbol clashes.

      I also filed an issue for HHVM: https://github.com/facebook/hhvm/issues/7288

            Assignee:
            bjori Hannes Magnusson
            Reporter:
            derick Derick Rethans
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: