summaryrefslogtreecommitdiffstats
path: root/src/nasm-wrapper
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:54:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:54:28 +0000
commite6918187568dbd01842d8d1d2c808ce16a894239 (patch)
tree64f88b554b444a49f656b6c656111a145cbbaa28 /src/nasm-wrapper
parentInitial commit. (diff)
downloadceph-e6918187568dbd01842d8d1d2c808ce16a894239.tar.xz
ceph-e6918187568dbd01842d8d1d2c808ce16a894239.zip
Adding upstream version 18.2.2.upstream/18.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/nasm-wrapper')
-rwxr-xr-xsrc/nasm-wrapper54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/nasm-wrapper b/src/nasm-wrapper
new file mode 100755
index 000000000..84da2cb23
--- /dev/null
+++ b/src/nasm-wrapper
@@ -0,0 +1,54 @@
+#!/usr/bin/env bash
+
+set -e
+
+refine_nasm_options=""
+while [ -n "$*" ]; do
+ case "$1" in
+ -f )
+ shift
+ refine_nasm_options+=" -f $1"
+ shift
+ ;;
+ -c | --param* | -m* | -pipe | -thread )
+ # unknown options under nasm & yasm
+ shift
+ ;;
+ -g* )
+ # ignore debug format
+ shift
+ ;;
+ -MD )
+ # before CMake v3.18, its ninja build rule always passes `-MD $DEP_FILE``
+ # to ASM_COMPILER. both nasm and GNU assembler accepts this option, but
+ # somehow the ninja generator fails to pass the <DEPFILE> argument. so
+ # just drop it.
+ shift
+ ;;
+ -W* )
+ # Warning/error option
+ shift
+ ;;
+ -f* )
+ shift
+ ;;
+ -I | -isystem )
+ shift
+ refine_nasm_options+=" -i $1"
+ shift
+ ;;
+ -O* )
+ # ignore C optimisations
+ shift
+ ;;
+ * )
+ # Keep other options
+ refine_nasm_options+=" $1"
+ shift
+ ;;
+ esac
+done
+
+nasm $refine_nasm_options
+
+true