qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC PATCH 16/21] trace: add infrastructure for buildin


From: Alex Bennée
Subject: Re: [Qemu-devel] [RFC PATCH 16/21] trace: add infrastructure for building plugins
Date: Mon, 15 Oct 2018 19:16:13 +0100
User-agent: mu4e 1.1.0; emacs 26.1.50

Richard Henderson <address@hidden> writes:

> On 10/5/18 8:49 AM, Alex Bennée wrote:
>> +GLIB_CFLAGS = $(shell pkg-config --cflags glib-2.0)
>> +CFLAGS = -I$(QEMU_SRC)/include/plugins $(GLIB_CFLAGS) -fno-PIE -fPIC -O3 -g
>> +LDFLAGS = $(shell pkg-config --libs glib-2.0) -shared
>
> I'm not keen on defaulting to -O3.

Fair enough... I'll drop it down if not set...

> I'd prefer if we passed up the flags from top-level, but I know you're also
> trying to support out-of-tree builds.
>
> Perhaps
>
> CFLAGS ?= -O2 -g
> QEMU_CFLAGS = $(CFLAGS) $(GLIB_CFLAGS) -I$(QEMU_SRC)/... -fno-PIE -fPIC
>
>> +SRC = $(wildcard *.c)
>> +PLUGINS = $(addprefix $(BUILD_DIR)/,$(SRC:.c=.so))
>> +
>> +$(BUILD_DIR)/%.so: %.c
>> +    $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
>> +
>> +all: $(PLUGINS)
>
> Do you really want one plugin per source file rather than one plugin per
> directory?  I think the latter makes more sense...
>
> And of course you know the second thing people are going to want is to write
> these plugins in C++...
>
>
> r~


--
Alex Bennée



reply via email to

[Prev in Thread] Current Thread [Next in Thread]