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: Richard Henderson
Subject: Re: [Qemu-devel] [RFC PATCH 16/21] trace: add infrastructure for building plugins
Date: Mon, 15 Oct 2018 10:24:01 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1

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.
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~



reply via email to

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