Revisão | 0f98c9945899c5dfacd5a410ff04178eda605a16 (tree) |
---|---|
Hora | 2018-12-14 19:19:47 |
Autor | Peter Maydell <peter.maydell@lina...> |
Commiter | Peter Maydell |
Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2018-12-12' into staging
- Explicitly check for minimum compiler versions
- Remove obsolete code for old compilers that is now not required anymore
- Fix a duplicated typedef for Clang 3.4
# gpg: Signature made Wed 12 Dec 2018 09:05:50 GMT
# gpg: using RSA key 2ED9D774FE702DB5
# gpg: Good signature from "Thomas Huth <th.huth@gmx.de>"
# gpg: aka "Thomas Huth <thuth@redhat.com>"
# gpg: aka "Thomas Huth <huth@tuxfamily.org>"
# gpg: aka "Thomas Huth <th.huth@posteo.de>"
# Primary key fingerprint: 27B8 8847 EEE0 2501 18F3 EAB9 2ED9 D774 FE70 2DB5
* remotes/huth-gitlab/tags/pull-request-2018-12-12:
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
@@ -158,9 +158,6 @@ GENERATED_FILES += hmp-commands.h hmp-commands-info.h | ||
158 | 158 | |
159 | 159 | endif # CONFIG_SOFTMMU |
160 | 160 | |
161 | -# Workaround for http://gcc.gnu.org/PR55489, see configure. | |
162 | -%/translate.o: QEMU_CFLAGS += $(TRANSLATE_OPT_CFLAGS) | |
163 | - | |
164 | 161 | dummy := $(call unnest-vars,,obj-y) |
165 | 162 | all-obj-y := $(obj-y) |
166 | 163 |
@@ -28,9 +28,7 @@ | ||
28 | 28 | #include "audio.h" |
29 | 29 | #include "trace.h" |
30 | 30 | |
31 | -#if QEMU_GNUC_PREREQ(4, 3) | |
32 | 31 | #pragma GCC diagnostic ignored "-Waddress" |
33 | -#endif | |
34 | 32 | |
35 | 33 | #define AUDIO_CAP "alsa" |
36 | 34 | #include "audio_int.h" |
@@ -1840,6 +1840,31 @@ if test "$bogus_os" = "yes"; then | ||
1840 | 1840 | error_exit "Unrecognized host OS (uname -s reports '$(uname -s)')" |
1841 | 1841 | fi |
1842 | 1842 | |
1843 | +# Check whether the compiler matches our minimum requirements: | |
1844 | +cat > $TMPC << EOF | |
1845 | +#if defined(__clang_major__) && defined(__clang_minor__) | |
1846 | +# ifdef __apple_build_version__ | |
1847 | +# if __clang_major__ < 5 || (__clang_major__ == 5 && __clang_minor__ < 1) | |
1848 | +# error You need at least XCode Clang v5.1 to compile QEMU | |
1849 | +# endif | |
1850 | +# else | |
1851 | +# if __clang_major__ < 3 || (__clang_major__ == 3 && __clang_minor__ < 4) | |
1852 | +# error You need at least Clang v3.4 to compile QEMU | |
1853 | +# endif | |
1854 | +# endif | |
1855 | +#elif defined(__GNUC__) && defined(__GNUC_MINOR__) | |
1856 | +# if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 8) | |
1857 | +# error You need at least GCC v4.8 to compile QEMU | |
1858 | +# endif | |
1859 | +#else | |
1860 | +# error You either need GCC or Clang to compiler QEMU | |
1861 | +#endif | |
1862 | +int main (void) { return 0; } | |
1863 | +EOF | |
1864 | +if ! compile_prog "" "" ; then | |
1865 | + error_exit "You need at least GCC v4.8 or Clang v3.4 (or XCode Clang v5.1)" | |
1866 | +fi | |
1867 | + | |
1843 | 1868 | gcc_flags="-Wold-style-declaration -Wold-style-definition -Wtype-limits" |
1844 | 1869 | gcc_flags="-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers $gcc_flags" |
1845 | 1870 | gcc_flags="-Wno-missing-include-dirs -Wempty-body -Wnested-externs $gcc_flags" |
@@ -1911,21 +1936,7 @@ else | ||
1911 | 1936 | QEMU_CFLAGS="$QEMU_CFLAGS -Wno-missing-braces" |
1912 | 1937 | fi |
1913 | 1938 | |
1914 | -# Workaround for http://gcc.gnu.org/PR55489. Happens with -fPIE/-fPIC and | |
1915 | -# large functions that use global variables. The bug is in all releases of | |
1916 | -# GCC, but it became particularly acute in 4.6.x and 4.7.x. It is fixed in | |
1917 | -# 4.7.3 and 4.8.0. We should be able to delete this at the end of 2013. | |
1918 | -cat > $TMPC << EOF | |
1919 | -#if __GNUC__ == 4 && (__GNUC_MINOR__ == 6 || (__GNUC_MINOR__ == 7 && __GNUC_PATCHLEVEL__ <= 2)) | |
1920 | -int main(void) { return 0; } | |
1921 | -#else | |
1922 | -#error No bug in this compiler. | |
1923 | -#endif | |
1924 | -EOF | |
1925 | -if compile_prog "-Werror -fno-gcse" "" ; then | |
1926 | - TRANSLATE_OPT_CFLAGS=-fno-gcse | |
1927 | -fi | |
1928 | - | |
1939 | +# Static linking is not possible with modules or PIE | |
1929 | 1940 | if test "$static" = "yes" ; then |
1930 | 1941 | if test "$modules" = "yes" ; then |
1931 | 1942 | error_exit "static and modules are mutually incompatible" |
@@ -5123,11 +5134,6 @@ fi | ||
5123 | 5134 | |
5124 | 5135 | int128=no |
5125 | 5136 | cat > $TMPC << EOF |
5126 | -#if defined(__clang_major__) && defined(__clang_minor__) | |
5127 | -# if ((__clang_major__ < 3) || (__clang_major__ == 3) && (__clang_minor__ < 2)) | |
5128 | -# error __int128_t does not work in CLANG before 3.2 | |
5129 | -# endif | |
5130 | -#endif | |
5131 | 5137 | __int128_t a; |
5132 | 5138 | __uint128_t b; |
5133 | 5139 | int main (void) { |
@@ -6963,7 +6969,6 @@ echo "LIBS_QGA+=$libs_qga" >> $config_host_mak | ||
6963 | 6969 | echo "TASN1_LIBS=$tasn1_libs" >> $config_host_mak |
6964 | 6970 | echo "TASN1_CFLAGS=$tasn1_cflags" >> $config_host_mak |
6965 | 6971 | echo "POD2MAN=$POD2MAN" >> $config_host_mak |
6966 | -echo "TRANSLATE_OPT_CFLAGS=$TRANSLATE_OPT_CFLAGS" >> $config_host_mak | |
6967 | 6972 | if test "$gcov" = "yes" ; then |
6968 | 6973 | echo "CONFIG_GCOV=y" >> $config_host_mak |
6969 | 6974 | echo "GCOV=$gcov_tool" >> $config_host_mak |
@@ -3,8 +3,6 @@ | ||
3 | 3 | |
4 | 4 | #include "hw/i2c/i2c.h" |
5 | 5 | |
6 | -typedef struct bitbang_i2c_interface bitbang_i2c_interface; | |
7 | - | |
8 | 6 | #define BITBANG_I2C_SDA 0 |
9 | 7 | #define BITBANG_I2C_SCL 1 |
10 | 8 |
@@ -82,6 +82,8 @@ int i2c_recv(I2CBus *bus); | ||
82 | 82 | |
83 | 83 | DeviceState *i2c_create_slave(I2CBus *bus, const char *name, uint8_t addr); |
84 | 84 | |
85 | +typedef struct bitbang_i2c_interface bitbang_i2c_interface; | |
86 | + | |
85 | 87 | /* lm832x.c */ |
86 | 88 | void lm832x_key_event(DeviceState *dev, int key, int state); |
87 | 89 |
@@ -31,9 +31,6 @@ | ||
31 | 31 | #include "hw/sysbus.h" |
32 | 32 | #include "hw/i2c/i2c.h" |
33 | 33 | |
34 | -/* from hw/i2c/bitbang_i2c.h */ | |
35 | -typedef struct bitbang_i2c_interface bitbang_i2c_interface; | |
36 | - | |
37 | 34 | #define TYPE_PPC4xx_I2C "ppc4xx-i2c" |
38 | 35 | #define PPC4xx_I2C(obj) OBJECT_CHECK(PPC4xxI2CState, (obj), TYPE_PPC4xx_I2C) |
39 | 36 |
@@ -28,12 +28,6 @@ | ||
28 | 28 | |
29 | 29 | #define QEMU_SENTINEL __attribute__((sentinel)) |
30 | 30 | |
31 | -#if QEMU_GNUC_PREREQ(4, 3) | |
32 | -#define QEMU_ARTIFICIAL __attribute__((always_inline, artificial)) | |
33 | -#else | |
34 | -#define QEMU_ARTIFICIAL | |
35 | -#endif | |
36 | - | |
37 | 31 | #if defined(_WIN32) |
38 | 32 | # define QEMU_PACKED __attribute__((gcc_struct, packed)) |
39 | 33 | #else |
@@ -127,7 +121,7 @@ | ||
127 | 121 | #define __has_builtin(x) 0 /* compatibility with non-clang compilers */ |
128 | 122 | #endif |
129 | 123 | |
130 | -#if __has_builtin(__builtin_assume_aligned) || QEMU_GNUC_PREREQ(4, 7) | |
124 | +#if __has_builtin(__builtin_assume_aligned) || !defined(__clang__) | |
131 | 125 | #define HAS_ASSUME_ALIGNED |
132 | 126 | #endif |
133 | 127 |
@@ -207,7 +207,7 @@ static inline int cto64(uint64_t val) | ||
207 | 207 | */ |
208 | 208 | static inline int clrsb32(uint32_t val) |
209 | 209 | { |
210 | -#if QEMU_GNUC_PREREQ(4, 7) | |
210 | +#if __has_builtin(__builtin_clrsb) || !defined(__clang__) | |
211 | 211 | return __builtin_clrsb(val); |
212 | 212 | #else |
213 | 213 | return clz32(val ^ ((int32_t)val >> 1)) - 1; |
@@ -223,7 +223,7 @@ static inline int clrsb32(uint32_t val) | ||
223 | 223 | */ |
224 | 224 | static inline int clrsb64(uint64_t val) |
225 | 225 | { |
226 | -#if QEMU_GNUC_PREREQ(4, 7) | |
226 | +#if __has_builtin(__builtin_clrsbll) || !defined(__clang__) | |
227 | 227 | return __builtin_clrsbll(val); |
228 | 228 | #else |
229 | 229 | return clz64(val ^ ((int64_t)val >> 1)) - 1; |
@@ -202,7 +202,6 @@ our $Attribute = qr{ | ||
202 | 202 | QEMU_NORETURN| |
203 | 203 | QEMU_WARN_UNUSED_RESULT| |
204 | 204 | QEMU_SENTINEL| |
205 | - QEMU_ARTIFICIAL| | |
206 | 205 | QEMU_PACKED| |
207 | 206 | GCC_FMT_ATTR |
208 | 207 | }x; |
@@ -23,7 +23,6 @@ | ||
23 | 23 | #define QEMU_NORETURN __attribute__ ((__noreturn__)) |
24 | 24 | #define QEMU_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) |
25 | 25 | #define QEMU_SENTINEL __attribute__((sentinel)) |
26 | -#define QEMU_ARTIFICIAL __attribute__((always_inline, artificial)) | |
27 | 26 | #define QEMU_PACKED __attribute__((gcc_struct, packed)) |
28 | 27 | |
29 | 28 | #define cat(x,y) x ## y |
@@ -230,11 +230,9 @@ typedef uint64_t tcg_insn_unit; | ||
230 | 230 | |
231 | 231 | #if defined CONFIG_DEBUG_TCG || defined QEMU_STATIC_ANALYSIS |
232 | 232 | # define tcg_debug_assert(X) do { assert(X); } while (0) |
233 | -#elif QEMU_GNUC_PREREQ(4, 5) | |
233 | +#else | |
234 | 234 | # define tcg_debug_assert(X) \ |
235 | 235 | do { if (!(X)) { __builtin_unreachable(); } } while (0) |
236 | -#else | |
237 | -# define tcg_debug_assert(X) do { (void)(X); } while (0) | |
238 | 236 | #endif |
239 | 237 | |
240 | 238 | typedef struct TCGRelocation { |