summary refs log tree commit diff stats
path: root/compiler/extccomp.nim
Commit message (Collapse)AuthorAgeFilesLines
* Use vccexe when generating static lib with vcc (#19843)Tomohiro2022-09-281-2/+3
|
* no ropes WIP (#20433)Andreas Rumpf2022-09-271-4/+6
| | | | | | | | | | | | | * refactorings in preparation for ropes elimination of the C code generator; mostly the usual ': Rope' -> 'result: var Rope' rewrite * rewrote ccgcalls.nim * refactored ccgexprs.nim * ccgliterals: refactoring * refactoring: code dealing with name mangling * refactoring: getRecordFieldsAux * ropes are strings (insert obscene joke here) * optimize JS code gen * optimizations and code improvements * more optimizations * final cleanups
* fix #17351; switch to c++17 and remove hacks (#20407)ringabout2022-09-231-2/+2
| | | | | * fix #17351; switch to c++17 * remove workaround
* Correctly detect major version of GCC (#20059)kraptor2022-07-181-20/+6
| | | | | | | | | | | | | | | We were doing a very poor job detecting the major version of GCC by parsing the output of --version. This patches uses -dumpversion to make this parsing straightforward and it also fixes a bunch of compiling issues on different platforms with custom output for --version switches. For example, openSUSE first line of the output includes the revision number and the parsing that was being done did mix that number with the major version and breaks building the nim compiler (as it doesn't find the 3 dots for an X.Y.Z semver format, hence returning "false"). In this patch, we simply use -dumpversion (which has been at least from 1993, so we are safe :)
* fix #20012 (#20013)Daniel Clarke2022-07-131-1/+1
| | | | | | | * replace gcc asm with __asm__ and add a test * update test case to specify gcc or clang and not cpp Co-authored-by: daniel <danielclarke@wearepopgun.com>
* once C++, always C++ [backport] (#19938)Jacek Sieka2022-06-301-10/+16
| | | | | | | | | | | * once C++, always C++ When using `{.compile: "file.cc".}` in a nim module, even when compiling with `nim c` the C++ compiler should be used - once any C++ file has been compiled, the C++ linker also needs to be used. * more strict C++ check * simplify code
* Fixes #19883 so genscript works with vcc (#19893)Don-Duong Quach2022-06-151-2/+8
|
* Refactor and doc package handling, module name mangling (#19821)quantimnot2022-05-301-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Refactor and doc package handling, module name mangling * Consolidate, de-duplicate and extend package handling * Alter how duplicate module names of a package are handled * Alter how module names are mangled * Fix crash when another package is named 'stdlib' (test case added) * Doc what defines a package in the manual Modules with duplicate names within a package used to be given 'fake' packages to resolve conflicts. That prevented the ability to discern if a module belonged to the current project package or a foreign package. They now have the proper package owner and the names are mangled in a consistent manner to prevent codegen clashes. All module names are now mangled the same. Stdlib was treated special before, but now it is same as any other package. This fixes a crash when a foreign package is named 'stdlib'. Module mangling is altered for both file paths and symbols used by the backends. Removed an unused module name to package mapping that may have been intended for IC. The mapping was removed because it wasn't being used and was complicating the issue of package modules with duplicate names not having the proper package owner assigned. * Fix some tests * Refactor `packagehandling` * Remove `packagehandling.withPackageName` and its uses * Move module path mangling from `packagehandling` to `modulepaths` * Move `options.toRodFile` to `ic` to break import cycle * Changed import style to match preferred style Co-authored-by: quantimnot <quantimnot@users.noreply.github.com>
* move assertions out of system (#19599)flywind2022-03-231-0/+3
|
* compile pragma: cache the result sooner (#19554)Ștefan Talpalaru2022-02-241-1/+3
| | | | | | | | | | | | extccomp.addExternalFileToCompile() relies on hashes to decide whether an external C file needs recompilation or not. Due to short-circuit evaluation of boolean expressions, the procedure that generates a corresponding hash file is not called the first time an external file is compiled, so an avoidable recompilation is triggered the next build. This patch fixes that by moving the proc call with a desired side effect from its boolean expression, so it's executed unconditionally.
* --cc:env now works correctly to assign linker executable, allowing to ↵Timothee Cour2021-08-111-1/+1
| | | | | | | cross-compile/run for windows on osx via wine (#18672) * --cc:env now works correctly to assign linker executable, allowing using wine on osx * fixup
* fix #18578 (#18580)flywind2021-07-271-6/+9
| | | | | | | | | | | | | * fix #18578 * add tests * tiny * apply changes * typo * add removeStaticFile
* make changeDetectedViaJsonBuildInstructions warning less verbose when json ↵Timothee Cour2021-06-061-1/+1
| | | | file invalid (eg due to spec change) (#18197)
* simplify extccomp.nim json logic via jsonutils; fix #18084 (#18100)Timothee Cour2021-06-031-180/+76
| | | | | | * simplify extccomp.nim json logic via jsonutils * fix #18084 * simplify further * workaround for bootstrap that can be removed after updating csources_v1 >= 1.2
* externalToLink: use quoteShell to avoid issues with spaces in paths for ↵Timothee Cour2021-04-291-13/+9
| | | | {.link.} pragmas (#17875)
* `--usenimcache` (implied by `nim r main`) now caches some compile options to ↵Timothee Cour2021-04-251-8/+9
| | | | | | | | | | | avoid recompiling when project was previously compiled with such options. (#17829) * `--usenimcache` (implied by `nim r main`) now caches some compile options to avoid recompiling when project was previously compiled with such options. * works * add test * changelog * use std/with
* CIs: attempt to use csources_v1 (#16282)Andreas Rumpf2021-04-211-1/+1
| | | | | | | | * CIs: attempt to use csources_v1 * also updated the BSDs * also updated azure pipelines * std modules should not itself use the 'std/' import dir... * compiler has to be careful with std/ for v1 booting
* -d:nimDebug: calls doAssert false instead of quit (#17739)Timothee Cour2021-04-171-1/+1
|
* hint:cc goes to stderr (like all other hints) instead of stdout (#17465)Timothee Cour2021-03-221-8/+7
| | | Co-authored-by: ee7 <45465154+ee7@users.noreply.github.com>
* [minor] clean extccomp (#17069)flywind2021-02-171-21/+16
|
* fix #16947: `--app:staticlib -o:lib` now first removes lib (#16948)Timothee Cour2021-02-081-0/+1
|
* fix #16949 --app:staticlib works on openbsd; --app:staticlib tested in CI ↵Timothee Cour2021-02-081-2/+2
| | | | (#16950)
* fix #16206, `nim r / nim -r` recompiles if cwd changes (#16349)Timothee Cour2021-01-021-2/+13
|
* fix `hintProcessing` dots interference with `static:echo` and `hintCC`; add ↵Timothee Cour2020-12-301-1/+4
| | | | | | | | | | tests for `nim secret`, add tests for hintProcessing, misc other bug fixes (#16495) * fix dots interfering with static:echo * add tests * fix hintProcessing dots for hintCC * improve trunner tests * fix bug: readLineFromStdin now writes prompt to stdout, consistent with linenoise and rdstdin * disable a failing test for windows
* Fix nimsuggest/#117 (#15602)Clyybber2020-11-151-4/+1
|
* new: `nim -e:cmd` to run a command directly; also fixes #15731 (#15687)Timothee Cour2020-11-091-0/+11
| | | | | | | | | | | | | | | * new: `nim -i cmd` * rename -i to -e (for eval); consistent with majority of other programing languages * `nim e -e:cmd` now works; bugfix: `echo cmd | nim e -` now works * honor --betterRun * address comments * --eval alias for -e (replaces undocumented --eval which was a noop) * --eval now defaults to e (nimscript) instead of r * address comment: remove -e, only keep --eval * address comment * fixup * Update compiler/nimconf.nim Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* implements https://github.com/nim-lang/RFCs/issues/260 (#15505)Andreas Rumpf2020-10-071-0/+4
| | | | | * implements https://github.com/nim-lang/RFCs/issues/260 * added a test case
* Big compiler Cleanup (#14777)Clyybber2020-08-281-2/+2
|
* fixes #14194 (#15023)Andreas Rumpf2020-07-201-1/+2
|
* Fix #12745 (#14879)Tomohiro2020-07-021-11/+1
|
* bug fixes with sfMainModule, hints, mainPackageNotes, mainPackageId, ↵Timothee Cour2020-06-041-2/+19
| | | | | | | hintSuccessX (#14555) * SuccessX `out` now works with --compileOnly and jsonscript; fix bugs in jsonscript * several bug fixes; eg: `nim doc lib/system/io` now is sane * dummy edit to force docs CI
* Fix a problem with extra build commands. (#14528)Khronos2020-06-011-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | When --compileOnly is on, extraCmds are not added to JsonBuildInstructions. ``` $ echo 'echo 123'>test.nim $ nim c --debuginfo --nimcache:cache test $ ls cache test test.dSYM test.nim $ tail -n3 cache/test.json "extraCmds": ["dsymutil /Users/khronos31/src/tmp/test"], "stdinInput": false } ``` ``` $ echo 'echo 123'>test.nim $ nim c --debuginfo --nimcache:cache --compileOnly test $ nim jsonscript --nimcache:cache test $ ls cache test test.nim $ tail -n3 cache/test.json "extraCmds": [], "stdinInput": false } ```
* fix some issues with --backend (#14363)Timothee Cour2020-05-161-7/+8
| | | | | * fix some issues with --backend * fix https://github.com/timotheecour/Nim/issues/175; improve upon #14306
* `nim doc --backend:js`, `nim doc --doccmd:-d:foo`, `nim r --backend:js`, ↵Timothee Cour2020-05-111-12/+12
| | | | | | | | | | `--doccmd:skip` + other improvements (#14278) * `nim doc --backend:js|cpp...` `nim doc --doccmd:'-d:foo --threads:on'` `nim r --backend:cpp...` (implies --run --usenimcache) * --usenimcache works with all targets * --docCmd:skip now skips compiling snippets; 50X speedup for doc/manual.rst
* added a new feature: --cc:env so that you can use any C compiler as long as ↵Andreas Rumpf2020-05-061-12/+26
| | | | it works like GCC
* cleanup the CC setting, only leave in there what is at least semi-officially ↵Andreas Rumpf2020-05-061-120/+0
| | | | supported
* fixes #14209 [backport:1.2] (#14213)Andreas Rumpf2020-05-051-0/+28
| | | | * fixes #14209 [backport:1.2] * improve stability
* vcc fix (#14222)cooldome2020-05-041-1/+1
| | | Co-authored-by: cooldome <ariabushenko@bk.ru>
* fix #14132 dsymutil should not be called on static libraries (#14133) ↵Timothee Cour2020-04-271-6/+6
| | | | [backport:1.2]
* Add LTO support for most compilers and do some VCC fixes (#14013)Keithcat12020-04-221-3/+4
| | | | | | | | | * Added LTO in nim.cfg, added /link in extccomp.nim and other fixes * Fix line endings * Fix line endings, for real this time. Almost certainly. Like, 95% certain. * Removed /MD from extccom.nim VCC comiler
* Add support for `zig cc` as C compiler. (#13757)Hessam Mehr2020-04-081-0/+11
|
* fix #13910 (#13917)cooldome2020-04-071-2/+2
| | | Co-authored-by: cooldome <ariabushenko@bk.ru>
* fix some codegen bugs: NIM_BOOL, NIM_STATIC_ASSERT, --passc:-std=... (etc) ↵Timothee Cour2020-04-071-3/+5
| | | | | | | | (#13798) * fix cgen bool D20200328T203812 * --passc:std=c++17 (etc) now works instead of silently ignored * document caveats for NIM_NIL
* Attempt to finish off araq cpp exceptions (#13695)cooldome2020-03-191-5/+23
| | | | | | | | | | | | | | | * config update * disable a questionable test * remove c++ exception handling IDs, new impl doesn't require it anymore * C++ based exceptions finally work * fixes bootstrapping problem in C++ mode * teach GCC it's 2020 now * more bugfixes for C++ based exception handling * apply cooldome's patch * another attempt to enable C++11 * bug fix Co-authored-by: Araq <rumpf_a@web.de> Co-authored-by: cooldome <ariabushenko@bk.ru>
* fix #13412 nim now recompiles for stdin input; SuccessX now configurable; ↵Timothee Cour2020-03-191-0/+10
| | | | | | can show whether it recompiled (#13506) * fix #13412 nim now recompiles for stdin input; SuccessX now indicates whether it recompiled
* fix #13633 fix koch boot crashing regression (#13635)Timothee Cour2020-03-121-1/+1
|
* Amend fix for #13633 (#13636)Clyybber2020-03-121-1/+1
|
* Fix #13633Clyybber2020-03-121-1/+2
|
* Make listCmd honor hint:cc:off (#13606)Clyybber2020-03-111-50/+35
| | | | | | | | | | | | | | | | | * Make listCmd honor hint:cc:off * Tiny cleanup * Tiny tiny cleanup * VERY IMPORTANT: --hint:cc:on will overwrite --verbosity:0 :p * Tiny cleanup * Stupid * Move displayProgressCC to where its required * Tiny cleanup
* `koch --nim:pathto/nim boot` and `koch boot --hint:cc:off` now work (#13516)Timothee Cour2020-03-111-14/+19
| | | | | * `koch boot --hint:cc:off` now works * `koch --nim:pathto/nim boot` now works; code cleanup