Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arc/orc is broken for vcc (devel) #20873

Closed
rockcavera opened this issue Nov 18, 2022 · 1 comment · Fixed by #20913
Closed

arc/orc is broken for vcc (devel) #20873

rockcavera opened this issue Nov 18, 2022 · 1 comment · Fixed by #20913

Comments

@rockcavera
Copy link
Contributor

rockcavera commented Nov 18, 2022

What happened?

The compiler fails with an error when trying to compile using arc/orc any simple code such as an echo "hello". This error only appears using --cc:vcc.

Nim Version

Nim Compiler Version 1.7.3 [Windows: amd64]
Compiled at 2022-11-17
Copyright (c) 2006-2022 by Andreas Rumpf

git hash: 68f6926
active boot switches: -d:release

Current Standard Output Logs

nim c --cc:vcc -f --mm:arc test
Hint: used config file 'E:\Nim\config\nim.cfg' [Conf]
Hint: used config file 'E:\Nim\config\config.nims' [Conf]
....................................................
E:\Nim\lib\system\alloc.nim(768, 19) template/generic instantiation of `atomicPrepend` from here
E:\Nim\lib\system\alloc.nim(762, 16) template/generic instantiation of `storea` from here
E:\Nim\lib\system\alloc.nim(145, 36) Error: undeclared identifier: 'atomicStoreN'
candidates (edit distance, scope distance); see '--spellSuggest':
 (4, 3): 'atomicLoadN' [proc declared in E:\Nim\lib\system\atomics.nim(192, 8)]
 (4, 3): 'atomicStatDec' [template declared in E:\Nim\lib\system\alloc.nim(155, 10)]
 (4, 3): 'atomicStatInc' [template declared in E:\Nim\lib\system\alloc.nim(156, 10)]

With --threads:off the error message is different.

nim c --cc:vcc -f --mm:arc --threads:off test
Hint: used config file 'E:\Nim\config\nim.cfg' [Conf]
Hint: used config file 'E:\Nim\config\config.nims' [Conf]
..............................................
E:\Nim\lib\system\alloc.nim(768, 19) template/generic instantiation of `atomicPrepend` from here
E:\Nim\lib\system\alloc.nim(763, 10) Error: undeclared identifier: 'atomicCompareExchangeN'
candidates (edit distance, scope distance); see '--spellSuggest':
 (10, 4): 'interlockedCompareExchange8' [proc declared in E:\Nim\lib\system\atomics.nim(254, 10)]

Expected Standard Output Logs

It is expected to compile without problems.

Possible Solution

No response

Additional Information

I believe it is connected with this #20492

@ringabout
Copy link
Member

ringabout commented Nov 18, 2022

It seems that vcc(C compiler) lacks some basic atomic operations. atomicStoreN, atomicCompareExchangeN and atomicExchangeN needs to be implemented. Alternative is to switch to std/concurrency/atomics

Araq pushed a commit that referenced this issue Nov 25, 2022
* fixes #20873; arc/orc is broken for vcc

* fixes signature
survivorm pushed a commit to survivorm/Nim that referenced this issue Feb 28, 2023
* fixes nim-lang#20873; arc/orc is broken for vcc

* fixes signature
capocasa pushed a commit to capocasa/Nim that referenced this issue Mar 31, 2023
* fixes nim-lang#20873; arc/orc is broken for vcc

* fixes signature
bung87 pushed a commit to bung87/Nim that referenced this issue Jul 29, 2023
* fixes nim-lang#20873; arc/orc is broken for vcc

* fixes signature
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants