mirror of
https://github.com/crosstool-ng/crosstool-ng.git
synced 2025-04-18 00:06:04 +00:00
cc/gcc: add 'cflags' paramater to the core backend
As the core backend is used to generate the bare-metal compiler, we need to pass it the host CFLAGS. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
This commit is contained in:
parent
6a29db1593
commit
35f50ca6c2
@ -70,6 +70,7 @@ do_cc_core_pass_1() {
|
||||
core_opts+=( "host=${CT_HOST}" )
|
||||
core_opts+=( "complibs=${CT_COMPLIBS_DIR}" )
|
||||
core_opts+=( "prefix=${CT_CC_CORE_STATIC_PREFIX_DIR}" )
|
||||
core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
|
||||
;;
|
||||
,y,*)
|
||||
;;
|
||||
@ -79,6 +80,7 @@ do_cc_core_pass_1() {
|
||||
core_opts+=( "host=${CT_HOST}" )
|
||||
core_opts+=( "complibs=${CT_COMPLIBS_DIR}" )
|
||||
core_opts+=( "prefix=${CT_CC_CORE_STATIC_PREFIX_DIR}" )
|
||||
core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
@ -109,6 +111,7 @@ do_cc_core_pass_2() {
|
||||
core_opts+=( "build_libstdcxx=yes" )
|
||||
core_opts+=( "complibs=${CT_COMPLIBS_DIR}" )
|
||||
core_opts+=( "prefix=${CT_PREFIX_DIR}" )
|
||||
core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
|
||||
if [ "${CT_STATIC_TOOLCHAIN}" = "y" ]; then
|
||||
core_opts+=( "build_staticlinked=yes" )
|
||||
fi
|
||||
@ -122,6 +125,7 @@ do_cc_core_pass_2() {
|
||||
core_opts+=( "build_libgcc=yes" )
|
||||
core_opts+=( "complibs=${CT_COMPLIBS_DIR}" )
|
||||
core_opts+=( "prefix=${CT_CC_CORE_SHARED_PREFIX_DIR}" )
|
||||
core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
|
||||
;;
|
||||
,,win32)
|
||||
do_core=y
|
||||
@ -130,6 +134,7 @@ do_cc_core_pass_2() {
|
||||
core_opts+=( "build_libgcc=yes" )
|
||||
core_opts+=( "complibs=${CT_COMPLIBS_DIR}" )
|
||||
core_opts+=( "prefix=${CT_CC_CORE_STATIC_PREFIX_DIR}" )
|
||||
core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
|
||||
;;
|
||||
*)
|
||||
do_core=y
|
||||
@ -137,6 +142,7 @@ do_cc_core_pass_2() {
|
||||
core_opts+=( "host=${CT_HOST}" )
|
||||
core_opts+=( "complibs=${CT_COMPLIBS_DIR}" )
|
||||
core_opts+=( "prefix=${CT_CC_CORE_STATIC_PREFIX_DIR}" )
|
||||
core_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
|
||||
if [ "${CT_CC_GCC_4_3_or_later}" = "y" ]; then
|
||||
core_opts+=( "build_libgcc=yes" )
|
||||
fi
|
||||
@ -159,6 +165,7 @@ do_cc_core_pass_2() {
|
||||
# - where to find the companion libs (prefix) : complibs=<prefix_dir> (no default value)
|
||||
# - the prefix to install into (directory) : prefix=<directory> (no default value)
|
||||
# - the machine we will run on (tuple) : host=<tuple> (no default tuple)
|
||||
# - the CFLAGS to use : cflags=<CFLAGS> (empty)
|
||||
# Usage: do_cc_core_backend mode=[static|shared|baremetal] build_libgcc=[yes|no] build_staticlinked=[yes|no]
|
||||
do_cc_core_backend() {
|
||||
local mode
|
||||
@ -170,6 +177,7 @@ do_cc_core_backend() {
|
||||
local prefix
|
||||
local complibs
|
||||
local lang_opt
|
||||
local cflags
|
||||
local tmp
|
||||
local -a host_libstdcxx_flags
|
||||
local -a extra_config
|
||||
@ -358,7 +366,7 @@ do_cc_core_backend() {
|
||||
# Use --with-local-prefix so older gccs don't look in /usr/local (http://gcc.gnu.org/PR10532)
|
||||
CT_DoExecLog CFG \
|
||||
CC_FOR_BUILD="${CT_BUILD}-gcc" \
|
||||
CFLAGS="${CT_CFLAGS_FOR_HOST}" \
|
||||
CFLAGS="${cflags}" \
|
||||
LDFLAGS="${core_LDFLAGS[*]}" \
|
||||
"${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/configure" \
|
||||
--build=${CT_BUILD} \
|
||||
|
Loading…
x
Reference in New Issue
Block a user