[NDS32] Set default --with-nds32-lib correctly.
authorChung-Ju Wu <jasonwucj@gmail.com>
Sun, 10 Feb 2019 12:27:01 +0000 (12:27 +0000)
committerChung-Ju Wu <jasonwucj@gcc.gnu.org>
Sun, 10 Feb 2019 12:27:01 +0000 (12:27 +0000)
gcc/
* config.gcc (with_nds32_lib): Set default --with-nds32-lib correctly.

From-SVN: r268744

gcc/ChangeLog
gcc/config.gcc

index b324f15ee933cdb0b51fdc1aa096884da07204c7..aea089f1da2f9c9c93e2e90b949e3d7e45cc8e11 100644 (file)
@@ -1,3 +1,7 @@
+2019-02-10  Chung-Ju Wu  <jasonwucj@gmail.com>
+
+       * config.gcc (with_nds32_lib): Set default --with-nds32-lib correctly.
+
 2019-02-10  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/89268
index 7675d929da6792635a4e0f456ee536a5d2f9b8e8..31b47c51b7bc6c1925238b34016b8c4b364b2b3f 100644 (file)
@@ -4523,9 +4523,18 @@ case "${target}" in
                # process --with-nds32-lib
                case "${with_nds32_lib}" in
                "")
-                       # the default library is newlib
-                       with_nds32_lib=newlib
-                       tm_defines="${tm_defines} TARGET_DEFAULT_CTOR_DTOR=1"
+                       case ${target} in
+                       *-*-*uclibc*)
+                               with_nds32_lib=ulibc
+                               ;;
+                       *-*-linux*)
+                               with_nds32_lib=glibc
+                               ;;
+                       *)
+                               with_nds32_lib=newlib
+                               tm_defines="${tm_defines} TARGET_DEFAULT_CTOR_DTOR=1"
+                               ;;
+                       esac
                        ;;
                newlib)
                        # OK
@@ -4541,11 +4550,8 @@ case "${target}" in
                                ;;
                        esac
                        ;;
-               glibc)
+               glibc | uclibc)
                        # OK
-                       tm_defines="${tm_defines}"
-                       ;;
-               uclibc)
                        ;;
                *)
                        echo "Cannot accept --with-nds32-lib=$with_nds32_lib, available values are: newlib mculib glibc uclibc" 1>&2