1
0
mirror of https://github.com/golang/go synced 2024-11-22 00:34:40 -07:00

Fix windows build.

R=brainman, rsc
CC=golang-dev
https://golang.org/cl/3533041
This commit is contained in:
Wei Guangjing 2010-12-13 16:41:02 +11:00 committed by Alex Brainman
parent 1f6b6ca9ba
commit e04ef7769e
4 changed files with 26 additions and 21 deletions

View File

@ -166,6 +166,7 @@ relocsym(Sym *s)
continue; continue;
if(r->sym != S && (r->sym->type == SDYNIMPORT || r->sym->dynimpname != nil)) if(r->sym != S && (r->sym->type == SDYNIMPORT || r->sym->dynimpname != nil))
if (thechar != '8' || HEADTYPE != 10) // Windows PE supports relocation references to dynamic import symbols
diag("unhandled relocation for %s (rtype %d)", r->sym->name, r->type); diag("unhandled relocation for %s (rtype %d)", r->sym->name, r->type);
if(r->sym != S && !r->sym->reachable) if(r->sym != S && !r->sym->reachable)

View File

@ -147,6 +147,10 @@ DIRS+=\
endif endif
ifeq ($(GOOS),windows)
DIRS:=$(filter-out runtime/cgo,$(DIRS))
endif
NOTEST=\ NOTEST=\
debug/proc\ debug/proc\
exp/draw/x11\ exp/draw/x11\

View File

@ -27,8 +27,8 @@ abort(int8 *name)
#pragma dynimport runtime·VirtualAlloc VirtualAlloc "kernel32.dll" #pragma dynimport runtime·VirtualAlloc VirtualAlloc "kernel32.dll"
#pragma dynimport runtime·VirtualFree VirtualFree "kernel32.dll" #pragma dynimport runtime·VirtualFree VirtualFree "kernel32.dll"
void *runtime·VirtualAlloc; extern void *runtime·VirtualAlloc;
void *runtime·VirtualFree; extern void *runtime·VirtualFree;
void* void*
runtime·SysAlloc(uintptr n) runtime·SysAlloc(uintptr n)

View File

@ -16,25 +16,25 @@
#pragma dynimport runtime·SetLastError SetLastError "kernel32.dll" #pragma dynimport runtime·SetLastError SetLastError "kernel32.dll"
// Also referenced by external packages // Also referenced by external packages
void *runtime·CloseHandle; extern void *runtime·CloseHandle;
void *runtime·ExitProcess; extern void *runtime·ExitProcess;
void *runtime·GetStdHandle; extern void *runtime·GetStdHandle;
void *runtime·SetEvent; extern void *runtime·SetEvent;
void *runtime·WriteFile; extern void *runtime·WriteFile;
void *runtime·LoadLibraryEx; extern void *runtime·LoadLibraryEx;
void *runtime·GetProcAddress; extern void *runtime·GetProcAddress;
void *runtime·GetLastError; extern void *runtime·GetLastError;
void *runtime·SetLastError; extern void *runtime·SetLastError;
#pragma dynimport runtime·CreateEvent CreateEventA "kernel32.dll" #pragma dynimport runtime·CreateEvent CreateEventA "kernel32.dll"
#pragma dynimport runtime·CreateThread CreateThread "kernel32.dll" #pragma dynimport runtime·CreateThread CreateThread "kernel32.dll"
#pragma dynimport runtime·GetModuleHandle GetModuleHandleA "kernel32.dll" #pragma dynimport runtime·GetModuleHandle GetModuleHandleA "kernel32.dll"
#pragma dynimport runtime·WaitForSingleObject WaitForSingleObject "kernel32.dll" #pragma dynimport runtime·WaitForSingleObject WaitForSingleObject "kernel32.dll"
void *runtime·CreateEvent; extern void *runtime·CreateEvent;
void *runtime·CreateThread; extern void *runtime·CreateThread;
void *runtime·GetModuleHandle; extern void *runtime·GetModuleHandle;
void *runtime·WaitForSingleObject; extern void *runtime·WaitForSingleObject;
void void
runtime·osinit(void) runtime·osinit(void)
@ -47,11 +47,11 @@ runtime·osinit(void)
#pragma dynimport runtime·FreeEnvironmentStrings FreeEnvironmentStringsW "kernel32.dll" #pragma dynimport runtime·FreeEnvironmentStrings FreeEnvironmentStringsW "kernel32.dll"
#pragma dynimport runtime·LocalFree LocalFree "kernel32.dll" #pragma dynimport runtime·LocalFree LocalFree "kernel32.dll"
void *runtime·GetCommandLine; extern void *runtime·GetCommandLine;
void *runtime·CommandLineToArgv; extern void *runtime·CommandLineToArgv;
void *runtime·GetEnvironmentStrings; extern void *runtime·GetEnvironmentStrings;
void *runtime·FreeEnvironmentStrings; extern void *runtime·FreeEnvironmentStrings;
void *runtime·LocalFree; extern void *runtime·LocalFree;
void void
runtime·windows_goargs(void) runtime·windows_goargs(void)