nim-lang / Nim

Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
https://nim-lang.org
Other
16.34k stars 1.46k forks source link

useNimRtl does not work for --gc:orc/arc (in windows) #16458

Closed codehz closed 2 years ago

codehz commented 3 years ago

Example

command: nim c --gc:orc --d:useNimRtl anysource.nim

Current Output

Hint: used config file 'C:\Users\CodeHz\.choosenim\toolchains\nim-1.4.2\config\nim.cfg' [Conf]
Hint: used config file 'C:\Users\CodeHz\.choosenim\toolchains\nim-1.4.2\config\config.nims' [Conf]
.
C:\Users\CodeHz\.choosenim\toolchains\nim-1.4.2\lib\system\mmdisp.nim(78, 25) template/generic instantiation of `instantiateForRegion` from here
C:\Users\CodeHz\.choosenim\toolchains\nim-1.4.2\lib\system\alloc.nim(1030, 3) Error: redefinition of 'allocImpl'; previous declaration here: C:\Users\CodeHz\.choosenim\toolchains\nim-1.4.2\lib\system\memalloc.nim(38, 8)

Expected Output

(works)

Possible Solution

no idea

Additional Information

Nim Compiler Version 1.4.2 [Windows: amd64]
Compiled at 2020-11-30
Copyright (c) 2006-2020 by Andreas Rumpf

active boot switches: -d:release
cooldome commented 3 years ago

use -d:useMalloc

timotheecour commented 3 years ago
codehz commented 3 years ago

use -d:useMalloc

the problem is the ORC still not working without NimRtl (cause crash when doing cycle collector that cross the dll boundary)

ringabout commented 2 years ago

see also https://forum.nim-lang.org/t/8897