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

Assembly files should end in .sx, not .S

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • WT2.9.0, 3.2.11, 3.4.0-rc1
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      The GCC toolchain does consider .S to be a legit suffix for an assembly file that requires preprocessor support (see https://gcc.gnu.org/onlinedocs/gcc/Overall-Options.html). Unfortunately, SCons somewhat disagrees, and only considers .S an assembly file on Windows (see http://scons.org/doc/HTML/scons-man.html#b-StaticObject).

      This leads to difficulties where SCons does not know what to do with the file at link time, and simply sends it straight through to the link step. This works, sometimes, when using the link model where we expand all libraries in to object files at executable link time, because then GCC sees the .S file among the arguments and assembles it.

      However, it does not work when using dynamic linking, or using actual archive files, because the result is that the unassembled .S file is included directly into the archive library, or is not understood as a linkable object (correctly) by the linker.

      Harmonizing the suffixes would allow SCons to see that it needs to invoke the assembler on the file before sending it to other tools.

      In particular, this issue prevents building WiredTiger in --link-model=dynamic mode on s390x and POWER systems, since these use .S files.

      I recommend the following renamings:

      • From src/checksum/power8/crc32.S to src/checksum/power8/crc32.sx
      • From src/checksum/zseries/crc32le-vx.S to src/checksum/zseries/crc32le-vx.sx

            Assignee:
            david.hows David Hows
            Reporter:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: