Last active
May 30, 2017 15:36
-
-
Save naota/98134e02fc15a2c5be250f9d1efcf1d1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
#~/src/kninja/kninja.py | |
ninja -t compdb $(awk '/^rule /{print $2}' build.ninja) > compile_commands.json | |
#compdb -c compdb.complementers=headerdb -p . update | |
#compdb -c compdb.complementers=headerdb -p . list > compile_commands.json.new | |
#cp compile_commands.json.new compile_commands.json | |
DELETE_ARGS=( | |
'-falign-jumps=1' | |
'-falign-loops=1' | |
'-fconserve-stack' | |
'-fno-delete-null-pointer-checks' | |
'-fno-var-tracking-assignments' | |
'-mfentry' | |
'-mno-fp-ret-in-387' | |
'-mpreferred-stack-boundary=3' | |
'-mskip-rax-setup' | |
'--param=allow-store-data-races=0' | |
'-DCC_HAVE_ASM_GOTO' | |
'-Wno-frame-address' | |
'-Wno-unused-but-set-variable' | |
'-Werror=designated-init' | |
) | |
script="" | |
for x in ${DELETE_ARGS[@]};do | |
script="s/$x//;${script}" | |
done | |
sed -i -e "${script}" compile_commands.json | |
#eval $(grep -- '-o fs/btrfs/ctree.o' compile_commands.json | cut -d: -f2| | |
# sed 's/",$//;s/^ "gcc/clang -fsyntax-only/;s/-c -o fs\/btrfs\/ctree.o//;s/\\\\"/"/g') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment