[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [patch #6448] [MSVC 7/7] Add MSVC Support
From: |
Ralf Wildenhues |
Subject: |
Re: [patch #6448] [MSVC 7/7] Add MSVC Support |
Date: |
Thu, 14 Aug 2008 23:44:49 +0200 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
* Peter Rosin wrote on Wed, Aug 13, 2008 at 10:12:23PM CEST:
>> 24: link-order.at:26 Link order test.
>> Exporting int c variable.
>
> With MSVC, you can declare any variable with __decspec(dllimport), even
> if you are not actually importing it. The only thing that happens is
> that you get an extra indirection in the generated code. This is a
> small price to pay,
The relative cost of extra indirection quite depends on the way it is
used.
To give you an extreme, but real-world example, using Autoconf with the
master branch of GNU m4 is 15% slower with PIC code than without (for an
example package; this amounts to 4 seconds), on GNU/Linux. That's
basically the overhead of having to go through the GOT indirection.
(Disclaimer: I haven't tried to use PIC objects in a static link.)
I don't know whether the dllimport indirection is as costly though.
Of course for our examples in the test suite it's not the overhead that
matters.
> when the gain is that you don't need to compile
> things differently depending on how you are going to link with the
> library. The situation is quite similar to pic/non-pic, but the trouble
> is that the difference is in the library consumer and not when
> producing the library.
Yep.
> So, ignoring the runtime performance penalty, patch things up like
> this:
Thanks, please apply.
Cheers,
Ralf
> 2008-08-13 Peter Rosin <address@hidden>
>
> * tests/link-order.at [MSVC]: Always dllimport exported
> variables.
- Re: [patch #6448] [MSVC 7/7] Add MSVC Support, (continued)
- Re: [patch #6448] [MSVC 7/7] Add MSVC Support, Ralf Wildenhues, 2008/08/09
- Re: [patch #6448] [MSVC 7/7] Add MSVC Support, Peter Rosin, 2008/08/09
- Re: [patch #6448] [MSVC 7/7] Add MSVC Support, Peter Rosin, 2008/08/09
- Re: [patch #6448] [MSVC 7/7] Add MSVC Support, Ralf Wildenhues, 2008/08/11
- Re: [patch #6448] [MSVC 7/7] Add MSVC Support, Brian Dessent, 2008/08/11
- Re: [patch #6448] [MSVC 7/7] Add MSVC Support, Peter Rosin, 2008/08/13
- Re: [patch #6448] [MSVC 7/7] Add MSVC Support, Ralf Wildenhues, 2008/08/14
- Re: [patch #6448] [MSVC 7/7] Add MSVC Support, Peter Rosin, 2008/08/15
- Re: [patch #6448] [MSVC 7/7] Add MSVC Support, Ralf Wildenhues, 2008/08/16
- Re: [patch #6448] [MSVC 7/7] Add MSVC Support, Peter Rosin, 2008/08/13
- Re: [patch #6448] [MSVC 7/7] Add MSVC Support,
Ralf Wildenhues <=
FW: [patch #6448] [MSVC 7/7] Add MSVC Support, Markus Duft, 2008/08/22