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