aboutsummaryrefslogtreecommitdiff
path: root/config/gcc.conf
blob: fb24836c5cbc364141b5ea5878489ddf19c76dac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
# This is a list of other components need to build this component
depends="gmp mpfr mpc linux binutils"

# This is a file that gets installed that is used to determine if the toolchain
# component is already installed.
installs="gcc"

# The current branch of the existing GCC release.
latest="gcc.git~linaro/gcc-5-branch"

# If yes, only static linking will be used
static_link="no"

# This is a list of default flags always supplied to configure
default_configure_flags="--with-bugurl=https://bugs.linaro.org --with-mpc=${local_builds}/destdir/${host} --with-mpfr=${local_builds}/destdir/${host} --with-gmp=${local_builds}/destdir/${host} --with-gnu-as --with-gnu-ld --disable-libstdcxx-pch --disable-libmudflap${override_arch:+ --with-arch=${override_arch}}${override_cpu:+ --with-cpu=${override_cpu}}${override_tune:+ --with-tune=${override_tune}}"

# --with-pkgversion=${USER} 
# --with-as=${local_builds}/bin/${target}-as --with-ld=${local_builds}/bin/${target}-ld 

# Disable the Graphite loop optimizer as it's being depreciated
default_configure_flags="${default_configure_flags} --with-cloog=no --with-ppl=no --with-isl=no"

# nls is used for DNS
default_configure_flags="${default_configure_flags} --disable-nls"

# C99 is the latest standard, and has improved numerics support, so we want it
# http://en.wikipedia.org/wiki/C99
default_configure_flags="${default_configure_flags} --enable-c99"

# libssp does stack protection
#default_configure_flags="${default_configure_flags} --enable-libssp"

# Used by fortran
# http://gcc.gnu.org/onlinedocs/libquadmath/
# default_configure_flags="${default_configure_flags} --disable-libquadmath"

# Transactional Memory, used for threading
# http://gcc.gnu.org/wiki/TransactionalMemory
#default_configure_flags="${default_configure_flags} --disable-libitm"

# Libatomic is a synchronization library	     
# http://www.hpl.hp.com/research/linux/atomic_ops/
#default_configure_flags="${default_configure_flags} --disable-libatomic"

if test `echo ${target} | grep -c aarch64` -eq 1 -a `echo ${gcc_version} | grep -c gcc-linaro-4\.7` -eq 1; then
   error "GCC 4.7 does not support aarch64!"
   exit 1
fi

aarch64_errata="--enable-fix-cortex-a53-835769 --enable-fix-cortex-a53-843419"

# Default set of languages to build. If building binary tarballs, we don't build all the
# front ends.
if test x"${tarbin}" != xyes; then
    languages="c,c++,fortran,lto"
else
    languages="c,c++,fortran,lto"
fi

default_makeflags="MAKEINFOFLAGS=--force"

# For a cross build, we need the target as part of the name for to find the correct.
# assembler and linker. We also disable bootstrapping for cross builds
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="--disable-libssp --disable-libquadmath --disable-threads --without-headers --with-newlib --disable-libmudflap --disable-bootstrap --disable-decimal-float --disable-libgomp --disable-libatomic --disable-libsanitizer --disable-plugins --disable-libitm MAKEINFO=echo --enable-languages=c --with-sysroot=${local_builds}/sysroot-${target} --disable-shared --with-glibc-version=2.18"

   # Add platform specific flags
    case ${target} in
	armv8l-*linux-gnueabihf)
	    if test x"${override_arch}" = x -a x"${override_cpu}" = x; then
	        default_configure_flags="${default_configure_flags} --with-arch=armv8-a"
	    fi
	    default_configure_flags="${default_configure_flags} --with-fpu=neon-fp-armv8 --with-float=hard --disable-multilib --enable-multiarch"
	    ;;
	arm-*linux-gnueabi)
	    if test x"${override_cpu}" = x -a x"${override_tune}" = x; then
	        default_configure_flags="${default_configure_flags} --with-tune=cortex-a9"
	    fi
	    if test x"${override_arch}" = x -a x"${override_cpu}" = x; then
	        default_configure_flags="${default_configure_flags} --with-arch=armv7-a"
	    fi
	    default_configure_flags="${default_configure_flags} --with-fpu=vfpv3-d16 --with-float=softfp  --with-mode=thumb --disable-multilib --enable-multiarch"
	    ;;
	arm-*linux-gnueabihf)
	    if test x"${override_cpu}" = x -a x"${override_tune}" = x; then
	        default_configure_flags="${default_configure_flags} --with-tune=cortex-a9"
	    fi
	    if test x"${override_arch}" = x -a x"${override_cpu}" = x; then
	        default_configure_flags="${default_configure_flags} --with-arch=armv7-a"
	    fi
	    default_configure_flags="${default_configure_flags} --with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb --disable-multilib --enable-multiarch"
	    ;;
	armeb-*linux-gnueabi)
	    if test x"${override_cpu}" = x -a x"${override_tune}" = x; then
	        default_configure_flags="${default_configure_flags} --with-tune=cortex-a9"
	    fi
	    if test x"${override_arch}" = x -a x"${override_cpu}" = x; then
	        default_configure_flags="${default_configure_flags} --with-arch=armv7-a"
	    fi
	    default_configure_flags="${default_configure_flags} --with-fpu=vfpv3-d16 --with-float=softfp --with-mode=thumb --disable-multilib --enable-multiarch"
	    ;;
	armeb-*linux-gnueabihf)
	    if test x"${override_cpu}" = x -a x"${override_tune}" = x; then
	        default_configure_flags="${default_configure_flags} --with-tune=cortex-a9"
	    fi
	    if test x"${override_arch}" = x -a x"${override_cpu}" = x; then
	        default_configure_flags="${default_configure_flags} --with-arch=armv7-a"
	    fi
	    default_configure_flags="${default_configure_flags} --with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb --disable-multilib --enable-multiarch"
	    ;;
	    # bare metal targets don't support threads.
	arm*-elf|arm*-eabi*)
	    default_configure_flags="${default_configure_flags} --enable-threads=no --enable-multilib --disable-multiarch --with-multilib-list=aprofile"
            languages="c,c++,lto"
	    ;;
	aarch64*-*elf)
	    if test x"${override_arch}" = x -a x"${override_cpu}" = x; then
	        default_configure_flags="${default_configure_flags} --with-arch=armv8-a ${aarch64_errata} --disable-multiarch"
	    fi
	    # LDFLAGS_FOR_TARGET=-static
	    # Gfortran doesn't cross configure, just native
            languages="c,c++,lto"
	    ;;
	aarch64*-linux-gnu)
	    if test x"${override_arch}" = x -a x"${override_cpu}" = x; then
	        default_configure_flags="${default_configure_flags} --with-arch=armv8-a ${aarch64_errata} --enable-multiarch"
	    fi
	    # LDFLAGS_FOR_TARGET=-static
	    ;;
	*-mingw32)
	    languages="c,c++"
	    default_configure_flags="${default_configure_flags} --enable-languages=${languages} --disable-plugins"
	    # Cygwin doesn't support GCC plugins
#	    default_configure_flags="`echo ${default_configure_flags} | sed -e 's:--enable-plugins::'`"
	    ;;
	*)
	    default_configure_flags="${default_configure_flags}"
	    ;;
    esac
   
    case ${clibrary} in
	eglibc)
	    if test "`echo ${eglibc_version} | grep -c '/'`" -gt 0; then
		libc_version="`echo ${eglibc_version} | cut -d '/' -f 2`"
	    else
		libc_version="${eglibc_version}"
            fi
	    ;;
	glibc)
	    libc_version="${glibc_version}"
	    ;;
	newlib)
	    # bare metal targets don't support threads.
	    default_configure_flags="${default_configure_flags} --disable-threads --with-newlib"
	    libc_version="${newlib_version}"
	    ;;
	*)
	    fixme "\${clibrary} not specified by the time libc_version is being set."
	    ;;
    esac

   # bootstrapping is handled by Jenkins now.
   if test x"${with_languages}" != x"default"; then
       languages="${with_languages}"
   fi
    # The sysroot path depends on the C library version.
   if test x"${tarbin}" = xyes; then
#       local sysroot="/opt/linaro/sysroot-${libc_version}-${target}/libc"
	local sysroot="${local_builds}/destdir/${host}/${target}/libc"
#	local sysroot="../${target}/libc"
    else
	local sysroot="${local_builds}/sysroot-${target}"
    fi
   stage2_flags="--with-build-sysroot=${sysroots} --enable-lto --enable-linker-build-id --enable-long-long --enable-shared --with-sysroot=${sysroot} --enable-languages=${languages}"
    
    if test x"${release}" = x; then
        stage2_flags="${stage2_flags} --enable-checking=yes"
    else
        stage2_flags="${stage2_flags} --enable-checking=release"
    fi

    if test x"${bootstrap}" = x"yes"; then
	stage2_flags="${stage2_flags} --enable-bootstrap"
    else
	stage2_flags="${stage2_flags} --disable-bootstrap"
    fi

# native builds are easy, so build almost everything
else
    if test x"${with_languages}" != x"default"; then
	languages="${with_languages}"
    else
	languages="c,c++,go,objc,fortran"
    fi
    default_configure_flags="${default_configure_flags} --enable-linker-build-id --without-included-gettext --enable-threads=posix --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-objc-gc --enable-multiarch --disable-sjlj-exceptions --enable-languages=${languages}"
    # Native compilers are bootstrapped by default, but sometimes the extra time isn't
    # desired.
    if test x"${bootstrap}" = x"yes"; then
	default_configure_flags="${default_configure_flags} --enable-bootstrap"
    else
	default_configure_flags="${default_configure_flags} --disable-bootstrap"
    fi
    case ${target} in
	arm*-linux-gnueabi)
	    if test x"${override_arch}" = x -a x"${override_cpu}" = x; then
	        default_configure_flags="${default_configure_flags} --with-arch=armv7-a"
	    fi
	    default_configure_flags="${default_configure_flags} --with-fpu=vfpv3-d16 --with-float=softfp --with-mode=thumb "
	    ;;
	arm*-linux-gnueabihf)
	    if test x"${override_arch}" = x -a x"${override_cpu}" = x; then
	        default_configure_flags="${default_configure_flags} --with-arch=armv7-a"
	    fi
	    default_configure_flags="${default_configure_flags} --with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb"
	    ;;
	arm*-eabi | aarch64*-*elf)
	    #default_configure_flags="${default_configure_flags}"
	    ;;
	aarch64*-linux-gnu)
	    default_configure_flags="${default_configure_flags} ${aarch64_errata}"
	    ;;
	x86-pc-linux-gnu)
           default_configure_flags="${default_configure_flags} --enable-linker-build-id --without-included-gettext --enable-threads=posix --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-objc-gc --enable-multiarch --disable-sjlj-exceptions"
	    ;;
	x86_64*-linux-gnu)
#	    default_configure_flags="${default_configure_flags}"
	    ;;
	*)
	    ;;
    esac
  	stage2_flags=""
fi	 

# This is a list of default flags always supplied to "make check".
runtest_flags=""