annotate config/picflag.m4 @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 # _GCC_PICFLAG(FLAG, DISPATCH)
kono
parents:
diff changeset
2 # ----------------------------
kono
parents:
diff changeset
3 # Store PIC flag corresponding to DISPATCH triplet in FLAG.
kono
parents:
diff changeset
4 # Explit use of -fpic in CFLAGS corresponding to FLAG overrides default.
kono
parents:
diff changeset
5 AC_DEFUN([_GCC_PICFLAG], [
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 case "${$2}" in
kono
parents:
diff changeset
8 # PIC is the default on some targets or must not be used.
kono
parents:
diff changeset
9 *-*-darwin*)
kono
parents:
diff changeset
10 # For darwin, common symbols are not allowed in MH_DYLIB files
kono
parents:
diff changeset
11 case "${CFLAGS}" in
kono
parents:
diff changeset
12 # If we are using a compiler supporting mdynamic-no-pic
kono
parents:
diff changeset
13 # and the option has been tested as safe to add, then cancel
kono
parents:
diff changeset
14 # it here, since the code generated is incompatible with shared
kono
parents:
diff changeset
15 # libs.
kono
parents:
diff changeset
16 *-mdynamic-no-pic*) $1='-fno-common -mno-dynamic-no-pic' ;;
kono
parents:
diff changeset
17 *) $1=-fno-common ;;
kono
parents:
diff changeset
18 esac
kono
parents:
diff changeset
19 ;;
kono
parents:
diff changeset
20 alpha*-dec-osf5*)
kono
parents:
diff changeset
21 # PIC is the default.
kono
parents:
diff changeset
22 ;;
kono
parents:
diff changeset
23 hppa*64*-*-hpux*)
kono
parents:
diff changeset
24 # PIC is the default for 64-bit PA HP-UX.
kono
parents:
diff changeset
25 ;;
kono
parents:
diff changeset
26 i[[34567]]86-*-cygwin* | x86_64-*-cygwin*)
kono
parents:
diff changeset
27 ;;
kono
parents:
diff changeset
28 i[[34567]]86-*-mingw* | x86_64-*-mingw*)
kono
parents:
diff changeset
29 ;;
kono
parents:
diff changeset
30 i[[34567]]86-*-interix[[3-9]]*)
kono
parents:
diff changeset
31 # Interix 3.x gcc -fpic/-fPIC options generate broken code.
kono
parents:
diff changeset
32 # Instead, we relocate shared libraries at runtime.
kono
parents:
diff changeset
33 ;;
kono
parents:
diff changeset
34 i[[34567]]86-*-nto-qnx*)
kono
parents:
diff changeset
35 # QNX uses GNU C++, but need to define -shared option too, otherwise
kono
parents:
diff changeset
36 # it will coredump.
kono
parents:
diff changeset
37 $1='-fPIC -shared'
kono
parents:
diff changeset
38 ;;
kono
parents:
diff changeset
39 i[[34567]]86-pc-msdosdjgpp*)
kono
parents:
diff changeset
40 # DJGPP does not support shared libraries at all.
kono
parents:
diff changeset
41 ;;
kono
parents:
diff changeset
42 ia64*-*-hpux*)
kono
parents:
diff changeset
43 # On IA64 HP-UX, PIC is the default but the pic flag
kono
parents:
diff changeset
44 # sets the default TLS model and affects inlining.
kono
parents:
diff changeset
45 $1=-fPIC
kono
parents:
diff changeset
46 ;;
kono
parents:
diff changeset
47 mips-sgi-irix6*)
kono
parents:
diff changeset
48 # PIC is the default.
kono
parents:
diff changeset
49 ;;
kono
parents:
diff changeset
50 rs6000-ibm-aix* | powerpc-ibm-aix*)
kono
parents:
diff changeset
51 # All AIX code is PIC.
kono
parents:
diff changeset
52 ;;
kono
parents:
diff changeset
53
kono
parents:
diff changeset
54 # Some targets support both -fPIC and -fpic, but prefer the latter.
kono
parents:
diff changeset
55 # FIXME: Why?
kono
parents:
diff changeset
56 i[[34567]]86-*-* | x86_64-*-*)
kono
parents:
diff changeset
57 $1=-fpic
kono
parents:
diff changeset
58 ;;
kono
parents:
diff changeset
59 # FIXME: Override -fPIC default in libgcc only?
kono
parents:
diff changeset
60 sh-*-linux* | sh[[2346lbe]]*-*-linux*)
kono
parents:
diff changeset
61 $1=-fpic
kono
parents:
diff changeset
62 ;;
kono
parents:
diff changeset
63 # FIXME: Simplify to sh*-*-netbsd*?
kono
parents:
diff changeset
64 sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
kono
parents:
diff changeset
65 sh64-*-netbsd* | sh64l*-*-netbsd*)
kono
parents:
diff changeset
66 $1=-fpic
kono
parents:
diff changeset
67 ;;
kono
parents:
diff changeset
68 # Default to -fPIC unless specified otherwise.
kono
parents:
diff changeset
69 *)
kono
parents:
diff changeset
70 $1=-fPIC
kono
parents:
diff changeset
71 ;;
kono
parents:
diff changeset
72 esac
kono
parents:
diff changeset
73
kono
parents:
diff changeset
74 # If the user explicitly uses -fpic/-fPIC, keep that.
kono
parents:
diff changeset
75 case "${m4_bpatsubsts($1, PICFLAG, CFLAGS)}" in
kono
parents:
diff changeset
76 *-fpic*)
kono
parents:
diff changeset
77 $1=-fpic
kono
parents:
diff changeset
78 ;;
kono
parents:
diff changeset
79 *-fPIC*)
kono
parents:
diff changeset
80 $1=-fPIC
kono
parents:
diff changeset
81 ;;
kono
parents:
diff changeset
82 esac
kono
parents:
diff changeset
83 ])
kono
parents:
diff changeset
84
kono
parents:
diff changeset
85 # GCC_PICFLAG
kono
parents:
diff changeset
86 # -----------
kono
parents:
diff changeset
87 # Store host PIC flag in PICFLAG.
kono
parents:
diff changeset
88 AC_DEFUN([GCC_PICFLAG], [
kono
parents:
diff changeset
89 AC_REQUIRE([AC_CANONICAL_HOST])
kono
parents:
diff changeset
90 _GCC_PICFLAG([PICFLAG], [host])])
kono
parents:
diff changeset
91
kono
parents:
diff changeset
92 # GCC_PICFLAG_FOR_TARGET
kono
parents:
diff changeset
93 # ----------------------
kono
parents:
diff changeset
94 # Store target PIC flag in PICFLAG_FOR_TARGET.
kono
parents:
diff changeset
95 AC_DEFUN([GCC_PICFLAG_FOR_TARGET], [
kono
parents:
diff changeset
96 AC_REQUIRE([AC_CANONICAL_TARGET])
kono
parents:
diff changeset
97 _GCC_PICFLAG([PICFLAG_FOR_TARGET], [target])])