-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[devel regression] {.exportc.} tagged procs no longer export to compiled .so objects #13416
Comments
I already found this difference.. when the symbol exporting was working, the hello symbol had capital T before it in the
In the not-working .so, the hello symbol has lower-case t before it.
I do not understand the deal betweeen T and t, but apparently it definitely needs to be T for the Nim/SystemVerilog interop to work. |
Ref:
|
This got fixed after adding proc hello() {.exportc, dynlib.} =
let
str = when defined(cpp):
"C++!"
else:
"C!"
echo "Hello from Nim via " & str Now I see:
|
@alaviss Can you please add a changelog for this, and also update the manual: https://nim-lang.github.io/Nim/manual#foreign-function-interface-exportc-pragma It needs to be highlighted that when the user expects to export a symbol to a .so, etc., it needs to have both This also needs to change: https://nim-lang.github.io/Nim/manual#foreign-function-interface-dynlib-pragma-for-export
I seriously wonder if there's a way for From my perspective, it looks like:
That would then export the symbols locally (the This proposed change would be much less breaking as the |
Awesome research. |
* manual: documents changes regarding dynlib Closes #13416 * manual: clean up sentence phrasing
nah, visibility is not same as mangling. The change to dynlib was a good one. |
This is a serious show stopper for my SystemVerilog projects relying on Nim libaries.
In my Nim libraries, I export the procs using the
{.exportc.}
pragma, and the C layer of SystemVerilog imports those exported symbols to the SystemVerilog side.But now the
{.exportc.}
procs do not get exported at all.Example
Compile the below file on Linux using
nim c --out:libdpi.so --app:lib -d:release --gc:none libdpi.nim
.Now run
nm ./libdpi.so | grep -P '\bT\b'
(Note: This isnm
binary found on Linux systems, notnim
.)Current Output
!! hello symbol is not exported !!
Expected Output
Note that the hello symbol is exported: 0000000000005f80 T hello.
Possible Solution
None that I know of.
Additional Information
The text was updated successfully, but these errors were encountered: