aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/go/_std_1.21/src/runtime/cgo/ya.make
blob: 095be326f76fe450e3c0a3d31742e33f38612750 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
IF (CGO_ENABLED)
    GO_LIBRARY()

    PEERDIR(
        library/cpp/sanitizer/include
    )

    NO_COMPILER_WARNINGS()

    SRCS(
        abi_loong64.h
        abi_ppc64x.h
        callbacks.go
        CGO_EXPORT gcc_context.c
        CGO_EXPORT gcc_util.c
        handle.go
        iscgo.go
        libcgo.h
        libcgo_unix.h
    )

    CGO_SRCS(
        cgo.go
    )

    IF (ARCH_ARM64)
        SRCS(
            abi_arm64.h
            asm_arm64.s
            gcc_arm64.S
        )
    ENDIF()

    IF (ARCH_X86_64)
        SRCS(
            abi_amd64.h
            asm_amd64.s
            gcc_amd64.S
        )
    ENDIF()

    IF (OS_DARWIN)
        SRCS(
            callbacks_traceback.go
            CGO_EXPORT gcc_libinit.c
            CGO_EXPORT gcc_setenv.c
            CGO_EXPORT gcc_stack_darwin.c
            CGO_EXPORT gcc_traceback.c
            setenv.go
        )

        IF (ARCH_ARM64)
            CGO_LDFLAGS(
                -framework
                CoreFoundation
            )

            SRCS(
                CGO_EXPORT gcc_darwin_arm64.c
            )
        ENDIF()

        IF (ARCH_X86_64)
            CGO_LDFLAGS(
                -lpthread
            )

            SRCS(
                CGO_EXPORT gcc_darwin_amd64.c
            )
        ENDIF()
    ENDIF()

    IF (OS_LINUX)
        CGO_LDFLAGS(-lpthread -ldl -lresolv)

        SRCS(
            callbacks_traceback.go
            CGO_EXPORT gcc_fatalf.c
            CGO_EXPORT gcc_libinit.c
            CGO_EXPORT gcc_mmap.c
            CGO_EXPORT gcc_setenv.c
            CGO_EXPORT gcc_sigaction.c
            CGO_EXPORT gcc_stack_unix.c
            CGO_EXPORT gcc_traceback.c
            linux.go
            CGO_EXPORT linux_syscall.c
            mmap.go
            setenv.go
            sigaction.go
        )

        IF (ARCH_ARM64)
            SRCS(
                CGO_EXPORT gcc_linux_arm64.c
            )
        ENDIF()

        IF (ARCH_X86_64)
            SRCS(
                CGO_EXPORT gcc_linux_amd64.c
            )
        ENDIF()
    ENDIF()

    IF (OS_WINDOWS)
        SRCS(
            CGO_EXPORT gcc_libinit_windows.c
            CGO_EXPORT gcc_stack_windows.c
            libcgo_windows.h
        )

        IF (ARCH_ARM64)
            SRCS(
                CGO_EXPORT gcc_windows_arm64.c
            )
        ENDIF()

        IF (ARCH_X86_64)
            SRCS(
                CGO_EXPORT gcc_windows_amd64.c
            )
        ENDIF()
    ENDIF()

    END()
ENDIF()