[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH 4/6] Makefile: introduce common-obj-m and bl
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [RFC PATCH 4/6] Makefile: introduce common-obj-m and block-obj-m for DSO |
Date: |
Thu, 05 Sep 2013 21:41:02 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130805 Thunderbird/17.0.8 |
Il 05/09/2013 21:24, Richard Henderson ha scritto:
> On 09/05/2013 03:20 AM, Fam Zheng wrote:
>> 1) %.o in $(common-obj-m) is compiled to %.o, with
>> "QEMU_CFLAGS += -shared -fPIC". Then "linked" to %.mo, which is an
>> incremental object with "ln -r". This step is for consistency with
>> %.mod case and has no effect.
>
> As a general rule, you should avoid ld -r unless you know exactly
> what that implies for the given machine. This is the sort of thing
> that's highly likely to work on x86 while failing elsewhere.
>
> E.g. ARM and PPC ld would like to add trampolines for direct calls
> to reach the PLT entry. If you create one object that's too large
> then that's no longer possible.
>
> E.g. MIPS and Alpha ld require that any one input object file
> reference less than 64K worth of got entries. Every separate
> object file can address its own 64K segment of the got. If you
> combine too many objectsyou could overflow the got subsegments.
>
> If our modules are small enough, we may never see any of these, but...
>
> If you really require a single input file to ld for pattern matching
> purposes, I highly recommend an ar file, and then use --whole-archive
> to force the entire contents of the .a to be included. This preserves
> the original translation-unit boundaries for ld.
Yes, this is the reason why I suggested using libtool for this. It
increases the cost of compilation by essentially doing it twice, on the
other hand you can simply use .la convenience libraries and libtool will
be able to link it transparently into either an executable or a shared
library.
Libtool used to be really bad, but most performance problems have been
solved.
Paolo
- [Qemu-devel] [RFC PATCH 0/6] Shared Library Module Support, Fam Zheng, 2013/09/05
- [Qemu-devel] [RFC PATCH 1/6] make.rule: fix $(obj) to a real relative path, Fam Zheng, 2013/09/05
- [Qemu-devel] [RFC PATCH 2/6] rule.mak: allow per object cflags and libs, Fam Zheng, 2013/09/05
- [Qemu-devel] [RFC PATCH 3/6] Makefile: define curl cflags and libs with object, Fam Zheng, 2013/09/05
- [Qemu-devel] [RFC PATCH 4/6] Makefile: introduce common-obj-m and block-obj-m for DSO, Fam Zheng, 2013/09/05
- Re: [Qemu-devel] [RFC PATCH 4/6] Makefile: introduce common-obj-m and block-obj-m for DSO, Fam Zheng, 2013/09/06
- Re: [Qemu-devel] [RFC PATCH 4/6] Makefile: introduce common-obj-m and block-obj-m for DSO, Richard Henderson, 2013/09/06
- Re: [Qemu-devel] [RFC PATCH 4/6] Makefile: introduce common-obj-m and block-obj-m for DSO, Fam Zheng, 2013/09/06
[Qemu-devel] [RFC PATCH 5/6] module: load modules at start, Fam Zheng, 2013/09/05
[Qemu-devel] [RFC PATCH 6/6] curl: build as shared library, Fam Zheng, 2013/09/05