MOVL    AX, g_stackguard0(CX)
        MOVL    AX, g_stackguard1(CX)
 
+#ifndef GOOS_windows
        // skip runtime·ldt0setup(SB) and tls test after _cgo_init for non-windows
-       CMPL runtime·iswindows(SB), $0
-       JEQ ok
+       JMP ok
+#endif
 needtls:
+#ifdef GOOS_plan9
        // skip runtime·ldt0setup(SB) and tls test on Plan 9 in all cases
-       CMPL    runtime·isplan9(SB), $1
-       JEQ     ok
+       JMP     ok
+#endif
 
        // set up %gs
        CALL    runtime·ldt0setup(SB)
 
        MOVQ    AX, g_stackguard0(CX)
        MOVQ    AX, g_stackguard1(CX)
 
-       CMPL    runtime·iswindows(SB), $0
-       JEQ ok
+#ifndef GOOS_windows
+       JMP ok
+#endif
 needtls:
+#ifdef GOOS_plan9
        // skip TLS setup on Plan 9
-       CMPL    runtime·isplan9(SB), $1
-       JEQ ok
+       JMP ok
+#endif
+#ifdef GOOS_solaris
        // skip TLS setup on Solaris
-       CMPL    runtime·issolaris(SB), $1
-       JEQ ok
+       JMP ok
+#endif
 
        LEAQ    runtime·tls0(SB), DI
        CALL    runtime·settls(SB)
 
        MOVL    AX, 4(SP)
        CALL    runtime·rt0_go(SB)
 
-DATA  runtime·isplan9(SB)/4, $1
-GLOBL runtime·isplan9(SB), NOPTR, $4
 GLOBL _tos(SB), NOPTR, $4
 GLOBL _privates(SB), NOPTR, $4
 GLOBL _nprivates(SB), NOPTR, $4
 
        MOVQ    $runtime·rt0_go(SB), AX
        JMP     AX
 
-DATA runtime·isplan9(SB)/4, $1
-GLOBL runtime·isplan9(SB), NOPTR, $4
 GLOBL _tos(SB), NOPTR, $8
 GLOBL _privates(SB), NOPTR, $8
 GLOBL _nprivates(SB), NOPTR, $4
 
 TEXT main(SB),NOSPLIT,$-8
        MOVQ    $runtime·rt0_go(SB), AX
        JMP     AX
-
-DATA runtime·issolaris(SB)/4, $1
-GLOBL runtime·issolaris(SB), NOPTR, $4
 
 
 TEXT _main(SB),NOSPLIT,$0
        JMP     runtime·rt0_go(SB)
-
-
-DATA  runtime·iswindows(SB)/4, $1
-GLOBL runtime·iswindows(SB), NOPTR, $4
 
 TEXT main(SB),NOSPLIT,$-8
        MOVQ    $runtime·rt0_go(SB), AX
        JMP     AX
-
-DATA  runtime·iswindows(SB)/4, $1
-GLOBL runtime·iswindows(SB), NOPTR, $4
 
        sysargs(c, v)
 }
 
-var (
-       // TODO: Retire in favor of GOOS== checks.
-       isplan9   int32
-       issolaris int32
-       iswindows int32
-)
-
 func goargs() {
        if GOOS == "windows" {
                return