[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 63/93] tcg/tci: Use ffi for calls
From: |
Peter Maydell |
Subject: |
Re: [PATCH v2 63/93] tcg/tci: Use ffi for calls |
Date: |
Mon, 8 Feb 2021 09:20:32 +0000 |
On Sun, 7 Feb 2021 at 20:12, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> On 2/7/21 11:52 AM, Peter Maydell wrote:
> > On Sun, 7 Feb 2021 at 17:41, Richard Henderson
> > <richard.henderson@linaro.org> wrote:
> >>
> >> On 2/7/21 8:25 AM, Stefan Weil wrote:
> >>>> +#include "qemu-common.h"
> >>>> +#include "tcg/tcg.h" /* MAX_OPC_PARAM_IARGS */
> >>>> +#include "exec/cpu_ldst.h"
> >>>> +#include "tcg/tcg-op.h"
> >>>> +#include "qemu/compiler.h"
> >>>> +#include <ffi.h>
> >>>> +
> >>>
> >>>
> >>> ffi.h is not found on macOS with Homebrew.
> >>>
> >>> This can be fixed by using pkg-config to find the right compiler (and
> >>> maybe
> >>> also linker) flags:
> >>>
> >>> % pkg-config --cflags libffi
> >>> -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/ffi
> >>> % pkg-config --libs libffi
> >>> -lffi
> >>
> >>
> >> Which is exactly what I do in the previous patch:
> >>
> >>
> >>> +++ b/meson.build
> >>> @@ -1901,7 +1901,14 @@ specific_ss.add(when: 'CONFIG_TCG', if_true: files(
> >>> 'tcg/tcg-op.c',
> >>> 'tcg/tcg.c',
> >>> ))
> >>> -specific_ss.add(when: 'CONFIG_TCG_INTERPRETER', if_true:
> >>> files('tcg/tci.c'))
> >>> +
> >>> +if get_option('tcg_interpreter')
> >>> + libffi = dependency('libffi', version: '>=3.0',
> >>> + static: enable_static, method: 'pkg-config',
> >>> + required: true)
> >>> + specific_ss.add(libffi)
> >>> + specific_ss.add(files('tcg/tci.c'))
> >>> +endif
> >>
> >> Did you need a PKG_CONFIG_LIBDIR set for homebrew?
> >
> > Is this the "meson doesn't actually add the cflags everywhere it should"
> > bug again ?
>
> I guess so. I realized after sending this reply that PKG_CONFIG_LIBDIR can't
> be the answer, since the original configure should have failed if pkg-config
> didn't find ffi.
>
> Was there a resolution to said meson bug?
There's a workaround involving adding the library to the dependencies
list in the right places -- commit 3eacf70bb5a83e4 did this for gnutls.
Paolo may be able to help further.
thanks
-- PMM
- [PATCH v2 59/93] tcg/tci: Hoist op_size checking into tci_args_*, (continued)
- [PATCH v2 59/93] tcg/tci: Hoist op_size checking into tci_args_*, Richard Henderson, 2021/02/03
- [PATCH v2 60/93] tcg/tci: Remove tci_disas, Richard Henderson, 2021/02/03
- [PATCH v2 61/93] tcg/tci: Implement the disassembler properly, Richard Henderson, 2021/02/03
- [PATCH v2 62/93] tcg: Build ffi data structures for helpers, Richard Henderson, 2021/02/03
- [PATCH v2 63/93] tcg/tci: Use ffi for calls, Richard Henderson, 2021/02/03
- Re: [PATCH v2 63/93] tcg/tci: Use ffi for calls, Stefan Weil, 2021/02/07
- Re: [PATCH v2 63/93] tcg/tci: Use ffi for calls, Richard Henderson, 2021/02/07
- Re: [PATCH v2 63/93] tcg/tci: Use ffi for calls, Peter Maydell, 2021/02/07
- Re: [PATCH v2 63/93] tcg/tci: Use ffi for calls, Richard Henderson, 2021/02/07
- Re: [PATCH v2 63/93] tcg/tci: Use ffi for calls, Stefan Weil, 2021/02/07
- Re: [PATCH v2 63/93] tcg/tci: Use ffi for calls,
Peter Maydell <=
- Re: [PATCH v2 63/93] tcg/tci: Use ffi for calls, Paolo Bonzini, 2021/02/08
- Re: [PATCH v2 63/93] tcg/tci: Use ffi for calls, Stefan Weil, 2021/02/08
- Re: [PATCH v2 63/93] tcg/tci: Use ffi for calls, Richard Henderson, 2021/02/08
- Re: [PATCH v2 63/93] tcg/tci: Use ffi for calls, Stefan Weil, 2021/02/08
- Re: [PATCH v2 63/93] tcg/tci: Use ffi for calls, Richard Henderson, 2021/02/08
- Re: [PATCH v2 63/93] tcg/tci: Use ffi for calls, Richard Henderson, 2021/02/09
- Re: [PATCH v2 63/93] tcg/tci: Use ffi for calls, Stefan Weil, 2021/02/09
- Re: [PATCH v2 63/93] tcg/tci: Use ffi for calls, Stefan Weil, 2021/02/09
[PATCH v2 65/93] tcg/tci: Move call-return regs to end of tcg_target_reg_alloc_order, Richard Henderson, 2021/02/03
[PATCH v2 66/93] tcg/tci: Push opcode emit into each case, Richard Henderson, 2021/02/03