• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisión0f98c9945899c5dfacd5a410ff04178eda605a16 (tree)
Tiempo2018-12-14 19:19:47
AutorPeter Maydell <peter.maydell@lina...>
CommiterPeter Maydell

Log Message

- 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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iQIcBAABAgAGBQJcEM9uAAoJEC7Z13T+cC21Q18P+QEkPrbXiQVJX3NPCTYRq0e8
v0RUdlspsxiQs/783oV593IPclnX2xFwbZnxR+1uecFSPWlm3F0d3XJnlUnPllZD
Qf4VHcsg9JaVJto9vX9yPAYuwAraEjSyoQIfbblU9hLi8Vb7Pvz0HQKbIKHfXTzZ
YJap/5MZBHpwVS2ahCubFQPY8I70lB6OPi++85MIuITxa1mr8Agi5jJFvNPlol5h
gImMoPMvG8h38Jl/AOuzY9p/NGWAENa4TmRbkftVZHEMUv/Fo5sNsS5iuWc1V5lq
2rjYNf0IsvH/0TB5A9WFaZOqiKgsa73TA3tBA8OiUoVsIVbSHHy6WYn2QtcinVE1
LS84yAyn2jKAAPSBmOnBcuCH84f7kpHAJBj4J6ObmkDJ+0e0F4TNXYVFv0HlgH33
8fxlPRfakOb76S2MdVX4SUe+xoxfEZx0c+7ADLD+mYTzBJuoTJYb9TfXvjwWe8A6
nnAaORfooC8i6WSB2Lcw0k0l8R/ZwXT4M4Zv3H4t4jNK7kTDOpaWUK8K46ARjYvZ
+dOFu5O3jfvxjrqZLHld6ai/n14WvYyhxEczr3T1EIALCqLub5qnxiQomNyoTWER
PWtG4lRO6m1lL/fWr/ttVL/TS9rqHGk95PYIixs3QIEjEsG3SfjdWttVxCtiBELy
rlDeu/c6Qu72YCe7On21
=82XF
-----END PGP SIGNATURE-----

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:

i2c: Move typedef of bitbang_i2c_interface to i2c.h
Remove QEMU_ARTIFICIAL macro
includes: Replace QEMU_GNUC_PREREQ with "has_builtin || !defined(clang)"
audio/alsaaudio: Remove compiler check around pragma
tcg/tcg.h: Remove GCC check for tcg_debug_assert() macro
configure: Remove old -fno-gcse workaround for GCC 4.6.x and 4.7.[012]
configure: Remove obsolete check for Clang < 3.2
configure: Add a test for the minimum compiler version

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Cambiar Resumen

Diferencia incremental

--- a/Makefile.target
+++ b/Makefile.target
@@ -158,9 +158,6 @@ GENERATED_FILES += hmp-commands.h hmp-commands-info.h
158158
159159 endif # CONFIG_SOFTMMU
160160
161-# Workaround for http://gcc.gnu.org/PR55489, see configure.
162-%/translate.o: QEMU_CFLAGS += $(TRANSLATE_OPT_CFLAGS)
163-
164161 dummy := $(call unnest-vars,,obj-y)
165162 all-obj-y := $(obj-y)
166163
--- a/audio/alsaaudio.c
+++ b/audio/alsaaudio.c
@@ -28,9 +28,7 @@
2828 #include "audio.h"
2929 #include "trace.h"
3030
31-#if QEMU_GNUC_PREREQ(4, 3)
3231 #pragma GCC diagnostic ignored "-Waddress"
33-#endif
3432
3533 #define AUDIO_CAP "alsa"
3634 #include "audio_int.h"
--- a/configure
+++ b/configure
@@ -1840,6 +1840,31 @@ if test "$bogus_os" = "yes"; then
18401840 error_exit "Unrecognized host OS (uname -s reports '$(uname -s)')"
18411841 fi
18421842
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+
18431868 gcc_flags="-Wold-style-declaration -Wold-style-definition -Wtype-limits"
18441869 gcc_flags="-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers $gcc_flags"
18451870 gcc_flags="-Wno-missing-include-dirs -Wempty-body -Wnested-externs $gcc_flags"
@@ -1911,21 +1936,7 @@ else
19111936 QEMU_CFLAGS="$QEMU_CFLAGS -Wno-missing-braces"
19121937 fi
19131938
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
19291940 if test "$static" = "yes" ; then
19301941 if test "$modules" = "yes" ; then
19311942 error_exit "static and modules are mutually incompatible"
@@ -5123,11 +5134,6 @@ fi
51235134
51245135 int128=no
51255136 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
51315137 __int128_t a;
51325138 __uint128_t b;
51335139 int main (void) {
@@ -6963,7 +6969,6 @@ echo "LIBS_QGA+=$libs_qga" >> $config_host_mak
69636969 echo "TASN1_LIBS=$tasn1_libs" >> $config_host_mak
69646970 echo "TASN1_CFLAGS=$tasn1_cflags" >> $config_host_mak
69656971 echo "POD2MAN=$POD2MAN" >> $config_host_mak
6966-echo "TRANSLATE_OPT_CFLAGS=$TRANSLATE_OPT_CFLAGS" >> $config_host_mak
69676972 if test "$gcov" = "yes" ; then
69686973 echo "CONFIG_GCOV=y" >> $config_host_mak
69696974 echo "GCOV=$gcov_tool" >> $config_host_mak
--- a/hw/i2c/bitbang_i2c.h
+++ b/hw/i2c/bitbang_i2c.h
@@ -3,8 +3,6 @@
33
44 #include "hw/i2c/i2c.h"
55
6-typedef struct bitbang_i2c_interface bitbang_i2c_interface;
7-
86 #define BITBANG_I2C_SDA 0
97 #define BITBANG_I2C_SCL 1
108
--- a/include/hw/i2c/i2c.h
+++ b/include/hw/i2c/i2c.h
@@ -82,6 +82,8 @@ int i2c_recv(I2CBus *bus);
8282
8383 DeviceState *i2c_create_slave(I2CBus *bus, const char *name, uint8_t addr);
8484
85+typedef struct bitbang_i2c_interface bitbang_i2c_interface;
86+
8587 /* lm832x.c */
8688 void lm832x_key_event(DeviceState *dev, int key, int state);
8789
--- a/include/hw/i2c/ppc4xx_i2c.h
+++ b/include/hw/i2c/ppc4xx_i2c.h
@@ -31,9 +31,6 @@
3131 #include "hw/sysbus.h"
3232 #include "hw/i2c/i2c.h"
3333
34-/* from hw/i2c/bitbang_i2c.h */
35-typedef struct bitbang_i2c_interface bitbang_i2c_interface;
36-
3734 #define TYPE_PPC4xx_I2C "ppc4xx-i2c"
3835 #define PPC4xx_I2C(obj) OBJECT_CHECK(PPC4xxI2CState, (obj), TYPE_PPC4xx_I2C)
3936
--- a/include/qemu/compiler.h
+++ b/include/qemu/compiler.h
@@ -28,12 +28,6 @@
2828
2929 #define QEMU_SENTINEL __attribute__((sentinel))
3030
31-#if QEMU_GNUC_PREREQ(4, 3)
32-#define QEMU_ARTIFICIAL __attribute__((always_inline, artificial))
33-#else
34-#define QEMU_ARTIFICIAL
35-#endif
36-
3731 #if defined(_WIN32)
3832 # define QEMU_PACKED __attribute__((gcc_struct, packed))
3933 #else
@@ -127,7 +121,7 @@
127121 #define __has_builtin(x) 0 /* compatibility with non-clang compilers */
128122 #endif
129123
130-#if __has_builtin(__builtin_assume_aligned) || QEMU_GNUC_PREREQ(4, 7)
124+#if __has_builtin(__builtin_assume_aligned) || !defined(__clang__)
131125 #define HAS_ASSUME_ALIGNED
132126 #endif
133127
--- a/include/qemu/host-utils.h
+++ b/include/qemu/host-utils.h
@@ -207,7 +207,7 @@ static inline int cto64(uint64_t val)
207207 */
208208 static inline int clrsb32(uint32_t val)
209209 {
210-#if QEMU_GNUC_PREREQ(4, 7)
210+#if __has_builtin(__builtin_clrsb) || !defined(__clang__)
211211 return __builtin_clrsb(val);
212212 #else
213213 return clz32(val ^ ((int32_t)val >> 1)) - 1;
@@ -223,7 +223,7 @@ static inline int clrsb32(uint32_t val)
223223 */
224224 static inline int clrsb64(uint64_t val)
225225 {
226-#if QEMU_GNUC_PREREQ(4, 7)
226+#if __has_builtin(__builtin_clrsbll) || !defined(__clang__)
227227 return __builtin_clrsbll(val);
228228 #else
229229 return clz64(val ^ ((int64_t)val >> 1)) - 1;
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -202,7 +202,6 @@ our $Attribute = qr{
202202 QEMU_NORETURN|
203203 QEMU_WARN_UNUSED_RESULT|
204204 QEMU_SENTINEL|
205- QEMU_ARTIFICIAL|
206205 QEMU_PACKED|
207206 GCC_FMT_ATTR
208207 }x;
--- a/scripts/cocci-macro-file.h
+++ b/scripts/cocci-macro-file.h
@@ -23,7 +23,6 @@
2323 #define QEMU_NORETURN __attribute__ ((__noreturn__))
2424 #define QEMU_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
2525 #define QEMU_SENTINEL __attribute__((sentinel))
26-#define QEMU_ARTIFICIAL __attribute__((always_inline, artificial))
2726 #define QEMU_PACKED __attribute__((gcc_struct, packed))
2827
2928 #define cat(x,y) x ## y
--- a/tcg/tcg.h
+++ b/tcg/tcg.h
@@ -230,11 +230,9 @@ typedef uint64_t tcg_insn_unit;
230230
231231 #if defined CONFIG_DEBUG_TCG || defined QEMU_STATIC_ANALYSIS
232232 # define tcg_debug_assert(X) do { assert(X); } while (0)
233-#elif QEMU_GNUC_PREREQ(4, 5)
233+#else
234234 # define tcg_debug_assert(X) \
235235 do { if (!(X)) { __builtin_unreachable(); } } while (0)
236-#else
237-# define tcg_debug_assert(X) do { (void)(X); } while (0)
238236 #endif
239237
240238 typedef struct TCGRelocation {