[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/beardbolt 9b1a5abbdf 208/323: Strip -flto flag from com
From: |
ELPA Syncer |
Subject: |
[elpa] externals/beardbolt 9b1a5abbdf 208/323: Strip -flto flag from compile_commands.json by default |
Date: |
Thu, 9 Mar 2023 10:58:31 -0500 (EST) |
branch: externals/beardbolt
commit 9b1a5abbdf461e6d4bfee50f71e3c85d00da1c0c
Author: Jay Kamat <jaygkamat@gmail.com>
Commit: Jay Kamat <jaygkamat@gmail.com>
Strip -flto flag from compile_commands.json by default
It seems like (useful) assembly information is not generated in lto
mode, so we'll try compiling without -flto if it is there in
compile_commands.json. This shouldn't affect passing in -flto
manually.
---
rmsbolt-split.el | 11 +++++++----
rmsbolt.el | 2 ++
test/rmsbolt-split-test.el | 4 ++++
3 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/rmsbolt-split.el b/rmsbolt-split.el
index 1fdfc50aab..b469ab888a 100644
--- a/rmsbolt-split.el
+++ b/rmsbolt-split.el
@@ -41,12 +41,15 @@
;;; Code:
-(defun rmsbolt-split-rm-single (cmd flag)
- "Remove a single FLAG from CMD."
- (let ((cmd (split-string cmd rmsbolt-split--regexp)))
+(defun rmsbolt-split-rm-single (cmd flag &optional comparator)
+ "Remove a single FLAG from CMD.
+
+Optionally compares using COMPARATOR."
+ (let ((cmd (split-string cmd rmsbolt-split--regexp))
+ (comparator (or comparator #'string=)))
(mapconcat
#'identity
- (cl-remove-if (apply-partially #'string= flag) cmd)
+ (cl-remove-if (apply-partially comparator flag) cmd)
" ")))
(defun rmsbolt-split-rm-double (cmd flag)
diff --git a/rmsbolt.el b/rmsbolt.el
index 6e174e5db3..cc4115f85d 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -805,9 +805,11 @@ return t if successful."
(setq-local rmsbolt-command
;; Remove -c, -S, and -o <arg> if present,
;; as we will add them back
+ ;; Remove args starting with -flto, as -flto breaks asm
output.
(thread-first (cl-second to-ret)
(rmsbolt-split-rm-single "-c")
(rmsbolt-split-rm-single "-S")
+ (rmsbolt-split-rm-single "-flto" #'string-prefix-p)
(rmsbolt-split-rm-double "-o")))
t)))
;;;; Language Definitions
diff --git a/test/rmsbolt-split-test.el b/test/rmsbolt-split-test.el
index c8e15afcb2..6165beb7fa 100644
--- a/test/rmsbolt-split-test.el
+++ b/test/rmsbolt-split-test.el
@@ -33,6 +33,10 @@
(rmsbolt-split-rm-single "/usr/bin/c++ -a -R -a" "-a")
"/usr/bin/c++ -R"))
+ (should (equal
+ (rmsbolt-split-rm-single "/usr/bin/c++ -a -R -c -flto=thin" "-flto"
#'string-prefix-p)
+ "/usr/bin/c++ -a -R -c"))
+
(should (equal
(rmsbolt-split-rm-single
"/usr/bin/c++ -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB
-DQT_NO_KEYWORDS -DQT_WIDGETS_LIB -Isrc/googletest/include -I../common -Icommon
-Icommon/protobuf -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem
/usr/include/x86_64-linux-gnu/qt5/QtCore -isystem
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -isystem
/usr/include/x86_64-linux-gnu/qt5/QtNetwork -isystem
/usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem
/usr/include/x86_64-linux-gnu/qt5/QtGui -Werror=retu [...]
- [elpa] externals/beardbolt 4a050afaaa 315/323: Attempt to fix more window management bugs, (continued)
- [elpa] externals/beardbolt 4a050afaaa 315/323: Attempt to fix more window management bugs, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 0d61c2edac 311/323: Add support for rustc, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt be3cf0a712 318/323: Fix problems with beardbolt-compile when file is saved, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 349ace7310 164/323: Merge branch 'master' of gitlab.com:jgkamat/rmsbolt, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 5aeda6f846 155/323: Add basic documentation for compile_commands.json, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 246377bbff 173/323: Add dummy panic handler to reduce size of zig diassembly, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 73dcaca98d 177/323: Remove unneeded variables, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 28ccabf318 190/323: Clean up overlays and simplify hook when asm buffer is closed, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 3a8964d537 204/323: Update Readme, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 7c81d55d3e 202/323: Format go block, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 9b1a5abbdf 208/323: Strip -flto flag from compile_commands.json by default,
ELPA Syncer <=
- [elpa] externals/beardbolt d257e51fce 244/323: starters/zig: Automatically export functions, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt ebbdebc66f 239/323: Improve compilation buffer display UX, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt f6b72fe0eb 248/323: First stab at rainbow overlays, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 3cace942b8 251/323: Fix buffer selection problems, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 041234b499 241/323: Improve auto-compilation, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 2421b29094 255/323: Remove .ert-runner, .gitlab-ci.yml and Cask, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 49e2500be1 259/323: Use shorthands so I can just type bb- instead of beardbolt-, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 58b07a215c 268/323: Simplify some code, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 9f6d1cf10c 269/323: Remove some rmsbolt remnants, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 5deed3972e 276/323: * beardbolt.el (bb--reachable-p, bb--process-asm): Use obarrays., ELPA Syncer, 2023/03/09