coarray_43.f90: Add "-latomic" option if libatomic_available.
[gcc.git] / libatomic / configure.tgt
index 49233a4f45ae5314d514266b9600539f404af61d..6d77c9482a5120e929870be5b4715696e1d22fab 100644 (file)
@@ -1,5 +1,5 @@
 # -*- shell-script -*-
-#  Copyright (C) 2012-2016 Free Software Foundation, Inc.
+#  Copyright (C) 2012-2017 Free Software Foundation, Inc.
 #  Contributed by Richard Henderson <rth@redhat.com>.
 #
 #  This file is part of the GNU Atomic Library (libatomic).
 # Map the target cpu to an ARCH sub-directory.  At the same time,
 # work out any special compilation flags as necessary.
 
+# Give operating systems the opportunity to discard XCFLAGS modifications based
+# on ${target_cpu}.  For example to allow proper use of multilibs.
+configure_tgt_pre_target_cpu_XCFLAGS="${XCFLAGS}"
+
 case "${target_cpu}" in
   alpha*)
        # fenv.c needs this option to generate inexact exceptions.
@@ -81,8 +85,14 @@ case "${target_cpu}" in
        try_ifunc=yes
        ;;
   x86_64)
-       # x86_64 compiler passes -march=x86_64 by default when building
-       # 32bit target libraries.
+       case " ${CC} ${CFLAGS} " in
+         *" -m32 "*)
+           XCFLAGS="${XCFLAGS} -march=i486 -mtune=generic"
+           XCFLAGS="${XCFLAGS} -fomit-frame-pointer"
+           ;;
+         *)
+           ;;
+       esac
        ARCH=x86
        # ??? Detect when -mcx16 is already enabled.
        try_ifunc=yes
@@ -122,6 +132,12 @@ case "${target}" in
             ;;
         esac
        ;;
+
+  *-*-rtems*)
+       XCFLAGS="${configure_tgt_pre_target_cpu_XCFLAGS}"
+       config_path="rtems"
+       ;;
+
   *-*-elf*)
        # ??? No target OS.  We could be targeting bare-metal kernel-mode,
        # or user-mode for some custom OS.  If the target supports TAS,