diff options
-rw-r--r-- | config/cc.in | 28 | ||||
-rw-r--r-- | scripts/build/cc/gcc.sh | 26 |
2 files changed, 40 insertions, 14 deletions
diff --git a/config/cc.in b/config/cc.in index 068d445a..17264da3 100644 --- a/config/cc.in +++ b/config/cc.in @@ -67,18 +67,6 @@ config CC_LANG_JIT Only select this if you know that your specific version of the compiler supports the libgccjit. -if ! BARE_METAL - -config CC_LANG_JAVA - bool - prompt "Java" - depends on CC_SUPPORT_JAVA - help - Enable building a Java compiler. - - Only select this if you know that your specific version of the - compiler supports this language. - config CC_LANG_ADA bool prompt "Ada (EXPERIMENTAL)" @@ -88,7 +76,8 @@ config CC_LANG_ADA Enable building an Ada compiler. Only select this if you know that your specific version of the - compiler supports this language. + compiler supports this language. If the target is bare, the runtime + won't be included. config CC_LANG_D bool @@ -99,6 +88,19 @@ config CC_LANG_D Enable building a D compiler. Only select this if you know that your specific version of the + compiler supports this language. If the target is bare, the runtime + won't be included. + +if ! BARE_METAL + +config CC_LANG_JAVA + bool + prompt "Java" + depends on CC_SUPPORT_JAVA + help + Enable building a Java compiler. + + Only select this if you know that your specific version of the compiler supports this language. config CC_LANG_OBJC diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh index 275e239c..afcbeb2b 100644 --- a/scripts/build/cc/gcc.sh +++ b/scripts/build/cc/gcc.sh @@ -43,7 +43,7 @@ cc_gcc_lang_list() { [ "${CT_CC_LANG_CXX}" = "y" ] && lang_list+=",c++" [ "${CT_CC_LANG_FORTRAN}" = "y" ] && lang_list+=",fortran" [ "${CT_CC_LANG_ADA}" = "y" ] && lang_list+=",ada" - [ "${CT_CC_LANG_D}" = "y" ] && lang_list+=",d" + [ "${CT_CC_LANG_D}" = "y" ] && lang_list+=",d" [ "${CT_CC_LANG_JAVA}" = "y" ] && lang_list+=",java" [ "${CT_CC_LANG_JIT}" = "y" ] && lang_list+=",jit" [ "${CT_CC_LANG_OBJC}" = "y" ] && lang_list+=",objc" @@ -528,6 +528,22 @@ do_gcc_core_backend() { "") extra_config+=("--disable-tls");; esac + # In baremetal, we only build the Ada compiler without its runtime. + # The runtime will need to be provided externaly by the user. + if [ "${mode}" = "baremetal" \ + -a "${CT_CC_LANG_ADA}" = "y" \ + ]; then + extra_config+=("--disable-libada" ) + fi + + # In baremetal, we only build the D compiler without its runtime. + # The runtime will need to be provided externaly by the user. + if [ "${mode}" = "baremetal" \ + -a "${CT_CC_LANG_D}" = "y" \ + ]; then + extra_config+=("--disable-libphobos" ) + fi + # Some versions of gcc have a defective --enable-multilib. # Since that's the default, only pass --disable-multilib. For multilib, # also enable multiarch. Without explicit --enable-multiarch, core @@ -710,6 +726,14 @@ do_gcc_core_backend() { CT_DoLog EXTRA "Building ${log_txt}" CT_DoExecLog ALL make ${CT_JOBSFLAGS} ${core_targets_all} + # In case of baremetal, the gnat* tools are not built automatically. + if [ "${mode}" = "baremetal" \ + -a "${CT_CC_LANG_ADA}" = "y" \ + ]; then + CT_DoLog EXTRA "Building gnattools for baremetal" + CT_DoExecLog ALL make -C gcc ${CT_JOBSFLAGS} cross-gnattools + fi + # Do not pass ${CT_JOBSFLAGS} here: recent GCC builds have been failing # in parallel 'make install' at random locations: libitm, libcilk, # always for the files that are installed more than once to the same |