Message ID | 20181016174911.9052-1-richard.henderson@linaro.org |
---|---|
Headers | show |
Series | tcg patch queue | expand |
On 16 October 2018 at 18:48, Richard Henderson <richard.henderson@linaro.org> wrote: > The following changes since commit ff56877e911782dedc9a424233fd3f62369c258c: > > Merge remote-tracking branch 'remotes/kraxel/tags/vga-20181015-pull-request' into staging (2018-10-15 15:03:45 +0100) > > are available in the Git repository at: > > https://github.com/rth7680/qemu.git tags/pull-tcg-20181016 > > for you to fetch changes up to e3e9d1ea20c75718ce7c528c588a0a497f12f750: > > cputlb: read CPUTLBEntry.addr_write atomically (2018-10-16 10:04:27 -0700) > > ---------------------------------------------------------------- > Queued tcg patches > Hi; I get compile failures, I'm afraid: FreeBSD's compiler gives warnings: In file included from /var/tmp/qemu-test.bVaUEj/accel/tcg/user-exec.c:28: /var/tmp/qemu-test.bVaUEj/include/qemu/atomic128.h:148:23: warning: unknown attribute 'error' ignored [-Wunknown-attributes] Int128 __attribute__((error("unsupported atomic"))) ^ /var/tmp/qemu-test.bVaUEj/include/qemu/atomic128.h:150:21: warning: unknown attribute 'error' ignored [-Wunknown-attributes] void __attribute__((error("unsupported atomic"))) ^ x86-64 Linux clang fails with the same issue: In file included from /home/petmay01/linaro/qemu-for-merges/accel/tcg/user-exec.c:28: /home/petmay01/linaro/qemu-for-merges/include/qemu/atomic128.h:148:23: error: unknown attribute 'error' ignored [-Werror,-Wunknown-attributes] Int128 __attribute__((error("unsupported atomic"))) ^ /home/petmay01/linaro/qemu-for-merges/include/qemu/atomic128.h:150:21: error: unknown attribute 'error' ignored [-Werror,-Wunknown-attributes] void __attribute__((error("unsupported atomic"))) ^ The win32 build fails with: target/arm/helper-a64.o: In function `helper_paired_cmpxchg64_le_parallel': /home/petmay01/qemu-for-merges/target/arm/helper-a64.c:573: undefined reference to `helper_atomic_cmpxchgo_le_mmu' target/arm/helper-a64.o: In function `helper_paired_cmpxchg64_be_parallel': /home/petmay01/qemu-for-merges/target/arm/helper-a64.c:647: undefined reference to `helper_atomic_cmpxchgo_be_mmu' target/arm/helper-a64.o: In function `helper_casp_le_parallel': /home/petmay01/qemu-for-merges/target/arm/helper-a64.c:669: undefined reference to `helper_atomic_cmpxchgo_le_mmu' target/arm/helper-a64.o: In function `helper_casp_be_parallel': /home/petmay01/qemu-for-merges/target/arm/helper-a64.c:690: undefined reference to `helper_atomic_cmpxchgo_be_mmu' thanks -- PMM
On 10/18/18 3:34 AM, Peter Maydell wrote: > Hi; I get compile failures, I'm afraid: > > FreeBSD's compiler gives warnings: > In file included from /var/tmp/qemu-test.bVaUEj/accel/tcg/user-exec.c:28: > /var/tmp/qemu-test.bVaUEj/include/qemu/atomic128.h:148:23: warning: > unknown attribute 'error' ignored [-Wunknown-attributes] > Int128 __attribute__((error("unsupported atomic"))) > ^ > /var/tmp/qemu-test.bVaUEj/include/qemu/atomic128.h:150:21: warning: > unknown attribute 'error' ignored [-Wunknown-attributes] > void __attribute__((error("unsupported atomic"))) > ^ > > x86-64 Linux clang fails with the same issue: > In file included from > /home/petmay01/linaro/qemu-for-merges/accel/tcg/user-exec.c:28: > /home/petmay01/linaro/qemu-for-merges/include/qemu/atomic128.h:148:23: > error: unknown attribute 'error' ignored > [-Werror,-Wunknown-attributes] > Int128 __attribute__((error("unsupported atomic"))) > ^ > /home/petmay01/linaro/qemu-for-merges/include/qemu/atomic128.h:150:21: > error: unknown attribute 'error' ignored > [-Werror,-Wunknown-attributes] > void __attribute__((error("unsupported atomic"))) I used __has_attribute for this one. Tested with clang 7. > The win32 build fails with: > > target/arm/helper-a64.o: In function `helper_paired_cmpxchg64_le_parallel': > /home/petmay01/qemu-for-merges/target/arm/helper-a64.c:573: undefined > reference to `helper_atomic_cmpxchgo_le_mmu' > target/arm/helper-a64.o: In function `helper_paired_cmpxchg64_be_parallel': > /home/petmay01/qemu-for-merges/target/arm/helper-a64.c:647: undefined > reference to `helper_atomic_cmpxchgo_be_mmu' > target/arm/helper-a64.o: In function `helper_casp_le_parallel': > /home/petmay01/qemu-for-merges/target/arm/helper-a64.c:669: undefined > reference to `helper_atomic_cmpxchgo_le_mmu' > target/arm/helper-a64.o: In function `helper_casp_be_parallel': > /home/petmay01/qemu-for-merges/target/arm/helper-a64.c:690: undefined > reference to `helper_atomic_cmpxchgo_be_mmu' This one I could not reproduce. Tested with i686-w64-mingw32-gcc and x86_64-w64-mingw32-gcc, both version 6.2. I suspect configure misfired. If you can, start this one over with a blank build directory. I've sent you a v2 pull. r~
On 19 October 2018 at 07:10, Richard Henderson <richard.henderson@linaro.org> wrote: > On 10/18/18 3:34 AM, Peter Maydell wrote: >> The win32 build fails with: >> >> target/arm/helper-a64.o: In function `helper_paired_cmpxchg64_le_parallel': >> /home/petmay01/qemu-for-merges/target/arm/helper-a64.c:573: undefined >> reference to `helper_atomic_cmpxchgo_le_mmu' >> target/arm/helper-a64.o: In function `helper_paired_cmpxchg64_be_parallel': >> /home/petmay01/qemu-for-merges/target/arm/helper-a64.c:647: undefined >> reference to `helper_atomic_cmpxchgo_be_mmu' >> target/arm/helper-a64.o: In function `helper_casp_le_parallel': >> /home/petmay01/qemu-for-merges/target/arm/helper-a64.c:669: undefined >> reference to `helper_atomic_cmpxchgo_le_mmu' >> target/arm/helper-a64.o: In function `helper_casp_be_parallel': >> /home/petmay01/qemu-for-merges/target/arm/helper-a64.c:690: undefined >> reference to `helper_atomic_cmpxchgo_be_mmu' > > This one I could not reproduce. Tested with i686-w64-mingw32-gcc > and x86_64-w64-mingw32-gcc, both version 6.2. > > I suspect configure misfired. If you can, start this one over with a blank > build directory. Something odd is going on here. My merge test when I merged your v2 passed (unless I managed to miss a failure message first time around which isn't impossible). But on a subsequent test for a later merge, I get the same error: LINK aarch64-softmmu/qemu-system-aarch64w.exe target/arm/helper-a64.o: In function `helper_paired_cmpxchg64_le_parallel': /home/petmay01/qemu-for-merges/target/arm/helper-a64.c:573: undefined reference to `helper_atomic_cmpxchgo_le_mmu' target/arm/helper-a64.o: In function `helper_paired_cmpxchg64_be_parallel': /home/petmay01/qemu-for-merges/target/arm/helper-a64.c:647: undefined reference to `helper_atomic_cmpxchgo_be_mmu' target/arm/helper-a64.o: In function `helper_casp_le_parallel': /home/petmay01/qemu-for-merges/target/arm/helper-a64.c:669: undefined reference to `helper_atomic_cmpxchgo_le_mmu' target/arm/helper-a64.o: In function `helper_casp_be_parallel': /home/petmay01/qemu-for-merges/target/arm/helper-a64.c:690: undefined reference to `helper_atomic_cmpxchgo_be_mmu' collect2: error: ld returned 1 exit status I did a complete "blow away build/w32 entirely and reconfigure" and the failure is still there. config-host.mak defines neither CONFIG_ATOMIC128 nor CONFIG_CMPXCHG128, which is what I'd expect for a w32 build. (The w64 build does define CONFIG_ATOMIC128, and does build.) Any idea what's going on here? tcg/tcg.h has a comment saying * The cmpxchg functions are only defined if HAVE_CMPXCHG128 so presumably the issue is that the helper-a64 code is trying to refer to them anyway. There certainly doesn't seem to be any kind of #defining around the listed functions in helper-a64.c to stop them being compiled in this situation. NB: I build with --enable-debug in this tree -- are you perhaps accidentally relying on the compiler's optimisation to discard these functions if they're not needed? thanks -- PMM
On 21 October 2018 at 16:01, Peter Maydell <peter.maydell@linaro.org> wrote: > Any idea what's going on here? tcg/tcg.h has a comment saying > * The cmpxchg functions are only defined if HAVE_CMPXCHG128 > so presumably the issue is that the helper-a64 code is > trying to refer to them anyway. There certainly doesn't > seem to be any kind of #defining around the listed functions > in helper-a64.c to stop them being compiled in this situation. > > NB: I build with --enable-debug in this tree -- are you > perhaps accidentally relying on the compiler's optimisation > to discard these functions if they're not needed? Adding a #if HAVE_CMPXCHG128 around the helper-a64.c functions just pushes the link error back a step to the references to those helpers: LINK aarch64-softmmu/qemu-system-aarch64w.exe tcg/tcg.o:tcg.c:(.rdata+0x9810): undefined reference to `helper_paired_cmpxchg64_le_parallel' tcg/tcg.o:tcg.c:(.rdata+0x9830): undefined reference to `helper_paired_cmpxchg64_be_parallel' tcg/tcg.o:tcg.c:(.rdata+0x9840): undefined reference to `helper_casp_le_parallel' tcg/tcg.o:tcg.c:(.rdata+0x9850): undefined reference to `helper_casp_be_parallel' which in turn I guess is because they're in the array of all helpers in tcg.c, so we need to also #if out the prototypes in helper-a64.h, which is awkward because there we don't have the HAVE_CMPXCHG128 defined... thanks -- PMM
On 10/21/18 4:21 PM, Peter Maydell wrote: > On 21 October 2018 at 16:01, Peter Maydell <peter.maydell@linaro.org> wrote: >> Any idea what's going on here? tcg/tcg.h has a comment saying >> * The cmpxchg functions are only defined if HAVE_CMPXCHG128 >> so presumably the issue is that the helper-a64 code is >> trying to refer to them anyway. There certainly doesn't >> seem to be any kind of #defining around the listed functions >> in helper-a64.c to stop them being compiled in this situation. >> >> NB: I build with --enable-debug in this tree -- are you >> perhaps accidentally relying on the compiler's optimisation >> to discard these functions if they're not needed? > > Adding a #if HAVE_CMPXCHG128 around the helper-a64.c > functions just pushes the link error back a step to the > references to those helpers: > LINK aarch64-softmmu/qemu-system-aarch64w.exe > tcg/tcg.o:tcg.c:(.rdata+0x9810): undefined reference to > `helper_paired_cmpxchg64_le_parallel' > tcg/tcg.o:tcg.c:(.rdata+0x9830): undefined reference to > `helper_paired_cmpxchg64_be_parallel' > tcg/tcg.o:tcg.c:(.rdata+0x9840): undefined reference to > `helper_casp_le_parallel' > tcg/tcg.o:tcg.c:(.rdata+0x9850): undefined reference to > `helper_casp_be_parallel' > > which in turn I guess is because they're in the array > of all helpers in tcg.c, so we need to also #if out the > prototypes in helper-a64.h, which is awkward because > there we don't have the HAVE_CMPXCHG128 defined... I spoke with Peter in person today about this. For the list, I've reproduced the problem, and I'm calling it a mingw bug. A patch against qemu/osdep.h to fix this once and for all shortly. r~