From: Michael Tokarev <mjt@tls.msk.ru>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC PATCH 0/4] per-object libraries
Date: Thu, 20 Jun 2013 00:00:14 +0400 [thread overview]
Message-ID: <51C20DCE.6080502@msgid.tls.msk.ru> (raw)
In-Reply-To: <51C1FDF8.5030104@redhat.com>
19.06.2013 22:52, Paolo Bonzini wrote:
> Il 19/06/2013 20:18, Michael Tokarev ha scritto:
>> Currently I expand it like this:
>>
>> $(foreach m, $(filter %.o,$1), $($(m:%.o=%.libs)))
>>
>> Probably I can change that to
>>
>> $(foreach m, $(filter %.o,$1), $($(m:%.o=./%.libs)))
>>
>> (here and in other similar cases), and it will work without changing
>> anything around $(obj).
>>
>> But maybe we can argee here that this is not really OBJect, it is
>> a path or dir, and name it $(d) or $(p) instead of $(obj) ? To
>> include the slash when needed. just like I did for $(obj).
>
> I chose $(obj) because that's what Kbuild uses.
kbuild almost never requires this variable in "user" makefiles
(not counting kbuild internals), -- because of recursive way
of its working there's no need to prepend directory names like
qemu makefiles currently do, "user" makefiles refer to files
using bare (no path) names.
Contrary to that, qemu does not recurse, it tries to do everything
in one instance, so it can expand just a few "magic" variables,
and for everything else we have to explicitly use that prefix.
So that it becomes inconsistent (some vars require prefix, some
don't), and too verbose.
In this context, maybe it is good idea to actually get rid of
both issues -- being inconsistent (the more per-object flags
we add, the more inconsisten it becomes, since more and more
variables requires the prefix), and make it as short as possible
(so that using one-char variable name is better than 3-char).
(by "user" I mean regular makefiles used in various places in
the kernel, as opposed to kbuild internals).
>>>> Also, for the inevitable bikeshedding, I would prefer
>>>>
>>>> cflags-$(obj)/curl.o-y
>>>> libs-$(obj)/curl.o-y
>> What are all these -y suffixes for? In existing variables and in
>> this new your invention? It's already a bit too verbose.
>
> It is so that you can do
>
> foo-$(CONFIG_XYZ) += blah
>
> instead of
>
> ifeq ($(CONFIG_XYZ),y)
> FOO += blah
> endif
Yes, that sure I undertand -- obj-y, block-m etc. I'm asking
about those new vars yuo propose -- why you want -y sufffix
*there*, like cflags-foo.o-y ?
Do you want to be able to specify different flags for -y and -m
builds? Isn't it a bit too much?
>> BTW, can you take a look why your expand-nesting does not remove
>> the save- variables properly? Run make with -p and see which
>> vars are defined. (This is really BTW, you just reminded me
>> about something I've seen but had no chance to look at).
>
> Because I didn't bother. :)
Actually you did - you tried to clean things up a bit, but some
dirt is still there.
>>> common.o: $(patsubst %,../%, $(common-obj-y))
>>> $(LD) -r -o $@ $^
>>>
>>> and then link common.o into the QEMU target.
>
> I think that would make it a bit more complex to gather all the required
> libs. But it is probably not insurmountable.
Yes, definitely.
>>>> Libtool can also be used
>>>> to abstract "ld -r". Making libtool mandatory wouldn't be a problem IMO
>>>> (we'd need it anyway for modules) as long as you do not need libtool to
>>>> start QEMU or gdb from the build directory.
>> Do we really need it for modules? I'm not sure. Actually, in a modern
>> world, I'm not really sure libtool is needed if you only count "major"
>> operating systems.
>
> Do you also count one major proprietary operating system? Unfortunately
> mingw still requires magic to create shared libraries.
Sure. But it's not alot really.
Thanks,
/mjt
next prev parent reply other threads:[~2013-06-19 20:00 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-18 17:34 [Qemu-devel] [RFC PATCH 0/4] per-object libraries Michael Tokarev
2013-06-18 17:34 ` [Qemu-devel] [RFC PATCH 1/4] build-sys: strip leading ./ from $(obj) Michael Tokarev
2013-06-18 17:34 ` [Qemu-devel] [RFC PATCH 2/4] build-sys: allow object-specific libraries to be used to link executables Michael Tokarev
2013-06-18 17:34 ` [Qemu-devel] [RFC PATCH 3/4] build-sys: allow per-object foo.cflags variables Michael Tokarev
2013-06-18 17:34 ` [Qemu-devel] [RFC PATCH 4/4] build-sys: move -lcurl out of libs and specify it for curl.o Michael Tokarev
2013-06-19 0:41 ` [Qemu-devel] [RFC PATCH 0/4] per-object libraries Michael Tokarev
2013-06-19 14:16 ` Stefan Hajnoczi
2013-06-19 14:58 ` Michael Tokarev
2013-06-19 16:46 ` Paolo Bonzini
2013-06-19 16:58 ` Paolo Bonzini
2013-06-19 18:18 ` Michael Tokarev
2013-06-19 18:52 ` Paolo Bonzini
2013-06-19 19:31 ` Richard Henderson
[not found] ` <51C2D03E.2030505@redhat.com>
2013-06-20 10:06 ` Peter Maydell
2013-06-20 12:39 ` Paolo Bonzini
2013-06-20 12:50 ` Peter Maydell
2013-06-20 17:09 ` Richard Henderson
2013-06-19 20:00 ` Michael Tokarev [this message]
2013-06-20 10:09 ` Paolo Bonzini
2013-06-30 15:23 ` Michael Tokarev
2013-07-01 10:08 ` Paolo Bonzini
2013-07-01 10:10 ` Michael Tokarev
2013-07-01 10:18 ` Paolo Bonzini
2013-06-30 15:28 ` Andreas Färber
2013-06-30 15:36 ` Michael Tokarev
2013-06-30 15:51 ` Peter Maydell
2013-06-30 16:49 ` Michael Tokarev
2013-07-01 8:00 ` Stefan Hajnoczi
2013-06-30 15:56 ` Andreas Färber
2013-07-01 13:39 ` Paolo Bonzini
2013-07-01 14:43 ` Michael Tokarev
2013-07-01 14:46 ` Andreas Färber
2013-07-01 14:52 ` Michael Tokarev
2013-07-01 14:53 ` Paolo Bonzini
2013-07-01 15:06 ` Michael Tokarev
2013-07-01 15:20 ` Paolo Bonzini
2013-07-01 15:52 ` Michael Tokarev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51C20DCE.6080502@msgid.tls.msk.ru \
--to=mjt@tls.msk.ru \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.