File tree 6 files changed +36
-7
lines changed
6 files changed +36
-7
lines changed Original file line number Diff line number Diff line change @@ -62,10 +62,24 @@ config MULTILIB
62
62
NOTE: The multilib feature in crosstool-NG is not well-tested.
63
63
Use at your own risk, and report success and/or failure.
64
64
65
+ config MULTILIB_SPACE
66
+ bool
67
+ prompt "Build both speed and space optimized multilibs"
68
+ help
69
+ If you say 'y' here, then the toolchain will contain two versions
70
+ of every multilib, one optimized for speed (the default) and another
71
+ optimized for space. When building with the toolchain, linking with
72
+ -Os or -Oz will automatically select the space optimized variant.
73
+
74
+ # either MULTILIB or MULTILIB_SPACE is set
75
+ config MULTILIB_ANY
76
+ bool
77
+ default y if MULTILIB || MULTILIB_SPACE
78
+
65
79
config DEMULTILIB
66
80
bool "Attempt to combine libraries into a single directory"
67
- default y if !MULTILIB
68
- depends on !MULTILIB || EXPERIMENTAL
81
+ default y if !MULTILIB_ANY
82
+ depends on !MULTILIB_ANY || EXPERIMENTAL
69
83
help
70
84
Normally, Crosstool-NG installs the libraries into the directories
71
85
as the configure for these libraries determines appropriate. For
Original file line number Diff line number Diff line change @@ -346,7 +346,7 @@ do_binutils_for_target() {
346
346
347
347
[ -n " ${CT_PKGVERSION} " ] && extra_config+=(" --with-pkgversion=${CT_PKGVERSION} " )
348
348
[ -n " ${CT_TOOLCHAIN_BUGURL} " ] && extra_config+=(" --with-bugurl=${CT_TOOLCHAIN_BUGURL} " )
349
- if [ " ${CT_MULTILIB } " = " y" ]; then
349
+ if [ " ${CT_MULTILIB_ANY } " = " y" ]; then
350
350
extra_config+=(" --enable-multilib" )
351
351
else
352
352
extra_config+=(" --disable-multilib" )
Original file line number Diff line number Diff line change @@ -584,6 +584,9 @@ do_gcc_core_backend() {
584
584
extra_config+=(" --with-multilib-generator=${CT_CC_GCC_MULTILIB_GENERATOR} " )
585
585
fi
586
586
fi
587
+ if [ " ${CT_MULTILIB_SPACE} " = " y" ]; then
588
+ extra_config+=(" --enable-multilib-space" )
589
+ fi
587
590
588
591
CT_DoLog DEBUG " Extra config passed: '${extra_config[*]} '"
589
592
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ do_picolibc_common_install() {
20
20
CT_DoLog EXTRA " Configuring C library"
21
21
22
22
# Multilib is the default, so if it is not enabled, disable it.
23
- if [ " ${CT_MULTILIB } " != " y" ]; then
23
+ if [ " ${CT_MULTILIB_ANY } " != " y" ]; then
24
24
picolibc_opts+=(" -Dmultilib=false" )
25
25
fi
26
26
@@ -66,6 +66,17 @@ NANO_MALLOC:newlib-nano-malloc
66
66
[ " ${CT_LIBC_PICOLIBC_LTO} " = " y" ] && \
67
67
CT_LIBC_PICOLIBC_TARGET_CFLAGS=" ${CT_LIBC_PICOLIBC_TARGET_CFLAGS} -flto"
68
68
69
+ # Build picolibc in release mode when doing multilib-space mode as
70
+ # we want the default to be release, not minsize; you'll still get
71
+ # the -Os version if you link with -Os on the command line due to
72
+ # multilib
73
+
74
+ if [ " ${CT_LIBC_PICOLIBC_ENABLE_TARGET_OPTSPACE} " = " y" -a " ${CT_MULTILIB_SPACE} " != " y" ]; then
75
+ buildtype=" minsize"
76
+ else
77
+ buildtype=" release"
78
+ fi
79
+
69
80
cflags_for_target=" ${CT_ALL_TARGET_CFLAGS} ${CT_LIBC_PICOLIBC_TARGET_CFLAGS} "
70
81
71
82
# Note: picolibc handles the build/host/target a little bit differently
113
124
fi
114
125
115
126
CT_DoExecLog CFG \
116
- meson \
127
+ meson setup \
117
128
--cross-file picolibc-cross.txt \
118
129
--prefix=" ${picolibc_sysroot_dir} " \
130
+ --buildtype=" ${buildtype} " \
119
131
-Dincludedir=include \
120
132
-Dlibdir=" ${picolibc_lib_dir} " \
121
133
-Dspecsdir=" ${CT_SYSROOT_DIR} /lib" \
Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ do_newlib_nano_for_target() {
108
108
CT_DoLog EXTRA " Configuring Newlib Nano library"
109
109
110
110
# Multilib is the default, so if it is not enabled, disable it.
111
- if [ " ${CT_MULTILIB } " != " y" ]; then
111
+ if [ " ${CT_MULTILIB_ANY } " != " y" ]; then
112
112
newlib_nano_opts+=(" -Dmultilib=false" )
113
113
fi
114
114
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ newlib_main()
29
29
CT_DoLog EXTRA " Configuring C library"
30
30
31
31
# Multilib is the default, so if it is not enabled, disable it.
32
- if [ " ${CT_MULTILIB } " != " y" ]; then
32
+ if [ " ${CT_MULTILIB_ANY } " != " y" ]; then
33
33
newlib_opts+=(" --disable-multilib" )
34
34
fi
35
35
You can’t perform that action at this time.
0 commit comments