Message ID | 1477170324-17783-1-git-send-email-rth@twiddle.net |
---|---|
State | New |
Headers | show |
On 22 October 2016 at 22:04, Richard Henderson <rth@twiddle.net> wrote: > This is v7, with the additional fix for gcc 4.2, as on Centos 6. > > > r~ > > > The following changes since commit da158a86c407fa7b9da848b571356a26809d8df9: > > Merge remote-tracking branch 'remotes/berrange/tags/pull-qcrypto-2016-10-20-1' into staging (2016-10-20 14:46:19 +0100) > > are available in the git repository at: > > git://github.com/rth7680/qemu.git tags/pull-atomic-20161022 > > for you to fetch changes up to 278c5beb29ef8b6747a7c9bde403e9fe90cdad9c: > > target-alpha: Emulate LL/SC using cmpxchg helpers (2016-10-20 11:00:46 -0700) > > ---------------------------------------------------------------- > cmpxchg atomic operations > > ---------------------------------------------------------------- This fails to build with clang (OSX and linux): /Users/pm215/src/qemu-for-merges/target-arm/translate.c:1019:1: error: unused function 'gen_aa32_ld16ua ' [-Werror,-Wunused-function] DO_GEN_LD(16ua, MO_UW | MO_ALIGN) ^ /Users/pm215/src/qemu-for-merges/target-arm/translate.c:954:20: note: expanded from macro 'DO_GEN_LD' static inline void gen_aa32_ld##SUFF(DisasContext *s, TCGv_i32 val, \ ^ <scratch space>:130:1: note: expanded from here gen_aa32_ld16ua ^ /Users/pm215/src/qemu-for-merges/target-arm/translate.c:1020:1: error: unused function 'gen_aa32_ld32ua ' [-Werror,-Wunused-function] DO_GEN_LD(32ua, MO_UL | MO_ALIGN) ^ /Users/pm215/src/qemu-for-merges/target-arm/translate.c:954:20: note: expanded from macro 'DO_GEN_LD' static inline void gen_aa32_ld##SUFF(DisasContext *s, TCGv_i32 val, \ ^ <scratch space>:131:1: note: expanded from here gen_aa32_ld32ua ^ The other builds passed OK. thanks -- PMM
On 24/10/2016 12:51, Peter Maydell wrote: > On 22 October 2016 at 22:04, Richard Henderson <rth@twiddle.net> wrote: >> This is v7, with the additional fix for gcc 4.2, as on Centos 6. >> >> >> r~ >> >> >> The following changes since commit da158a86c407fa7b9da848b571356a26809d8df9: >> >> Merge remote-tracking branch 'remotes/berrange/tags/pull-qcrypto-2016-10-20-1' into staging (2016-10-20 14:46:19 +0100) >> >> are available in the git repository at: >> >> git://github.com/rth7680/qemu.git tags/pull-atomic-20161022 >> >> for you to fetch changes up to 278c5beb29ef8b6747a7c9bde403e9fe90cdad9c: >> >> target-alpha: Emulate LL/SC using cmpxchg helpers (2016-10-20 11:00:46 -0700) >> >> ---------------------------------------------------------------- >> cmpxchg atomic operations >> >> ---------------------------------------------------------------- > > This fails to build with clang (OSX and linux): > > /Users/pm215/src/qemu-for-merges/target-arm/translate.c:1019:1: error: > unused function 'gen_aa32_ld16ua > ' [-Werror,-Wunused-function] > DO_GEN_LD(16ua, MO_UW | MO_ALIGN) > ^ > /Users/pm215/src/qemu-for-merges/target-arm/translate.c:954:20: note: > expanded from macro 'DO_GEN_LD' > static inline void gen_aa32_ld##SUFF(DisasContext *s, TCGv_i32 val, \ > ^ > <scratch space>:130:1: note: expanded from here > gen_aa32_ld16ua > ^ > /Users/pm215/src/qemu-for-merges/target-arm/translate.c:1020:1: error: > unused function 'gen_aa32_ld32ua > ' [-Werror,-Wunused-function] > DO_GEN_LD(32ua, MO_UL | MO_ALIGN) > ^ > /Users/pm215/src/qemu-for-merges/target-arm/translate.c:954:20: note: > expanded from macro 'DO_GEN_LD' > static inline void gen_aa32_ld##SUFF(DisasContext *s, TCGv_i32 val, \ > ^ > <scratch space>:131:1: note: expanded from here > gen_aa32_ld32ua > ^ > > The other builds passed OK. LLVM bug https://llvm.org/bugs/show_bug.cgi?id=22712: we should probably consider the functions to not be in the main source file if they were expanded from a macro that was defined outside that file. That perhaps doesn't go far enough (consider a macro defined in the main source file, that produces several functions, where after each macro invocation only a subset of the functions is used) Paolo
On 24 October 2016 at 13:37, Paolo Bonzini <pbonzini@redhat.com> wrote: > On 24/10/2016 12:51, Peter Maydell wrote: >> This fails to build with clang (OSX and linux): >> >> /Users/pm215/src/qemu-for-merges/target-arm/translate.c:1019:1: error: >> unused function 'gen_aa32_ld16ua >> ' [-Werror,-Wunused-function] >> DO_GEN_LD(16ua, MO_UW | MO_ALIGN) >> ^ >> /Users/pm215/src/qemu-for-merges/target-arm/translate.c:954:20: note: >> expanded from macro 'DO_GEN_LD' >> static inline void gen_aa32_ld##SUFF(DisasContext *s, TCGv_i32 val, \ >> ^ >> <scratch space>:130:1: note: expanded from here >> gen_aa32_ld16ua >> ^ >> /Users/pm215/src/qemu-for-merges/target-arm/translate.c:1020:1: error: >> unused function 'gen_aa32_ld32ua >> ' [-Werror,-Wunused-function] >> DO_GEN_LD(32ua, MO_UL | MO_ALIGN) >> ^ >> /Users/pm215/src/qemu-for-merges/target-arm/translate.c:954:20: note: >> expanded from macro 'DO_GEN_LD' >> static inline void gen_aa32_ld##SUFF(DisasContext *s, TCGv_i32 val, \ >> ^ >> <scratch space>:131:1: note: expanded from here >> gen_aa32_ld32ua >> ^ >> >> The other builds passed OK. > > LLVM bug https://llvm.org/bugs/show_bug.cgi?id=22712: > > we should probably consider the functions to not be in the main > source file if they were expanded from a macro that was defined > outside that file. That perhaps doesn't go far enough (consider a > macro defined in the main source file, that produces several > functions, where after each macro invocation only a subset of the > functions is used) That just says "even if we fixed this bug it wouldn't affect the situation we have here"... In any case, since DO_GEN_LD(16ua, ...) only and exactly produces one function (gen_aa32_ld16ua), the fix would seem to be just to not have that macro invocation if we never use the function it produces. (We don't even conditionally use the function as far as I can tell.) thanks -- PMM
On 10/24/2016 03:51 AM, Peter Maydell wrote: > /Users/pm215/src/qemu-for-merges/target-arm/translate.c:1019:1: error: > unused function 'gen_aa32_ld16ua > ' [-Werror,-Wunused-function] > DO_GEN_LD(16ua, MO_UW | MO_ALIGN) > ^ > /Users/pm215/src/qemu-for-merges/target-arm/translate.c:954:20: note: > expanded from macro 'DO_GEN_LD' > static inline void gen_aa32_ld##SUFF(DisasContext *s, TCGv_i32 val, \ > ^ > <scratch space>:130:1: note: expanded from here > gen_aa32_ld16ua > ^ > /Users/pm215/src/qemu-for-merges/target-arm/translate.c:1020:1: error: > unused function 'gen_aa32_ld32ua > ' [-Werror,-Wunused-function] > DO_GEN_LD(32ua, MO_UL | MO_ALIGN) Bah. Annoyingly, even though I didn't configure with --disable-werror, I only got the warning from clang, which of course flashed by unseen. Folded the removal of these into the "target-arm: emulate LL/SC using cmpxchg helpers" patch which removed their use. r~
On 24 October 2016 at 18:27, Richard Henderson <rth@twiddle.net> wrote: > Bah. Annoyingly, even though I didn't configure with --disable-werror, I only > got the warning from clang, which of course flashed by unseen. I think that configure looks for "does this compiler support the GCC diagnostic pragma" (which clang doesn't) and doesn't enable werror by default if it doesn't exist, even though often your combination of config options and system headers won't produce the warnings that we would need the pragma to suppress. I usually add -Werror to --extra-cflags. thanks -- PMM