diff mbox

[1/5] libc/musl: Remove gcc core pass-1 from musl-libc build

Message ID 1409898843-14901-2-git-send-email-bryanhundven@gmail.com
State Deferred
Headers show

Commit Message

Bryan Hundven Sept. 5, 2014, 6:33 a.m. UTC
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(-)

Comments

Bryan Hundven Sept. 5, 2014, 7:01 a.m. UTC | #1
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
diff mbox

Patch

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() {