aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2024-02-21 10:42:04 +0000
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2024-02-21 10:43:01 +0000
commit2d6378dd38d9bdd693b70ba0f49b31f39f086fa6 (patch)
tree481152c02ed072bdc23e3e0b9da618d3f8c0a479
parentbc8ed3d22ed2b7ea2804bab8e6399a2f03d25b14 (diff)
Add FIXMEs for aarch64-w64-mingw32
Change-Id: I880b743bef731d569386a896f4381ee50170bbd9
-rw-r--r--config/gcc.conf32
-rw-r--r--lib/make.sh47
2 files changed, 56 insertions, 23 deletions
diff --git a/config/gcc.conf b/config/gcc.conf
index a16916d5..02658a58 100644
--- a/config/gcc.conf
+++ b/config/gcc.conf
@@ -76,6 +76,15 @@ fi
# Enable errata support
aarch64_errata="--enable-fix-cortex-a53-835769 --enable-fix-cortex-a53-843419"
case ${target} in
+ aarch64*-mingw32)
+ # FIXME: with fix-cortex-a53-843419 enabled, aarch64-w64-mingw32's
+ # libatomic's configure fails with
+ # "ld: -f may not be used without -shared"
+ # due to "-Wl,-fix-cortex-a53-843419" option.
+ # Disabling cortex-a53 errata should be harmless for mingw, since
+ # the target is much younger than the affected chips.
+ true
+ ;;
aarch64*)
default_configure_flags="${default_configure_flags} ${aarch64_errata}"
;;
@@ -188,11 +197,24 @@ stage2_flags=""
# compiler with many features disabled, then a full-featured stage2
# compiler.
if test x"${build}" != x"${target}"; then
- # stage1_flags are used to build the initial C compiler, which is
- # used to compile the C library. We disable most everything, as the
- # second GCC build will be able to use the C library built with the
- # first GCC build.
- stage1_flags="$stage1_flags --disable-libssp --disable-libquadmath --disable-threads --without-headers --with-newlib --disable-libmudflap --disable-decimal-float --disable-libgomp --disable-libatomic --disable-libsanitizer --disable-plugins --disable-libitm --enable-languages=c,c++ --disable-libstdcxx --disable-libvtv --disable-shared"
+ # stage1_flags are used to build the initial C compiler, which is
+ # used to compile the C library. We disable most everything, as the
+ # second GCC build will be able to use the C library built with the
+ # first GCC build.
+ stage1_flags="$stage1_flags --disable-libssp --disable-libquadmath --disable-threads --without-headers --with-newlib --disable-libmudflap --disable-decimal-float --disable-libgomp --disable-libatomic --disable-libsanitizer --disable-plugins --disable-libitm --disable-libvtv --disable-shared"
+
+ case "$target" in
+ aarch64*-mingw32)
+ # FIXME: aarch64-w64-mingw32 can't build C++ yet.
+ stage1_flags="$stage1_flags --enable-languages=c"
+ ;;
+ *)
+ # Glibc needs C++ compiler to configure ...
+ stage1_flags="$stage1_flags --enable-languages=c,c++"
+ # ... but we can't build libstdc++ yet.
+ stage1_flags="$stage1_flags --disable-libstdcxx"
+ ;;
+ esac
case ${clibrary} in
glibc|eglibc)
diff --git a/lib/make.sh b/lib/make.sh
index cdfa96ee..54a18dce 100644
--- a/lib/make.sh
+++ b/lib/make.sh
@@ -410,24 +410,33 @@ make_all()
make_flags="${make_flags} LDFLAGS=\"-Wl,--fix-cortex-a53-843419\" "
fi
- if test "$(echo ${target} | grep -c aarch64)" -gt 0; then
- local ldflags_for_target="-Wl,-fix-cortex-a53-843419"
- # As discussed in
- # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66203
- # aarch64*-none-elf toolchains using newlib need the
- # --specs=rdimon.specs option otherwise link fails because
- # _exit etc... cannot be resolved. See commit message for
- # details.
- if test "$(echo ${target} | grep -c elf)" -gt 0; then
+ case "$target" in
+ aarch64*-mingw32)
+ # FIXME: See comment about fix-cortex-a53-843419 in config/gcc.conf.
+ true
+ ;;
+ aarch64*)
+ local ldflags_for_target="-Wl,-fix-cortex-a53-843419"
+ # As discussed in
+ # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66203
+ # aarch64*-none-elf toolchains using newlib need the
+ # --specs=rdimon.specs option otherwise link fails because
+ # _exit etc... cannot be resolved. See commit message for
+ # details.
+ case "$target" in
+ aarch64*-elf)
+ ldflags_for_target="${ldflags_for_target} --specs=rdimon.specs"
+ ;;
+ esac
+ make_flags="${make_flags} LDFLAGS_FOR_TARGET=\"${ldflags_for_target}\" "
+ ;;
+ arm*-eabi)
+ # The same applies to arm*-eabi, since we configure newlib
+ # with --disable-newlib-supplied-syscalls.
ldflags_for_target="${ldflags_for_target} --specs=rdimon.specs"
- fi
- make_flags="${make_flags} LDFLAGS_FOR_TARGET=\"${ldflags_for_target}\" "
- elif test "$(echo ${target} | grep -c -e 'arm.*-eabi')" -gt 0; then
- # The same applies to arm*-eabi, since we configure newlib
- # with --disable-newlib-supplied-syscalls.
- ldflags_for_target="${ldflags_for_target} --specs=rdimon.specs"
- make_flags="${make_flags} LDFLAGS_FOR_TARGET=\"${ldflags_for_target}\" "
- fi
+ make_flags="${make_flags} LDFLAGS_FOR_TARGET=\"${ldflags_for_target}\" "
+ ;;
+ esac
# Use pipes instead of /tmp for temporary files.
if test x"${override_cflags}" != x -a x"${component}" != x"eglibc"; then
@@ -1805,10 +1814,12 @@ EOF
newlib/arm*/aprofile)
extra_cflags="-mcpu=cortex-a8"
;;
- newlib/aarch64*)
+ newlib/aarch64*-elf)
extra_cflags="--specs=rdimon.specs"
;;
newlib/*)
+ # FIXME: Enable hello-world test for aarch64-w64-mingw32 once
+ # it supports C++.
notice "Hello world test not supported for newlib on ${target}"
return 0
;;