Skip to content

Commit 9daf97d

Browse files
committed
fixup! use separate names for internal and exported functions
1 parent 3a02a12 commit 9daf97d

File tree

7 files changed

+44
-18
lines changed

7 files changed

+44
-18
lines changed

src/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,13 @@ endif
9595

9696
# headers are used for dependency tracking, while public headers will be part of the dist
9797
UV_HEADERS :=
98-
HEADERS := $(BUILDDIR)/julia_version.h $(wildcard $(SRCDIR)/support/*.h) $(addprefix $(SRCDIR)/,julia.h julia_assert.h julia_threads.h julia_fasttls.h julia_locks.h julia_atomics.h julia_internal.h options.h timing.h) $(addprefix $(BUILDDIR)/, $(DTRACE_HEADERS) jl_internal_funcs.inc)
9998
ifeq ($(USE_SYSTEM_LIBUV),0)
10099
UV_HEADERS += uv.h
101100
UV_HEADERS += uv/*.h
102101
endif
102+
PUBLIC_HEADERS := $(BUILDDIR)/julia_version.h $(wildcard $(SRCDIR)/support/*.h) $(addprefix $(SRCDIR)/,julia.h julia_assert.h julia_threads.h julia_fasttls.h julia_locks.h julia_atomics.h)
103+
HEADERS := $(PUBLIC_HEADERS) $(addprefix $(SRCDIR)/,julia_internal.h options.h timing.h) $(addprefix $(BUILDDIR)/,$(DTRACE_HEADERS) jl_internal_funcs.inc)
104+
PUBLIC_HEADERS += $(addprefix $(SRCDIR)/,julia_gcext.h)
103105
PUBLIC_HEADER_TARGETS := $(addprefix $(build_includedir)/julia/,$(notdir $(PUBLIC_HEADERS)) $(UV_HEADERS))
104106

105107
LLVM_LDFLAGS := $(shell $(LLVM_CONFIG_HOST) --ldflags)

src/julia.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
#ifdef LIBRARY_EXPORTS
77
#include "jl_internal_funcs.inc"
8+
#undef jl_setjmp
9+
#undef jl_longjmp
810
#endif
911

1012
//** Configuration options that affect the Julia ABI **//
@@ -1885,14 +1887,25 @@ JL_DLLEXPORT void jl_restore_excstack(size_t state) JL_NOTSAFEPOINT;
18851887
#if defined(_COMPILER_GCC_)
18861888
JL_DLLEXPORT int __attribute__ ((__nothrow__,__returns_twice__)) (jl_setjmp)(jmp_buf _Buf);
18871889
__declspec(noreturn) __attribute__ ((__nothrow__)) void (jl_longjmp)(jmp_buf _Buf, int _Value);
1890+
JL_DLLEXPORT int __attribute__ ((__nothrow__,__returns_twice__)) (ijl_setjmp)(jmp_buf _Buf);
1891+
__declspec(noreturn) __attribute__ ((__nothrow__)) void (ijl_longjmp)(jmp_buf _Buf, int _Value);
18881892
#else
18891893
JL_DLLEXPORT int (jl_setjmp)(jmp_buf _Buf);
18901894
void (jl_longjmp)(jmp_buf _Buf, int _Value);
1895+
JL_DLLEXPORT int (ijl_setjmp)(jmp_buf _Buf);
1896+
void (ijl_longjmp)(jmp_buf _Buf, int _Value);
18911897
#endif
1898+
#ifdef LIBRARY_EXPORTS
1899+
#define jl_setjmp_f ijl_setjmp
1900+
#define jl_setjmp_name "ijl_setjmp"
1901+
#define jl_setjmp(a,b) ijl_setjmp(a)
1902+
#define jl_longjmp(a,b) ijl_longjmp(a,b)
1903+
#else
18921904
#define jl_setjmp_f jl_setjmp
18931905
#define jl_setjmp_name "jl_setjmp"
18941906
#define jl_setjmp(a,b) jl_setjmp(a)
18951907
#define jl_longjmp(a,b) jl_longjmp(a,b)
1908+
#endif
18961909
#elif defined(_OS_EMSCRIPTEN_)
18971910
#define jl_setjmp(a,b) setjmp(a)
18981911
#define jl_longjmp(a,b) longjmp(a,b)

src/support/END.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ CNAME endp
4747

4848

4949
#undef CNAME
50-
#undef HIDENAME
5150
#undef STR
5251
#undef XSTR
5352
#undef _START_ENTRY

src/support/ENTRY.amd64.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
#define EXT_(csym) csym
4242
#define EXT(csym) EXT_(csym)
4343
#endif
44-
#define HIDENAME(asmsym) .asmsym
4544
.text
4645
_START_ENTRY
4746
.globl EXT(CNAME)
@@ -51,7 +50,6 @@ EXT(CNAME):
5150
#elif defined(_WIN32)
5251
#define EXT_(csym) csym
5352
#define EXT(csym) EXT_(csym)
54-
#define HIDENAME(asmsym) .asmsym
5553

5654
#ifndef _MSC_VER
5755
.intel_syntax noprefix

src/support/ENTRY.i387.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
#define EXT_(csym) csym
4242
#define EXT(csym) EXT_(csym)
4343
#endif
44-
#define HIDENAME(asmsym) .asmsym
4544
.text
4645
_START_ENTRY
4746
.globl EXT(CNAME)
@@ -51,7 +50,6 @@ EXT(CNAME):
5150
#elif defined(_WIN32)
5251
#define EXT_(csym) _##csym
5352
#define EXT(csym) EXT_(csym)
54-
#define HIDENAME(asmsym) .asmsym
5553

5654
#ifndef _MSC_VER
5755
.intel_syntax

src/support/_setjmp.win32.S

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@
5656
* and update fs:[0xEOC] to contain the address of the stack
5757
*/
5858

59-
#define CNAME jl_setjmp
59+
#define CNAME ijl_setjmp
6060
#include "ENTRY.i387.h"
61+
.globl _jl_setjmp
62+
_jl_setjmp:
6163
mov eax,DWORD PTR [esp+4] // arg 1
6264
mov edx,DWORD PTR [esp+0] // rta
6365
mov DWORD PTR [eax+0],ebp
@@ -73,8 +75,10 @@
7375
#include "END.h"
7476

7577

76-
#define CNAME jl_longjmp
78+
#define CNAME ijl_longjmp
7779
#include "ENTRY.i387.h"
80+
.globl _jl_longjmp
81+
_jl_longjmp:
7882
mov edx,DWORD PTR [esp+4] // arg 1
7983
mov eax,DWORD PTR [esp+8] // arg 2
8084
mov ebp,DWORD PTR [edx+24] // seh registration
@@ -87,14 +91,16 @@
8791
mov ebp,DWORD PTR [edx+0]
8892
mov DWORD PTR [esp],ecx
8993
test eax,eax
90-
jne a
94+
jne 1f
9195
inc eax
92-
a: ret // jmp ecx
96+
1: ret // jmp ecx
9397
#include "END.h"
9498

9599

96-
#define CNAME jl_swapcontext
100+
#define CNAME ijl_swapcontext
97101
#include "ENTRY.i387.h"
102+
.globl _jl_swapcontext
103+
_jl_swapcontext:
98104
mov eax,DWORD PTR [esp+4]
99105
// save stack registers
100106
mov edx,DWORD PTR fs:[8] // stack top (low)
@@ -118,8 +124,10 @@ a: ret // jmp ecx
118124
#include "END.h"
119125

120126

121-
#define CNAME jl_setcontext
127+
#define CNAME ijl_setcontext
122128
#include "ENTRY.i387.h"
129+
.globl _jl_setcontext
130+
_jl_setcontext:
123131
mov eax,DWORD PTR [esp+4]
124132
// restore stack registers
125133
mov edx,DWORD PTR [eax+0]

src/support/_setjmp.win64.S

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66
* and update gs:[0x1478] to contain the address of the stack
77
*/
88

9-
#define CNAME jl_setjmp
9+
#define CNAME ijl_setjmp
1010
#include "ENTRY.amd64.h"
11+
.globl jl_setjmp
12+
jl_setjmp:
1113
mov rdx,QWORD PTR [rsp] // rta
1214
mov rax,QWORD PTR gs:[0] // SEH
1315
mov QWORD PTR [rcx+0],rax
@@ -37,8 +39,10 @@
3739
#include "END.h"
3840

3941

40-
#define CNAME jl_longjmp
42+
#define CNAME ijl_longjmp
4143
#include "ENTRY.amd64.h"
44+
.globl jl_longjmp
45+
jl_longjmp:
4246
mov rax,QWORD PTR [rcx+0]
4347
mov rbx,QWORD PTR [rcx+8]
4448
mov rsp,QWORD PTR [rcx+16]
@@ -63,15 +67,17 @@
6367
mov QWORD PTR gs:[0],rax
6468
mov eax,edx // move arg2 to return
6569
test eax,eax
66-
jne a
70+
jne 1f
6771
inc eax
68-
a: mov QWORD PTR [rsp],r8
72+
1: mov QWORD PTR [rsp],r8
6973
ret
7074
#include "END.h"
7175

7276

73-
#define CNAME jl_swapcontext
77+
#define CNAME ijl_swapcontext
7478
#include "ENTRY.amd64.h"
79+
.globl jl_swapcontext
80+
jl_swapcontext:
7581
// save stack registers
7682
mov r8,QWORD PTR gs:[16] // stack top (low)
7783
mov rax,QWORD PTR gs:[8] // stack bottom (high)
@@ -109,8 +115,10 @@ a: mov QWORD PTR [rsp],r8
109115
#include "END.h"
110116

111117

112-
#define CNAME jl_setcontext
118+
#define CNAME ijl_setcontext
113119
#include "ENTRY.amd64.h"
120+
.globl jl_setcontext
121+
jl_setcontext:
114122
// restore stack registers
115123
mov r8,QWORD PTR [rcx+0]
116124
mov rax,QWORD PTR [rcx+8]

0 commit comments

Comments
 (0)