|
runtime/cgo: move common symbol overrides into 6c-compiled code
There are some function pointers declared by 6c in
package runtime without initialization and then also
declared in package runtime/cgo with initialization,
so that if runtime/cgo is linked in, the function pointers
are non-nil, and otherwise they are nil. We depend on
this property for implementing non-essential cgo hooks
in package runtime.
The declarations in package runtime are 6c-compiled
and end up in .6 files. The declarations in package runtime/cgo
are gcc-compiled and end up in .o files. Since 6l links the .6
and .o files together, this all works.
However, when we switch to "external linking" mode,
6l will not see the .o files, and it would be up to the host linker
to resolve the two into a single initialized symbol.
Not all host linkers will do this (in particular OS X gcc will not).
To fix this, move the cgo declarations into 6c-compiled code,
so that they end up in .6 files, so that 6l gets them no matter what.
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+20 lines, -47 lines) |
Patch |
 |
M |
src/pkg/runtime/cgo/callbacks.c
|
View
|
1
|
1 chunk |
+16 lines, -0 lines |
0 comments
|
Download
|
 |
M |
src/pkg/runtime/cgo/gcc_darwin_386.c
|
View
|
1
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
 |
M |
src/pkg/runtime/cgo/gcc_darwin_amd64.c
|
View
|
1
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
 |
M |
src/pkg/runtime/cgo/gcc_freebsd_386.c
|
View
|
1
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
 |
M |
src/pkg/runtime/cgo/gcc_freebsd_amd64.c
|
View
|
1
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
 |
M |
src/pkg/runtime/cgo/gcc_freebsd_arm.c
|
View
|
1
|
2 chunks |
+0 lines, -5 lines |
0 comments
|
Download
|
 |
M |
src/pkg/runtime/cgo/gcc_linux_386.c
|
View
|
1
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
 |
M |
src/pkg/runtime/cgo/gcc_linux_amd64.c
|
View
|
1
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
 |
M |
src/pkg/runtime/cgo/gcc_linux_arm.c
|
View
|
1
|
2 chunks |
+0 lines, -5 lines |
0 comments
|
Download
|
 |
M |
src/pkg/runtime/cgo/gcc_netbsd_386.c
|
View
|
1
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
 |
M |
src/pkg/runtime/cgo/gcc_netbsd_amd64.c
|
View
|
1
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
 |
M |
src/pkg/runtime/cgo/gcc_netbsd_arm.c
|
View
|
1
|
2 chunks |
+0 lines, -5 lines |
0 comments
|
Download
|
 |
M |
src/pkg/runtime/cgo/gcc_openbsd_386.c
|
View
|
1
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
 |
M |
src/pkg/runtime/cgo/gcc_openbsd_amd64.c
|
View
|
1
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
 |
M |
src/pkg/runtime/cgo/gcc_setenv.c
|
View
|
1
|
2 chunks |
+1 line, -3 lines |
0 comments
|
Download
|
 |
M |
src/pkg/runtime/cgo/gcc_util.c
|
View
|
1
|
3 chunks |
+0 lines, -6 lines |
0 comments
|
Download
|
 |
M |
src/pkg/runtime/cgo/gcc_windows_386.c
|
View
|
1
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
 |
M |
src/pkg/runtime/cgo/gcc_windows_amd64.c
|
View
|
1
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
 |
M |
src/pkg/runtime/cgo/setenv.c
|
View
|
1
|
1 chunk |
+3 lines, -11 lines |
0 comments
|
Download
|
Total messages: 4
|