summaryrefslogtreecommitdiff
path: root/libc/cbb-musl-pe.h
blob: 4bce1c2f089cce3c4b4474a521492d6ae2e0b2c0 (plain)
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
/************************************************************************/
/*  compiler building blocks: definitions for all musl-libc PE targets  */
/************************************************************************/

#ifndef __ASSEMBLER__

#include "cbb-common.h"

#ifdef __cplusplus
extern "C" {
#endif


/* features */
#undef	TARGET_C99_FUNCTIONS
#define	TARGET_C99_FUNCTIONS		(1)

#undef  TARGET_HAS_SINCOS
#define TARGET_HAS_SINCOS		(0)

#undef  TARGET_POSIX_IO
#define TARGET_POSIX_IO			(1)


/* preferences */
#undef  EMUTLS_PROVIDED_BY_PLATFORM
#define EMUTLS_PROVIDED_BY_PLATFORM	(1)

#undef  NO_IMPLICIT_EXTERN_C
#define NO_IMPLICIT_EXTERN_C		(1)

#undef  GTHREAD_USE_WEAK
#define GTHREAD_USE_WEAK		(0)

#undef  STANDARD_INCLUDE_DIR
#define STANDARD_INCLUDE_DIR		"/include"

#undef  LOCAL_INCLUDE_DIR
#define LOCAL_INCLUDE_DIR		"/local/include"

#undef  STANDARD_STARTFILE_PREFIX_1
#define STANDARD_STARTFILE_PREFIX_1	"/local/lib"

#undef  STANDARD_STARTFILE_PREFIX_2
#define STANDARD_STARTFILE_PREFIX_2	"/lib"


/* specs */
#undef  ASM_SPEC_ARCH
#define ASM_SPEC_ARCH			"%{m32:--32} "	\
					"%{m64:--64} "
#undef  ASM_SPEC_AVX
#define ASM_SPEC_AVX			"%{!mno-sse2avx:%{mavx:-msse2avx}} " \
					"%{msse2avx:%{!mavx:-msse2avx}} "
#undef  ASM_SPEC
#define ASM_SPEC			ASM_SPEC_ARCH ASM_SPEC_AVX

#undef  CPP_SPEC_POSIX
#define CPP_SPEC_POSIX			"%{posix|mposix:-D_POSIX_SOURCE} "

#undef  CPP_SPEC_NTAPI
#define CPP_SPEC_NTAPI			"%{mntapi:-ffreestanding} "

#undef  CPP_SPEC
#define CPP_SPEC 			CPP_SPEC_POSIX			\
					CPP_SPEC_NTAPI

#undef  LIB_SPEC
#define LIB_SPEC			"%{shared:-lc} "	   		\
					"%{pthread:-lpthread} "    		\
					"--no-as-needed -lc "			\
					"--as-needed -lpsxscl "			\
					"%{static:"                		\
						" --as-needed -lntapi"		\
						" --as-needed -ldalist"   	\
						" --as-needed -lpemagine}"	\
					"%{!shared:%{!static:%{!midata:"	\
						" --as-needed -lldso}}}"

#undef  STARTFILE_SPEC
#define STARTFILE_SPEC			"%{!mforeign:%R/lib/crti.o} "			\
					"%{!shared:%{mposix:%R/lib/crtposix.o}} "	\
					"%{!shared:%{mdinga:%R/lib/crtdinga.o}} "	\
					"%{!shared:%{mldso:"				\
						"%R/lib/%{static:S}crtldso.o}} "	\
					"%{!shared:%{mvrfs:"				\
						"%R/lib/%{static:S}crtvrfs.o}} "	\
					"%{!shared:%{!static:%{midata:"			\
						"%R/lib/crtidata.o}}} "			\
					"%{!shared:%R/lib/%{static:S}crt1.o} "		\
					"%{!shared:%{!mldso:%{!mvrfs:%{!midata:"	\
						"%R/lib/%{static:S}crtldso.o}}}} "	\
					"%{shared:%R/lib/crte.o} "			\
					"%{static:crtbeginT.o%s;"			\
					"shared|pie:crtbeginS.o%s;"			\
						":crtbegin.o%s} "

#undef  ENDFILE_SPEC
#define ENDFILE_SPEC			"%{shared|pie:crtendS.o%s;:crtend.o%s} "	\
					"%R/lib/crtn.o " LIB_SPEC

#undef  LINK_GCC_C_SEQUENCE_SPEC
#define LINK_GCC_C_SEQUENCE_SPEC	"%{static:--start-group} "		\
					"%L %G " 				\
					"%{static:--end-group}%{!static:%G} "	\
					"--no-as-needed -lc "

#undef  LINK_DSO_SYM_SPEC
#define LINK_DSO_SYM_SPEC 		"--exclude-symbols="		\
						"__EH_FRAME_BEGIN__,"	\
						"__dso_handle,"		\
						"_init,_fini,"		\
						"_so_entry_point,"	\
						"__so_entry_point,"	\
						"__chkstk_ms,"		\
						"___chkstk_ms,"		\
						"dso_main_routine "

#undef  LINK_SPEC
#define LINK_SPEC			"%{rdynamic:--export-all-symbols} "             \
					"%{mntapi:-nostdlib} "				\
					"%{static:-static} "				\
					"%{shared:-shared} "				\
					"%{shared:%{moutput-def:"			\
						"--output-def %{o*:%.so.def%*}}} "	\
					"%{shared:%{mout-implib:"			\
						"--out-implib %{o*:%.lib.a%*}}} "	\
					"%{shared:%{mout-dsolib:"			\
						"--out-dsolib %{o*:%.lib.a%*}}} "	\
					"%{!shared:--entry _start} "			\
					"%{!shared:--image-base 0x1920000} "		\
					"%{shared:--entry __so_entry_point} "		\
					"%{shared:--enable-auto-image-base} "		\
					"--subsystem %{mconsole:console;:windows} "	\
					LINK_DSO_SYM_SPEC

#undef  SUBTARGET_EXTRA_SPECS
#define SUBTARGET_EXTRA_SPECS


#ifdef __cplusplus
}
#endif

#endif /* __ASSEMBLER__ */