Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-2914

Fix link error on OS/X for checksum_init call

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.3.12
    • Fix Version/s: WT2.9.0, 3.2.10, 3.3.14
    • Labels:
      None
    • Environment:
      OS/X 10.11
    • # Replies:
      7
    • Last comment by Customer:
      true

      Description

      When checksum_init is used in a program that does not also have a call to wiredtiger_open, there is an unresolved symbol:

      libtool: link: cc -Wall -Wextra -Waddress -Waggregate-return -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat -Winline -Wmissing-declarations -Wmissing-field-initializers -Wnested-externs -Wpointer-arith -Wredundant-decls -Wshadow -Wunused -Wwrite-strings -Werror -g -Wall -o test_wt2695_checksum wt2695_checksum/main.o  -L/Users/dda/wt/snappy/installed/snappy-1.1.1/lib -L/Users/dda/wt/ext/lz4/installed/lib /Users/dda/wt/git/process-init/test/utility/.libs/libtest_util.a ../../.libs/libwiredtiger.a -ldl -lpthread -lz -llz4 /Users/dda/wt/snappy/installed/snappy-1.1.1/lib/libsnappy.dylib
      Undefined symbols for architecture x86_64:
        "___wt_process", referenced from:
            _main in main.o
            ___wt_checksum_init in libwiredtiger.a(crc32-x86.o)
      ld: symbol(s) not found for architecture x86_64
      

        Issue Links

          Activity

          Hide
          keith.bostic Keith Bostic added a comment -

          Donald Anderson, I'm confused what's going on here, can you explain further what you're doing that shows the error?

          Show
          keith.bostic Keith Bostic added a comment - Donald Anderson , I'm confused what's going on here, can you explain further what you're doing that shows the error?
          Hide
          donald.anderson Donald Anderson added a comment -

          Hi Keith, I get a build error on a clean develop branch on OSX (at least with my toolchain). test/csuite/wt2695_checksum/main.c is the program involved, it indirectly references a data symbol __wt_process. Some linkers don't include .o's from an archive if it only satisfies a data reference. To be more specific:

          1) main.o references __wt_checksum_init.
          2) linker includes crc32-x86.o (or one of the crc32-*.o modules).
          3) that module references data symbol __wt_process.
          4) some linkers will include global.o, some don't.

          The fix is easy, I just pushed a pull request.

          Show
          donald.anderson Donald Anderson added a comment - Hi Keith, I get a build error on a clean develop branch on OSX (at least with my toolchain). test/csuite/wt2695_checksum/main.c is the program involved, it indirectly references a data symbol __wt_process. Some linkers don't include .o's from an archive if it only satisfies a data reference. To be more specific: 1) main.o references __wt_checksum_init. 2) linker includes crc32-x86.o (or one of the crc32-*.o modules). 3) that module references data symbol __wt_process. 4) some linkers will include global.o, some don't. The fix is easy, I just pushed a pull request.
          Hide
          xgen-internal-githook Githook User added a comment -

          Author:

          {u'username': u'ddanderson', u'name': u'Don Anderson', u'email': u'dda@mongodb.com'}

          Message: WT-2914 In test/csuite program, added explicit call to wiredtiger_open to satisfy some linkers (#3040)
          Branch: develop
          https://github.com/wiredtiger/wiredtiger/commit/10dd36a9bf507e13d2d17ff72d9d55a88aae2f12

          Show
          xgen-internal-githook Githook User added a comment - Author: {u'username': u'ddanderson', u'name': u'Don Anderson', u'email': u'dda@mongodb.com'} Message: WT-2914 In test/csuite program, added explicit call to wiredtiger_open to satisfy some linkers (#3040) Branch: develop https://github.com/wiredtiger/wiredtiger/commit/10dd36a9bf507e13d2d17ff72d9d55a88aae2f12
          Hide
          xgen-internal-githook Githook User added a comment -

          Author:

          {u'username': u'ddanderson', u'name': u'Don Anderson', u'email': u'dda@mongodb.com'}

          Message: WT-2914 In test/csuite program, added explicit call to wiredtiger_open to satisfy some linkers (#3040)
          Branch: mongodb-3.4
          https://github.com/wiredtiger/wiredtiger/commit/10dd36a9bf507e13d2d17ff72d9d55a88aae2f12

          Show
          xgen-internal-githook Githook User added a comment - Author: {u'username': u'ddanderson', u'name': u'Don Anderson', u'email': u'dda@mongodb.com'} Message: WT-2914 In test/csuite program, added explicit call to wiredtiger_open to satisfy some linkers (#3040) Branch: mongodb-3.4 https://github.com/wiredtiger/wiredtiger/commit/10dd36a9bf507e13d2d17ff72d9d55a88aae2f12
          Hide
          xgen-internal-githook Githook User added a comment -

          Author:

          {u'username': u'agorrod', u'name': u'Alex Gorrod', u'email': u'alexander.gorrod@mongodb.com'}

          Message: Import wiredtiger: 5bc03723a7e77c96b1d5e45a97173654872c727a from branch mongodb-3.4

          ref: deeb0f589a..5bc03723a7
          for: 3.3.13

          WT-2859 Improve statistics macros to not collect stats when statistics=none is set
          WT-2894 Create workload that shows negative scaling when overwhelmed
          WT-2900 Add ARM8 build support to WiredTiger and fix ARM CRC assembler tags
          WT-2902 Enhance eviction to work better with update heavy YCSB load
          WT-2905 dead code: MongoDB Coverity #99881
          WT-2908 Add dry-run support to python unit-test
          WT-2910 test_inmem01 can abort due to stuck cache
          WT-2911 add support for gcc6
          WT-2912 make --enable-strict run on the zseries test box
          WT-2913 stuck cache after latest merge
          WT-2914 Fix link error on OS/X for checksum_init call
          WT-2916 whitespace check not working
          Branch: master
          https://github.com/mongodb/mongo/commit/7693fa59c4470db729d85af99fb9cc3b264fa8c8

          Show
          xgen-internal-githook Githook User added a comment - Author: {u'username': u'agorrod', u'name': u'Alex Gorrod', u'email': u'alexander.gorrod@mongodb.com'} Message: Import wiredtiger: 5bc03723a7e77c96b1d5e45a97173654872c727a from branch mongodb-3.4 ref: deeb0f589a..5bc03723a7 for: 3.3.13 WT-2859 Improve statistics macros to not collect stats when statistics=none is set WT-2894 Create workload that shows negative scaling when overwhelmed WT-2900 Add ARM8 build support to WiredTiger and fix ARM CRC assembler tags WT-2902 Enhance eviction to work better with update heavy YCSB load WT-2905 dead code: MongoDB Coverity #99881 WT-2908 Add dry-run support to python unit-test WT-2910 test_inmem01 can abort due to stuck cache WT-2911 add support for gcc6 WT-2912 make --enable-strict run on the zseries test box WT-2913 stuck cache after latest merge WT-2914 Fix link error on OS/X for checksum_init call WT-2916 whitespace check not working Branch: master https://github.com/mongodb/mongo/commit/7693fa59c4470db729d85af99fb9cc3b264fa8c8
          Hide
          xgen-internal-githook Githook User added a comment -

          Author:

          {u'username': u'ddanderson', u'name': u'Don Anderson', u'email': u'dda@mongodb.com'}

          Message: WT-2914 In test/csuite program, added explicit call to wiredtiger_open to satisfy some linkers (#3040)
          Branch: mongodb-3.2
          https://github.com/wiredtiger/wiredtiger/commit/10dd36a9bf507e13d2d17ff72d9d55a88aae2f12

          Show
          xgen-internal-githook Githook User added a comment - Author: {u'username': u'ddanderson', u'name': u'Don Anderson', u'email': u'dda@mongodb.com'} Message: WT-2914 In test/csuite program, added explicit call to wiredtiger_open to satisfy some linkers (#3040) Branch: mongodb-3.2 https://github.com/wiredtiger/wiredtiger/commit/10dd36a9bf507e13d2d17ff72d9d55a88aae2f12
          Hide
          xgen-internal-githook Githook User added a comment -

          Author:

          {u'username': u'michaelcahill', u'name': u'Michael Cahill', u'email': u'michael.cahill@mongodb.com'}

          Message: Import wiredtiger: bb18c439152379fb528af217345be40819b01fc4 from branch mongodb-3.2

          ref: 911c940ada..bb18c43915
          for: 3.2.10

          WT-2859 Improve statistics macros to not collect stats when statistics=none is set
          WT-2894 Create workload that shows negative scaling when overwhelmed
          WT-2900 Add ARM8 build support to WiredTiger and fix ARM CRC assembler tags
          WT-2902 Enhance eviction to work better with update heavy YCSB load
          WT-2905 dead code: MongoDB Coverity #99881
          WT-2908 Add dry-run support to python unit-test
          WT-2910 test_inmem01 can abort due to stuck cache
          WT-2911 add support for gcc6
          WT-2912 make --enable-strict run on the zseries test box
          WT-2913 stuck cache after latest merge
          WT-2914 Fix link error on OS/X for checksum_init call
          WT-2916 whitespace check not working
          Branch: v3.2
          https://github.com/mongodb/mongo/commit/dfca65ea3a32b1e0c832ff7ee2d7b667819ec64d

          Show
          xgen-internal-githook Githook User added a comment - Author: {u'username': u'michaelcahill', u'name': u'Michael Cahill', u'email': u'michael.cahill@mongodb.com'} Message: Import wiredtiger: bb18c439152379fb528af217345be40819b01fc4 from branch mongodb-3.2 ref: 911c940ada..bb18c43915 for: 3.2.10 WT-2859 Improve statistics macros to not collect stats when statistics=none is set WT-2894 Create workload that shows negative scaling when overwhelmed WT-2900 Add ARM8 build support to WiredTiger and fix ARM CRC assembler tags WT-2902 Enhance eviction to work better with update heavy YCSB load WT-2905 dead code: MongoDB Coverity #99881 WT-2908 Add dry-run support to python unit-test WT-2910 test_inmem01 can abort due to stuck cache WT-2911 add support for gcc6 WT-2912 make --enable-strict run on the zseries test box WT-2913 stuck cache after latest merge WT-2914 Fix link error on OS/X for checksum_init call WT-2916 whitespace check not working Branch: v3.2 https://github.com/mongodb/mongo/commit/dfca65ea3a32b1e0c832ff7ee2d7b667819ec64d

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Days since reply:
                26 weeks, 2 days ago
                Date of 1st Reply: