summaryrefslogtreecommitdiff
path: root/config/comp_libs/newlib-nano.in
blob: 5a81fdec8485b55918065dc048cab0ae8bbef3c0 (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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
# newlib-nano options

## depends on BARE_METAL

## help Newlib-nano is a C library intended for use on embedded systems. It is a
## help conglomeration of several library parts, all under free software
## help licenses that make them easily usable on embedded products. Newlib-nano
## help is only available in source form. It can be compiled for a wide
## help array of processors, and will usually work on any architecture with
## help the addition of a few low-level routines.

config NEWLIB_NANO_GCC_LIBSTDCXX
    bool
    prompt "Compile libstdc++ newlib-nano variant"
    default y
    depends on CC_LANG_CXX
    help
      This option compiles an additional target libstdc++ for use with
      newlib-nano.

config NEWLIB_NANO_GCC_LIBSTDCXX_TARGET_CXXFLAGS
    string
    prompt "Target CXXFLAGS for libstdc++ newlib-nano variant"
    default "-fno-exceptions"
    help
      Used to add extra CXXFLAGS when compiling the target libstdc++
      newlib-nano library (e.g. -fno-exceptions).

config NEWLIB_NANO_INSTALL_IN_TARGET
    bool
    prompt "Additionally install newlib-nano libs into TARGET dir"
    help
      This option will install a copy of newlib-nano lib*.a file in the target
      dir but renamed with a nano.a suffix (eg: libc_nano.a) as some default
      nano.spec files from newlib expect this setup.

      Additionally the newlib-nano version of newlib.h will get copied to
      include/newlib-nano/newlib.h.

# maybe older versions of newlib will support it too, but this
# needs to be checked
config NEWLIB_NANO_CXA_ATEXIT
    def_bool y
    depends on NEWLIB_NANO_2_0_or_later
    select LIBC_PROVIDES_CXA_ATEXIT

config NEWLIB_NANO_HAS_NANO_MALLOC
    def_bool y
    depends on NEWLIB_NANO_2_1_or_later

config NEWLIB_NANO_HAS_NANO_FORMATTED_IO
    def_bool y
    depends on NEWLIB_NANO_2_2_or_later

config LIBC_NEWLIB_NANO_TARGET_CFLAGS
    string
    prompt "Target CFLAGS for newlib"
    default ""
    help
      Used to add specific options when compiling the target libraries
      (eg. -ffunction-sections -fdata-sections), which can't be defined
      in global TARGET_CFLAGS, because they shall be not used for the
      gcc target libraries.
      Note:  Both TARGET_CFLAGS and LIBC_NEWLIB_NANO_TARGET_CFLAGS are used
             to compile the libraries.

      Leave blank if you don't know better.

config LIBC_NEWLIB_NANO_IO_C99FMT
    bool
    prompt "Enable IOs on C99 formats"
    help
      Enable support for IOs on C99 formats.

config LIBC_NEWLIB_NANO_IO_LL
    bool
    prompt "Enable IOs on long long"
    help
      Enable support for IOs on long long integers.

config LIBC_NEWLIB_NANO_IO_FLOAT
    bool
    prompt "Enable IOs on floats and doubles"
    help
      Enable support for IOs on floating point
      values (float and double).

config LIBC_NEWLIB_NANO_IO_LDBL
    bool
    prompt "Enable IOs on long doubles"
    depends on LIBC_NEWLIB_NANO_IO_FLOAT
    help
      Enable support for IOs on long doubles.

config LIBC_NEWLIB_NANO_IO_POS_ARGS
    bool
    prompt "Enable printf-family positional arg support"
    help
        Enable printf-family positional arg support.

config LIBC_NEWLIB_NANO_FVWRITE_IN_STREAMIO
    bool
    prompt "Vector buffer mechanism to support stream IO buffering"
    default y
    help
        NEWLIB implements the vector buffer mechanism to support stream IO
        buffering required by C standard.  This feature is possibly
        unnecessary for embedded systems which won't change file buffering
        with functions like `setbuf' or `setvbuf'.  The buffering mechanism
        still acts as default for STDIN/STDOUT/STDERR even if this option
        is specified.

config LIBC_NEWLIB_NANO_UNBUF_STREAM_OPT
    bool
    prompt "Optimize fprintf to unbuffered unix file"
    help
        NEWLIB does optimization when `fprintf to write only unbuffered unix
        file'.  It creates a temorary buffer to do the optimization that
        increases stack consumption by about `BUFSIZ' bytes. Disabling this option
        disables the optimization and saves size of text and stack.

config LIBC_NEWLIB_NANO_FSEEK_OPTIMIZATION
    bool
    prompt "Fseek optimisation"
    help
        Disabling fseek optimisation can decrease code size.

config LIBC_NEWLIB_NANO_DISABLE_SUPPLIED_SYSCALLS
    bool
    prompt "Disable the syscalls supplied with newlib"
    help
      Disable the syscalls that come with newlib. You
      will have to implement your own _sbrk, _read,
      _write... If you plan to port newlib to a new
      platform/board, say Yes.

config LIBC_NEWLIB_NANO_REGISTER_FINI
    bool
    prompt "Enable finalization function registration using atexit"
    help
        Enable finalization function registration using atexit.

config LIBC_NEWLIB_NANO_ATEXIT_DYNAMIC_ALLOC
    bool
    prompt "Enable dynamic allocation of atexit entries"
    default y
    help
        Enable dynamic allocation of atexit entries.

config LIBC_NEWLIB_NANO_GLOBAL_ATEXIT
    bool
    prompt "Enable atexit data structure as global variable"
    default y
    help
        Enable atexit data structure as global variable.  By doing so it is
        move out of _reent structure, and can be garbage collected if atexit
        is not referenced.

config LIBC_NEWLIB_NANO_LITE_EXIT
    bool
    prompt "Enable lite exit"
    default y
    help
        Enable lite exit, a size-reduced implementation of exit that doesn't
        invoke clean-up functions such as _fini or global destructors.

config LIBC_NEWLIB_NANO_REENT_SMALL
    bool
    prompt "Enable small reentrant struct support"
    default y
    help
        Enable small reentrant struct support.

config LIBC_NEWLIB_NANO_MULTITHREAD
    bool
    prompt "Enable support for multiple threads"
    default y
    help
        Enable support for multiple threads.

config LIBC_NEWLIB_NANO_RETARGETABLE_LOCKING
    bool
    prompt "Enable retargetable locking"
    help
        Enable retargetable locking to allow the operating system to override
        the dummy lock functions defined within the newlib.

config LIBC_NEWLIB_NANO_EXTRA_SECTIONS
    bool
    prompt "Place each function & data element in their own section"
    help
        Place each function & data symbol in their own section. This allows
        the linker to garbage collect unused symbols at link time.

config LIBC_NEWLIB_NANO_WIDE_ORIENT
    bool
    prompt "Allow wide C99 stream orientation"
    default n
    help
        C99 states that each stream has an orientation, wide or byte.  This
        feature is possibly unnecessary for embedded systems which only do
        byte input/output operations on stream. Disabling this feature can
        decrease code size.

config LIBC_NEWLIB_NANO_ENABLE_TARGET_OPTSPACE
    bool
    prompt "Optimize newlib for size"
    default y
    help
      Pass --enable-target-optspace to newlib configure.

      This will compile newlib with -Os.

config LIBC_NEWLIB_NANO_LTO
    bool
    prompt "Enable Link Time Optimization"
    depends on CC_GCC_USE_LTO
    help
      Builds the libraries with -flto to enable more aggressive link time
      optimization. You will need to add -flto-partition=one to your
      application's link line to keep the RETURN assembler macro together
      with it's consumers.

config LIBC_NEWLIB_NANO_NANO_MALLOC
    bool
    prompt "Enable Nano Malloc"
    default y
    depends on NEWLIB_NANO_HAS_NANO_MALLOC
    help
      NEWLIB has two implementations of malloc family's functions, one in
      `mallocr.c' and the other one in `nano-mallocr.c'.  This options
      enables the nano-malloc implementation, which is for small systems
      with very limited memory.  Note that this implementation does not
      support `--enable-malloc-debugging' any more.

config LIBC_NEWLIB_NANO_NANO_FORMATTED_IO
    bool
    prompt "Enable Nano Formatted I/O"
    default y
    depends on NEWLIB_NANO_HAS_NANO_FORMATTED_IO
    help
      This builds NEWLIB with a special implementation of formatted I/O
      functions, designed to lower the size of application on small systems
      with size constraint issues.  This option does not affect wide-char
      formatted I/O functions.

config LIBC_NEWLIB_NANO_EXTRA_CONFIG_ARRAY
    string
    prompt "Extra config for newlib"
    default ""
    help
      Extra flags to pass onto ./configure when configuring the newlib.