mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-06 11:18:30 +00:00
Make improvements
- Introduce portable sched_getcpu() api - Support GCC's __target_clones__ feature - Make fma() go faster on x86 in default mode - Remove some asan checks from core libraries - WinMain() now ensures $HOME and $USER are defined
This commit is contained in:
parent
d5225a693b
commit
2ab9e9f7fd
192 changed files with 2809 additions and 932 deletions
|
@ -125,7 +125,7 @@ Keywords={
|
|||
"mayalias",
|
||||
"dontinstrument",
|
||||
"interruptfn",
|
||||
"nocallback",
|
||||
"dontcallback",
|
||||
"textstartup",
|
||||
"warnifused",
|
||||
"attributeallocsize",
|
||||
|
|
|
@ -67,7 +67,8 @@
|
|||
"progbits"
|
||||
"nobits"
|
||||
"init_array"
|
||||
"fini_array")])
|
||||
"fini_array"
|
||||
"gnu_indirect_function")])
|
||||
"\\>"])
|
||||
"GNU Assembler section, relocation, macro param qualifiers.")
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@
|
|||
"mayalias"
|
||||
"dontinstrument"
|
||||
"interruptfn"
|
||||
"nocallback"
|
||||
"dontcallback"
|
||||
"textstartup"
|
||||
"warnifused"
|
||||
"attributeallocsize"
|
||||
|
@ -206,6 +206,9 @@
|
|||
"__section__"
|
||||
"__sentinel__"
|
||||
"__simd__"
|
||||
"__vex"
|
||||
"__avx2"
|
||||
"__target_clones"
|
||||
"__target_clones__"
|
||||
"__unused__"
|
||||
"__used__"
|
||||
|
|
|
@ -71,7 +71,8 @@
|
|||
"__SUPPORT_SNAN__"
|
||||
"__GCC_IEC_559_COMPLEX"
|
||||
"__NO_MATH_ERRNO__"
|
||||
"__gnu__"))
|
||||
"__gnu__"
|
||||
"_OPENMP"))
|
||||
|
||||
(cosmo
|
||||
'("__LINKER__"))
|
||||
|
|
|
@ -215,7 +215,7 @@
|
|||
(runs (format "o/$m/%s.com%s V=5 TESTARGS=-b" name runsuffix))
|
||||
(buns (format "o/$m/test/%s_test.com%s V=5 TESTARGS=-b" name runsuffix)))
|
||||
(cond ((not (member ext '("c" "cc" "cpp" "s" "S" "rl" "f")))
|
||||
(format "m=%s; make -j12 MODE=$m o/$m/%s"
|
||||
(format "m=%s; make -j32 MODE=$m o/$m/%s"
|
||||
mode
|
||||
(directory-file-name
|
||||
(or (file-name-directory
|
||||
|
@ -226,7 +226,7 @@
|
|||
(cosmo-join
|
||||
" && "
|
||||
`("m=%s; f=o/$m/%s.com"
|
||||
,(concat "make -j12 $f MODE=$m")
|
||||
,(concat "make -j32 $f MODE=$m")
|
||||
"scp $f $f.dbg win10:; ssh win10 ./%s.com"))
|
||||
mode name (file-name-nondirectory name)))
|
||||
((eq kind 'run-xnu)
|
||||
|
@ -234,19 +234,19 @@
|
|||
(cosmo-join
|
||||
" && "
|
||||
`("m=%s; f=o/$m/%s.com"
|
||||
,(concat "make -j12 $f MODE=$m")
|
||||
,(concat "make -j32 $f MODE=$m")
|
||||
"scp $f $f.dbg xnu:"
|
||||
"ssh xnu ./%s.com"))
|
||||
mode name (file-name-nondirectory name)))
|
||||
((and (equal suffix "")
|
||||
(cosmo-contains "_test." (buffer-file-name)))
|
||||
(format "m=%s; make -j12 MODE=$m %s"
|
||||
(format "m=%s; make -j32 MODE=$m %s"
|
||||
mode runs))
|
||||
((and (equal suffix "")
|
||||
(file-exists-p (format "%s" buddy)))
|
||||
(format (cosmo-join
|
||||
" && "
|
||||
'("m=%s; n=%s; make -j12 o/$m/$n%s.o MODE=$m"
|
||||
'("m=%s; n=%s; make -j32 o/$m/$n%s.o MODE=$m"
|
||||
;; "bloat o/$m/%s.o | head"
|
||||
;; "nm -C --size o/$m/%s.o | sort -r"
|
||||
"echo"
|
||||
|
@ -258,11 +258,11 @@
|
|||
(cosmo-join
|
||||
" && "
|
||||
`("m=%s; f=o/$m/%s.com"
|
||||
,(concat "make -j12 $f MODE=$m")
|
||||
,(concat "make -j32 $f MODE=$m")
|
||||
"build/run ./$f"))
|
||||
mode name))
|
||||
((eq kind 'test)
|
||||
(format `"m=%s; f=o/$m/%s.com.ok && make -j12 $f MODE=$m" mode name))
|
||||
(format `"m=%s; f=o/$m/%s.com.ok && make -j32 $f MODE=$m" mode name))
|
||||
((and (file-regular-p this)
|
||||
(file-executable-p this))
|
||||
(format "build/run ./%s" file))
|
||||
|
@ -271,7 +271,7 @@
|
|||
(cosmo-join
|
||||
" && "
|
||||
`("m=%s; f=o/$m/%s%s.o"
|
||||
,(concat "make -j12 $f MODE=$m")
|
||||
,(concat "make -j32 $f MODE=$m")
|
||||
;; "nm -C --size $f | sort -r"
|
||||
"echo"
|
||||
"size -A $f | grep '^[.T]' | grep -v 'debug\\|command.line\\|stack' | sort -rnk2"
|
||||
|
@ -481,7 +481,7 @@
|
|||
(error "don't know how to show assembly for non c/c++ source file"))
|
||||
(let* ((default-directory root)
|
||||
(compile-command
|
||||
(format "make %s -j12 MODE=%s %s %s"
|
||||
(format "make %s -j32 MODE=%s %s %s"
|
||||
(or extra-make-flags "") mode asm-gcc asm-clang)))
|
||||
(save-buffer)
|
||||
(set-visited-file-modtime (current-time))
|
||||
|
@ -641,11 +641,11 @@
|
|||
(compile (format "sh -c %s" file)))
|
||||
((eq major-mode 'lua-mode)
|
||||
(let* ((mode (cosmo--make-mode arg)))
|
||||
(compile (format "make -j16 MODE=%s o/%s/tool/net/redbean.com && build/run o/%s/tool/net/redbean.com -i %s" mode mode mode file))))
|
||||
(compile (format "make -j32 MODE=%s o/%s/tool/net/redbean.com && build/run o/%s/tool/net/redbean.com -i %s" mode mode mode file))))
|
||||
((and (eq major-mode 'python-mode)
|
||||
(cosmo-startswith "third_party/python/Lib/test/" file))
|
||||
(let ((mode (cosmo--make-mode arg)))
|
||||
(compile (format "make -j12 MODE=%s PYHARNESSARGS=-vv PYTESTARGS=-v o/%s/%s.py.runs"
|
||||
(compile (format "make -j32 MODE=%s PYHARNESSARGS=-vv PYTESTARGS=-v o/%s/%s.py.runs"
|
||||
mode mode (file-name-sans-extension file)))))
|
||||
((eq major-mode 'python-mode)
|
||||
(compile (format "python.com %s" file)))
|
||||
|
@ -692,8 +692,10 @@
|
|||
(define-key lua-mode-map (kbd "C-c C-r") 'cosmo-run)
|
||||
(define-key python-mode-map (kbd "C-c C-r") 'cosmo-run)
|
||||
(define-key c-mode-map (kbd "C-c C-s") 'cosmo-run-test)
|
||||
(define-key c++-mode-map (kbd "C-c C-s") 'cosmo-run-test)
|
||||
(define-key c-mode-map (kbd "C-c C-_") 'cosmo-run-win7)
|
||||
(define-key c-mode-map (kbd "C-c C-_") 'cosmo-run-win10))
|
||||
(define-key c-mode-map (kbd "C-c C-_") 'cosmo-run-win10)
|
||||
(define-key c++-mode-map (kbd "C-c C-_") 'cosmo-run-win10))
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
@ -939,7 +941,7 @@
|
|||
"T[0-9][0-9]:[0-9][0-9]:[0-9][0-9]" ;; time
|
||||
"[+.][0-9][0-9][0-9][0-9][0-9][0-9]" ;; micros
|
||||
":\\([^:]+\\)" ;; file
|
||||
":\\([0-9]+\\)")) ;; line
|
||||
":\\([0-9]+\\)")) ;; line
|
||||
1 2))
|
||||
|
||||
(eval-after-load 'compile
|
||||
|
@ -948,6 +950,20 @@
|
|||
(cons 'cosmo cosmo-compilation-regexps))
|
||||
(add-to-list 'compilation-error-regexp-alist 'cosmo)))
|
||||
|
||||
(defvar cosmo-gcc123-compilation-regexps
|
||||
(list (cosmo-join
|
||||
""
|
||||
'("inlined from '[^']*' at "
|
||||
"\\([^:]+\\)" ;; file
|
||||
":\\([0-9]+\\)")) ;; line
|
||||
1 2))
|
||||
|
||||
(eval-after-load 'compile
|
||||
'(progn
|
||||
(add-to-list 'compilation-error-regexp-alist-alist
|
||||
(cons 'cosmo cosmo-gcc123-compilation-regexps))
|
||||
(add-to-list 'compilation-error-regexp-alist 'cosmo)))
|
||||
|
||||
(provide 'cosmo-stuff)
|
||||
|
||||
;;; cosmo-stuff.el ends here
|
||||
|
|
|
@ -340,7 +340,7 @@ cosmo_kws = frozenset([
|
|||
"mallocesque",
|
||||
"mayalias",
|
||||
"memcpyesque",
|
||||
"nocallback",
|
||||
"dontcallback",
|
||||
"nodebuginfo",
|
||||
"__wur",
|
||||
"dontinline",
|
||||
|
@ -399,7 +399,7 @@ cosmo_kws = frozenset([
|
|||
"mallocesque",
|
||||
"mayalias",
|
||||
"memcpyesque",
|
||||
"nocallback",
|
||||
"dontcallback",
|
||||
"nodebuginfo",
|
||||
"__wur",
|
||||
"dontinline",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue