From: Ray Donnelly <mingw.android@gmail.com>
To: "crossgcc@sourceware.org" <crossgcc@sourceware.org>
Subject: [PATCH 2/3] GCC: Copy minimal sysroot instead of just headers
Date: Tue, 04 Feb 2014 08:34:00 -0000 [thread overview]
Message-ID: <CAOYw7duVmnyBS0rFXuk25kONeboS89sMMCJUgV3b+YFVF_cDKg@mail.gmail.com> (raw)
# HG changeset patch
# User Ray Donnelly <mingw.android@gmail.com>
# Date 1391500511 0
# Tue Feb 04 07:55:11 2014 +0000
# Node ID 45760158aca33981b5bb882191043bd708b57dbb
# Parent 2eab7ceda925402555d7d3107e5828734ac74c11
GCC: Copy minimal sysroot instead of just headers
Before starting the build of the 2nd stage GCC,
as well as copying the headers, it is necessary
to also copy the start libraries and stub libc.
copy_headers is renamed to copy_minimal_sysroot
and find is used to copy ${CT_SYSROOT_DIR}/lib*
and ${CT_SYSROOT_DIR}/include otherwise linking
libgcc_s.so fails since GCC "cannot find -lc".
Signed-off-by: Ray Donnelly <mingw.android@gmail.com>
diff -r 2eab7ceda925 -r 45760158aca3 scripts/build/cc/gcc.sh
--- a/scripts/build/cc/gcc.sh Tue Feb 04 07:40:45 2014 +0000
+++ b/scripts/build/cc/gcc.sh Tue Feb 04 07:55:11 2014 +0000
@@ -189,6 +189,7 @@
local -a core_LDFLAGS
local -a core_targets
local arg
+ local sysroot_dirs
for arg in "$@"; do
eval "${arg// /\\ }"
@@ -201,18 +202,18 @@
extra_config+=("--with-newlib")
extra_config+=("--enable-threads=no")
extra_config+=("--disable-shared")
- copy_headers=y # For baremetal, as there's no headers to copy,
- # we copy an empty directory. So, who cares?
+ copy_minimal_sysroot=y # For baremetal, as there's no
minimal sysroot to copy,
+ # we copy some empty directories.
So, who cares?
;;
shared)
extra_config+=("--enable-shared")
- copy_headers=y
+ copy_minimal_sysroot=y
;;
baremetal)
extra_config+=("--with-newlib")
extra_config+=("--enable-threads=no")
extra_config+=("--disable-shared")
- copy_headers=n
+ copy_minimal_sysroot=n
;;
*)
CT_Abort "Internal Error: 'mode' must be one of:
'static', 'shared' or 'baremetal', not '${mode:-(empty)}'"
@@ -225,9 +226,14 @@
[ -n "${CT_TOOLCHAIN_BUGURL}" ] &&
extra_config+=("--with-bugurl=${CT_TOOLCHAIN_BUGURL}")
fi
- if [ "${copy_headers}" = "y" ]; then
- CT_DoLog DEBUG "Copying headers to install area of bootstrap
gcc, so it can build libgcc2"
- CT_DoExecLog ALL cp -a "${CT_HEADERS_DIR}"
"${prefix}/${CT_TARGET}/include"
+ if [ "${copy_minimal_sysroot}" = "y" ]; then
+ CT_DoLog DEBUG "Copying headers and libs to install area of
bootstrap gcc, so it can build libgcc2"
+ CT_Pushd "${CT_HEADERS_DIR}/.."
+ sysroot_dirs=$(find . -mindepth 1 -maxdepth 1 -type d \(
-name "lib*" -or -name "include" \) -exec basename {} \;)
+ for sysroot_dir in $sysroot_dirs; do
+ CT_DoExecLog ALL cp -a "${sysroot_dir}"
"${prefix}/${CT_TARGET}/${sysroot_dir}"
+ done
+ CT_Popd
fi
for tmp in ARCH ABI CPU TUNE FPU FLOAT; do
--
For unsubscribe information see http://sourceware.org/lists.html#faq
next reply other threads:[~2014-02-04 8:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-04 8:34 Ray Donnelly [this message]
2014-02-04 8:43 Ray Donnelly
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAOYw7duVmnyBS0rFXuk25kONeboS89sMMCJUgV3b+YFVF_cDKg@mail.gmail.com \
--to=mingw.android@gmail.com \
--cc=crossgcc@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).