Skip to content

Commit

Permalink
fix nim-lang#15955: --app:staticlib -d:nimLinkerWeakSymbols allows us…
Browse files Browse the repository at this point in the history
…ing weak symbols
  • Loading branch information
timotheecour committed Feb 8, 2021
1 parent a9f44b7 commit 4fef3a3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/cgen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1360,7 +1360,7 @@ proc genMainProc(m: BModule) =
"}$N$N"

NimMainProc =
"N_CDECL(void, NimMain)(void) {$N" &
"N_LIB_PRIVATE N_CDECL(void, NimMain)(void) {$N" &
"\tvoid (*volatile inner)(void);$N" &
"$4" &
"\tinner = NimMainInner;$N" &
Expand Down
2 changes: 2 additions & 0 deletions lib/nimbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ __AVR__

#if defined(WIN32) || defined(_WIN32) /* only Windows has this mess... */
# define N_LIB_PRIVATE
# define N_LIB_WEAK __declspec(selectany)#
# define N_CDECL(rettype, name) rettype __cdecl name
# define N_STDCALL(rettype, name) rettype __stdcall name
# define N_SYSCALL(rettype, name) rettype __syscall name
Expand All @@ -196,6 +197,7 @@ __AVR__
# define N_LIB_IMPORT extern __declspec(dllimport)
#else
# define N_LIB_PRIVATE __attribute__((visibility("hidden")))
# define N_LIB_WEAK __attribute__((weak))
# if defined(__GNUC__)
# define N_CDECL(rettype, name) rettype name
# define N_STDCALL(rettype, name) rettype name
Expand Down

0 comments on commit 4fef3a3

Please sign in to comment.