* [PATCH 1/5] libc/musl: Remove gcc core pass-1 from musl-libc build
2014-09-05 6:34 [PATCH v3 0/5] Add musl-libc options Bryan Hundven
@ 2014-09-05 6:34 ` Bryan Hundven
2014-09-05 7:01 ` Bryan Hundven
2014-09-05 6:34 ` [PATCH 5/5] config/gcc: Disable CC_GCC_LIBSANITIZER for musl-libc Bryan Hundven
` (4 subsequent siblings)
5 siblings, 1 reply; 8+ messages in thread
From: Bryan Hundven @ 2014-09-05 6:34 UTC (permalink / raw)
To: Yann E. MORIN; +Cc: crossgcc, Bryan Hundven
In an effort to make the toolchain build simpler, remove the need for
the pass-1 build of gcc.
Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
---
config/libc/musl.in | 2 +-
scripts/build/libc/musl.sh | 9 +--------
2 files changed, 2 insertions(+), 9 deletions(-)
diff --git a/config/libc/musl.in b/config/libc/musl.in
index b3bec26..8f393b2 100644
--- a/config/libc/musl.in
+++ b/config/libc/musl.in
@@ -3,7 +3,7 @@
## depends on ! WINDOWS && ! BARE_METAL
##
## select LIBC_SUPPORT_THREADS_NATIVE
-## select CC_CORE_PASSES_NEEDED
+## select CC_CORE_PASS_2_NEEDED
##
## help Musl is a new standard library to power a new generation of Linux-based
## help devices. musl is lightweight, fast, simple, free, and strives to be
diff --git a/scripts/build/libc/musl.sh b/scripts/build/libc/musl.sh
index 7172cf2..f997d25 100644
--- a/scripts/build/libc/musl.sh
+++ b/scripts/build/libc/musl.sh
@@ -48,7 +48,7 @@ do_libc_configure() {
# NOTE: musl handles the build/host/target a little bit differently
# then one would expect:
# build : not used
- # host : the machine building musl
+ # host : the machine musl runs on
# target : the machine musl runs on
CT_DoExecLog CFG \
CFLAGS="${extra_cflags[@]}" \
@@ -73,13 +73,6 @@ do_libc_start_files() {
CT_DoLog EXTRA "Installing headers"
CT_DoExecLog ALL make DESTDIR="${CT_SYSROOT_DIR}" install-headers
-
- CT_DoExecLog ALL make DESTDIR="${CT_SYSROOT_DIR}" \
- crt/crt1.o crt/crti.o crt/crtn.o
- CT_DoExecLog ALL cp -av crt/crt*.o "${CT_SYSROOT_DIR}/usr/lib"
- CT_DoExecLog ALL ${CT_TARGET}-gcc -nostdlib \
- -nostartfiles -shared -x c /dev/null -o "${CT_SYSROOT_DIR}/usr/lib/libc.so"
- CT_EndStep
}
do_libc() {
--
2.1.0
--
For unsubscribe information see http://sourceware.org/lists.html#faq
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 4/5] libc/musl: Add config option for extra developer warnings
2014-09-05 6:34 [PATCH v3 0/5] Add musl-libc options Bryan Hundven
` (3 preceding siblings ...)
2014-09-05 6:34 ` [PATCH 3/5] libc/musl: Add config option for debugging info Bryan Hundven
@ 2014-09-05 6:34 ` Bryan Hundven
2014-09-11 21:28 ` [PATCH v3 0/5] Add musl-libc options Yann E. MORIN
5 siblings, 0 replies; 8+ messages in thread
From: Bryan Hundven @ 2014-09-05 6:34 UTC (permalink / raw)
To: Yann E. MORIN; +Cc: crossgcc, Bryan Hundven
This commit adds a configuration knob for enabling extra developer
warnings to be enabled during the musl-libc build.
Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
---
config/libc/musl.in.2 | 6 ++++++
scripts/build/libc/musl.sh | 4 ++++
2 files changed, 10 insertions(+)
diff --git a/config/libc/musl.in.2 b/config/libc/musl.in.2
index 5c265c8..f4abcc4 100644
--- a/config/libc/musl.in.2
+++ b/config/libc/musl.in.2
@@ -7,6 +7,12 @@ config LIBC_MUSL_DEBUG
This option enables debugging information, this will increase the size of
the resulting library.
+config LIBC_MUSL_WARNINGS
+ bool
+ prompt "Build with recommended warnings flags"
+ help
+ Build musl-libc with extra warnings, useful for musl-libc development.
+
choice
prompt "How to optimize musl-libc"
default LIBC_MUSL_OPTIMIZE_AUTO
diff --git a/scripts/build/libc/musl.sh b/scripts/build/libc/musl.sh
index 2690bf2..9aa5dc1 100644
--- a/scripts/build/libc/musl.sh
+++ b/scripts/build/libc/musl.sh
@@ -50,6 +50,10 @@ do_libc_configure() {
extra_config+=("--enable-debug")
fi
+ if [ "${CT_LIBC_MUSL_WARNINGS}" = "y" ]; then
+ extra_config+=("--enable-warnings")
+ fi
+
extra_config+=( "--enable-optimize=${CT_LIBC_MUSL_OPTIMIZE}" )
# NOTE: musl handles the build/host/target a little bit differently
--
2.1.0
--
For unsubscribe information see http://sourceware.org/lists.html#faq
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v3 0/5] Add musl-libc options
@ 2014-09-05 6:34 Bryan Hundven
2014-09-05 6:34 ` [PATCH 1/5] libc/musl: Remove gcc core pass-1 from musl-libc build Bryan Hundven
` (5 more replies)
0 siblings, 6 replies; 8+ messages in thread
From: Bryan Hundven @ 2014-09-05 6:34 UTC (permalink / raw)
To: Yann E. MORIN; +Cc: crossgcc
Many typos and fixes to suggestions made by y_morin and sh4rm4 in #crosstool-ng, here is v3. Enjoy!
-Bryan
--
For unsubscribe information see http://sourceware.org/lists.html#faq
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/5] libc/musl: Add options for optimization
2014-09-05 6:34 [PATCH v3 0/5] Add musl-libc options Bryan Hundven
2014-09-05 6:34 ` [PATCH 1/5] libc/musl: Remove gcc core pass-1 from musl-libc build Bryan Hundven
2014-09-05 6:34 ` [PATCH 5/5] config/gcc: Disable CC_GCC_LIBSANITIZER for musl-libc Bryan Hundven
@ 2014-09-05 6:34 ` Bryan Hundven
2014-09-05 6:34 ` [PATCH 3/5] libc/musl: Add config option for debugging info Bryan Hundven
` (2 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Bryan Hundven @ 2014-09-05 6:34 UTC (permalink / raw)
To: Yann E. MORIN; +Cc: crossgcc, Bryan Hundven
This commit adds configuration knobs for optimizing musl-libc.
Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
---
config/libc/musl.in.2 | 38 ++++++++++++++++++++++++++++++++++++++
scripts/build/libc/musl.sh | 6 +++++-
2 files changed, 43 insertions(+), 1 deletion(-)
create mode 100644 config/libc/musl.in.2
diff --git a/config/libc/musl.in.2 b/config/libc/musl.in.2
new file mode 100644
index 0000000..32e9013
--- /dev/null
+++ b/config/libc/musl.in.2
@@ -0,0 +1,38 @@
+# musl second-part option
+
+choice
+ prompt "How to optimize musl-libc"
+ default LIBC_MUSL_OPTIMIZE_AUTO
+
+config LIBC_MUSL_OPTIMIZE_NONE
+ bool
+ prompt "Do not optimize musl-libc"
+ help
+ This option sets `--enable-optimize=no' to disable optimization.
+
+config LIBC_MUSL_OPTIMIZE_AUTO
+ bool
+ prompt "Use musl-libc's automatic optimization"
+ help
+ This option sets `--enable-optimize=auto' to automatically set optimization.
+
+config LIBC_MUSL_OPTIMIZE_SPEED
+ bool
+ prompt "Optimize musl-libc for speed"
+ help
+ This option sets `--enable-optimize=yes' to set optimization to -O3 for speed.
+
+config LIBC_MUSL_OPTIMIZE_SIZE
+ bool
+ prompt "Optimize musl-libc for size"
+ help
+ This option sets `--enable-optimize=size' to set optimization to -Os for size.
+
+endchoice
+
+config LIBC_MUSL_OPTIMIZE
+ string
+ default "no" if LIBC_MUSL_OPTIMIZE_NONE
+ default "auto" if LIBC_MUSL_OPTIMIZE_AUTO
+ default "yes" if LIBC_MUSL_OPTIMIZE_SPEED
+ default "size" if LIBC_MUSL_OPTIMIZE_SIZE
diff --git a/scripts/build/libc/musl.sh b/scripts/build/libc/musl.sh
index f997d25..d1aadfa 100644
--- a/scripts/build/libc/musl.sh
+++ b/scripts/build/libc/musl.sh
@@ -37,6 +37,7 @@ do_libc_check_config() {
do_libc_configure() {
CT_DoLog EXTRA "Configuring C library"
local -a extra_cflags
+ local -a extra_config
# From buildroot:
# gcc constant folding bug with weak aliases workaround
@@ -45,6 +46,8 @@ do_libc_configure() {
extra_cflags+=("-fno-toplevel-reorder")
fi
+ extra_config+=( "--enable-optimize=${CT_LIBC_MUSL_OPTIMIZE}" )
+
# NOTE: musl handles the build/host/target a little bit differently
# then one would expect:
# build : not used
@@ -57,7 +60,8 @@ do_libc_configure() {
--host="${CT_TARGET}" \
--target="${CT_TARGET}" \
--prefix="/usr" \
- --disable-gcc-wrapper
+ --disable-gcc-wrapper \
+ "${extra_config[@]}"
}
do_libc_start_files() {
--
2.1.0
--
For unsubscribe information see http://sourceware.org/lists.html#faq
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 5/5] config/gcc: Disable CC_GCC_LIBSANITIZER for musl-libc
2014-09-05 6:34 [PATCH v3 0/5] Add musl-libc options Bryan Hundven
2014-09-05 6:34 ` [PATCH 1/5] libc/musl: Remove gcc core pass-1 from musl-libc build Bryan Hundven
@ 2014-09-05 6:34 ` Bryan Hundven
2014-09-05 6:34 ` [PATCH 2/5] libc/musl: Add options for optimization Bryan Hundven
` (3 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Bryan Hundven @ 2014-09-05 6:34 UTC (permalink / raw)
To: Yann E. MORIN; +Cc: crossgcc, Bryan Hundven
Disable libsanitizer for musl-libc.
Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
---
config/cc/gcc.in.2 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config/cc/gcc.in.2 b/config/cc/gcc.in.2
index 1b9515c..b088515 100644
--- a/config/cc/gcc.in.2
+++ b/config/cc/gcc.in.2
@@ -148,7 +148,7 @@ config CC_GCC_LIBSANITIZER
prompt "Compile libsanitizer"
depends on CC_GCC_HAS_LIBSANITIZER
depends on THREADS_NATIVE
- depends on ! LIBC_uClibc # Currently lacks required headers (like netrom.h)
+ depends on ! LIBC_uClibc && ! LIBC_musl # Currently lacks required headers (like netrom.h)
help
libsanitizer is a library which provides run-time sanitising of either
or both of:
--
2.1.0
--
For unsubscribe information see http://sourceware.org/lists.html#faq
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 3/5] libc/musl: Add config option for debugging info
2014-09-05 6:34 [PATCH v3 0/5] Add musl-libc options Bryan Hundven
` (2 preceding siblings ...)
2014-09-05 6:34 ` [PATCH 2/5] libc/musl: Add options for optimization Bryan Hundven
@ 2014-09-05 6:34 ` Bryan Hundven
2014-09-05 6:34 ` [PATCH 4/5] libc/musl: Add config option for extra developer warnings Bryan Hundven
2014-09-11 21:28 ` [PATCH v3 0/5] Add musl-libc options Yann E. MORIN
5 siblings, 0 replies; 8+ messages in thread
From: Bryan Hundven @ 2014-09-05 6:34 UTC (permalink / raw)
To: Yann E. MORIN; +Cc: crossgcc, Bryan Hundven
This option enables a configuration knob for adding debugging info.
Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
---
config/libc/musl.in.2 | 7 +++++++
scripts/build/libc/musl.sh | 4 ++++
2 files changed, 11 insertions(+)
diff --git a/config/libc/musl.in.2 b/config/libc/musl.in.2
index 32e9013..5c265c8 100644
--- a/config/libc/musl.in.2
+++ b/config/libc/musl.in.2
@@ -1,5 +1,12 @@
# musl second-part option
+config LIBC_MUSL_DEBUG
+ bool
+ prompt "Build with debugging information"
+ help
+ This option enables debugging information, this will increase the size of
+ the resulting library.
+
choice
prompt "How to optimize musl-libc"
default LIBC_MUSL_OPTIMIZE_AUTO
diff --git a/scripts/build/libc/musl.sh b/scripts/build/libc/musl.sh
index d1aadfa..2690bf2 100644
--- a/scripts/build/libc/musl.sh
+++ b/scripts/build/libc/musl.sh
@@ -46,6 +46,10 @@ do_libc_configure() {
extra_cflags+=("-fno-toplevel-reorder")
fi
+ if [ "${CT_LIBC_MUSL_DEBUG}" = "y" ]; then
+ extra_config+=("--enable-debug")
+ fi
+
extra_config+=( "--enable-optimize=${CT_LIBC_MUSL_OPTIMIZE}" )
# NOTE: musl handles the build/host/target a little bit differently
--
2.1.0
--
For unsubscribe information see http://sourceware.org/lists.html#faq
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/5] libc/musl: Remove gcc core pass-1 from musl-libc build
2014-09-05 6:34 ` [PATCH 1/5] libc/musl: Remove gcc core pass-1 from musl-libc build Bryan Hundven
@ 2014-09-05 7:01 ` Bryan Hundven
0 siblings, 0 replies; 8+ messages in thread
From: Bryan Hundven @ 2014-09-05 7:01 UTC (permalink / raw)
To: Yann E. MORIN; +Cc: crossgcc maillist, Bryan Hundven
Yann, List,
On Thu, Sep 4, 2014 at 11:33 PM, Bryan Hundven <bryanhundven@gmail.com> wrote:
> In an effort to make the toolchain build simpler, remove the need for
> the pass-1 build of gcc.
>
> Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
> ---
> config/libc/musl.in | 2 +-
> scripts/build/libc/musl.sh | 9 +--------
> 2 files changed, 2 insertions(+), 9 deletions(-)
>
> diff --git a/config/libc/musl.in b/config/libc/musl.in
> index b3bec26..8f393b2 100644
> --- a/config/libc/musl.in
> +++ b/config/libc/musl.in
> @@ -3,7 +3,7 @@
> ## depends on ! WINDOWS && ! BARE_METAL
> ##
> ## select LIBC_SUPPORT_THREADS_NATIVE
> -## select CC_CORE_PASSES_NEEDED
> +## select CC_CORE_PASS_2_NEEDED
> ##
> ## help Musl is a new standard library to power a new generation of Linux-based
> ## help devices. musl is lightweight, fast, simple, free, and strives to be
> diff --git a/scripts/build/libc/musl.sh b/scripts/build/libc/musl.sh
> index 7172cf2..f997d25 100644
> --- a/scripts/build/libc/musl.sh
> +++ b/scripts/build/libc/musl.sh
> @@ -48,7 +48,7 @@ do_libc_configure() {
> # NOTE: musl handles the build/host/target a little bit differently
> # then one would expect:
> # build : not used
> - # host : the machine building musl
> + # host : the machine musl runs on
> # target : the machine musl runs on
> CT_DoExecLog CFG \
> CFLAGS="${extra_cflags[@]}" \
> @@ -73,13 +73,6 @@ do_libc_start_files() {
>
> CT_DoLog EXTRA "Installing headers"
> CT_DoExecLog ALL make DESTDIR="${CT_SYSROOT_DIR}" install-headers
> -
> - CT_DoExecLog ALL make DESTDIR="${CT_SYSROOT_DIR}" \
> - crt/crt1.o crt/crti.o crt/crtn.o
> - CT_DoExecLog ALL cp -av crt/crt*.o "${CT_SYSROOT_DIR}/usr/lib"
> - CT_DoExecLog ALL ${CT_TARGET}-gcc -nostdlib \
> - -nostartfiles -shared -x c /dev/null -o "${CT_SYSROOT_DIR}/usr/lib/libc.so"
> - CT_EndStep
> }
>
> do_libc() {
> --
> 2.1.0
>
This patch still has issues.
===========================================
x86_64test/.build/x86_64-unknown-linux-musl/build/build-libc-headers/tools/install.sh'
[ALL ] '/home/bryan/build/tcwork/x86_64test/.build/src/musl-1.1.4/tools/mkalltypes.sed'
-> '/home/bryan/build/tcwork/x86_64test/.build/x86_64-unknown-linux-musl/build/build-libc-headers/tools/mkalltypes.sed'
[ALL ] '/home/bryan/build/tcwork/x86_64test/.build/src/musl-1.1.4/tools/musl-gcc.specs.sh'
-> '/home/bryan/build/tcwork/x86_64test/.build/x86_64-unknown-linux-musl/build/build-libc-headers/tools/musl-gcc.specs.sh'
[ALL ] '/home/bryan/build/tcwork/x86_64test/.build/src/musl-1.1.4/tools/version.sh'
-> '/home/bryan/build/tcwork/x86_64test/.build/x86_64-unknown-linux-musl/build/build-libc-headers/tools/version.sh'
[EXTRA] Configuring C library
[DEBUG] ==> Executing: 'CFLAGS=-fno-toplevel-reorder'
'CROSS_COMPILE=x86_64-unknown-linux-musl-' './configure'
'--host=x86_64-unknown-linux-musl'
'--target=x86_64-unknown-linux-musl' '--prefix=/usr'
'--disable-gcc-wrapper' '--enable-optimize=auto'
[CFG ] checking for C compiler...
[CFG ] ./configure: cannot find a C compiler
[ERROR]
[ERROR] >>
[ERROR] >> Build failed in step 'Installing C library headers'
[ERROR] >> called in step '(top-level)'
[ERROR] >>
[ERROR] >> Error happened in: CT_DoExecLog[scripts/functions@257]
[ERROR] >> called from: do_libc_configure[scripts/build/libc/musl.sh@64]
[ERROR] >> called from:
do_libc_start_files[scripts/build/libc/musl.sh@84]
[ERROR] >> called from: main[scripts/crosstool-NG.sh@638]
[ERROR] >>
[ERROR] >> For more info on this error, look at the file: 'build.log'
[ERROR] >> There is a list of known issues, some with workarounds, in:
[ERROR] >>
'/home/bryan/ctng/share/doc/crosstool-ng/ct-ng.git+fdbd74b/B - Known
issues.txt'
[ERROR]
[ERROR] (elapsed: 4:12.20)
===========================================
I believe the issue has to do with setting CROSS_COMPILE during the
`make install-headers' step, as the cross compiler doesn't exist yet.
-Bryan
--
For unsubscribe information see http://sourceware.org/lists.html#faq
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3 0/5] Add musl-libc options
2014-09-05 6:34 [PATCH v3 0/5] Add musl-libc options Bryan Hundven
` (4 preceding siblings ...)
2014-09-05 6:34 ` [PATCH 4/5] libc/musl: Add config option for extra developer warnings Bryan Hundven
@ 2014-09-11 21:28 ` Yann E. MORIN
5 siblings, 0 replies; 8+ messages in thread
From: Yann E. MORIN @ 2014-09-11 21:28 UTC (permalink / raw)
To: Bryan Hundven; +Cc: crossgcc
Bryan, All,
On 2014-09-04 23:33 -0700, Bryan Hundven spake thusly:
> Many typos and fixes to suggestions made by y_morin and sh4rm4 in
> #crosstool-ng, here is v3. Enjoy!
Patchs 2 to 5 applied; patch 1 left out since you said you still had
issues with it.
Thanks!
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
--
For unsubscribe information see http://sourceware.org/lists.html#faq
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2014-09-11 21:28 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-05 6:34 [PATCH v3 0/5] Add musl-libc options Bryan Hundven
2014-09-05 6:34 ` [PATCH 1/5] libc/musl: Remove gcc core pass-1 from musl-libc build Bryan Hundven
2014-09-05 7:01 ` Bryan Hundven
2014-09-05 6:34 ` [PATCH 5/5] config/gcc: Disable CC_GCC_LIBSANITIZER for musl-libc Bryan Hundven
2014-09-05 6:34 ` [PATCH 2/5] libc/musl: Add options for optimization Bryan Hundven
2014-09-05 6:34 ` [PATCH 3/5] libc/musl: Add config option for debugging info Bryan Hundven
2014-09-05 6:34 ` [PATCH 4/5] libc/musl: Add config option for extra developer warnings Bryan Hundven
2014-09-11 21:28 ` [PATCH v3 0/5] Add musl-libc options Yann E. MORIN
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).