Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-14184

Unused preprocessor macros from s2 conflict on OS X Yosemite

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: 2.6.1
    • Fix Version/s: 2.6.6, 2.7.7
    • Component/s: Build
    • Labels:
    • Environment:
      Yosemite Developer Preview 1 (14A238x)
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      OS X
    • Backport Completed:
    • Steps To Reproduce:
      Hide

      1. Install OSX Yosemite
      2. Install brew & scons
      3. Build mongodb from source

      I did an upgrade from Mavericks. So I'm sorry if you can't reproduce this bug. It's probably my mistake.

      Show
      1. Install OSX Yosemite 2. Install brew & scons 3. Build mongodb from source I did an upgrade from Mavericks. So I'm sorry if you can't reproduce this bug. It's probably my mistake.
    • Epic Link:
    • Sprint:
      Server 2.7.4, Server 2.7.5, Server 2.7.6

      Description

      The file "src/third_party/s2/util/endian/endian.h" is not compatible with the c compiler on Yosemite.

      This is the build error I got.

      In file included from src/third_party/s2/s2cellid.cc:24:
      In file included from src/third_party/s2/strings/strutil.h:62:
      src/third_party/s2/util/endian/endian.h:182:9: error: 'htonll' macro redefined [-Werror]
      #define htonll(x) ghtonll(x)
              ^
      /usr/include/sys/_endian.h:141:9: note: previous definition is here
      #define htonll(x)       __DARWIN_OSSwapInt64(x)
              ^
      In file included from src/third_party/s2/s2cellid.cc:24:
      In file included from src/third_party/s2/strings/strutil.h:62:
      src/third_party/s2/util/endian/endian.h:189:9: error: 'ntohll' macro redefined [-Werror]
      #define ntohll(x) htonll(x)
              ^
      /usr/include/sys/_endian.h:140:9: note: previous definition is here
      #define ntohll(x)       __DARWIN_OSSwapInt64(x)
              ^
      2 errors generated.
      scons: *** [build/darwin/normal/third_party/s2/s2cellid.o] Error 1
      scons: building terminated because of errors.

      Somehow the last lines (118-189) are the problem. The compilation worked after I’ve removed them. (I couldn’t find a location where those were used anyways)

      Here is the version of the compiler I used:

      $ g++ --version
      Configured with: --prefix=/Applications/Xcode6-Beta.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
      Apple LLVM version 6.0 (clang-600.0.34.4) (based on LLVM 3.5svn)
      Target: x86_64-apple-darwin14.0.0
      Thread model: posix

      How does mongodb handle bugs in third party libraries?
      Certainly there is a better solution to this problem.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: