15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Function-Level Linking

Lance Lovette -- lovette@iftech.com
Tuesday, July 30, 1996

Environment: [MSVC 4.2, NT 3.51 SP4 ]

What controls whether the function-level linking option (/Gy) is enabled =
or
disabled in the Project Settings dialog? It seems to be enabled for Debug=

builds and disabled for Release builds. Why does the IDE not want you to
have a release build with function-level linking? I have noticed that
changing the optimizations to something other than Maximize Speed will en=
able
it.

Thanks,

Lance
lovette@iftech.com

+------------------------------------------------------------------------=
-----+
Interface Technologies, Inc.

For a collection of free tutorials covering a variety of programming and
computer-related topics such as Visual C++, MFC, and Windows NT check out=

the ITI On-line Training Center at http://www.iftech.com.



Ken Mayger -- kmayger@atlcom.net
Sunday, August 04, 1996

Lance,

Function level linking was originally created to make smaller EXEs.  It's 
like the idea of a library tha is linked into a program, only the objs that 
are called are actually included in the EXE.  Function level linking in 
essence turns OBJs into small libraries and each function is only linked in 
if it is called.  This was a bigger deal back in the DOS days when the 
EXE's footprint meant more.  By default, I believe the linker will remove 
any unreferenced packaged functions (/PACKFUNCTIONS).  Add a NO to the same 
flag and it will link in any OBJ you through at it regardless of if the 
code inside is ever called.  As to why the speed optimizations are turning 
it off is anyone's guess.  Hope this helps.

Later,
Ken

----------
From: 	Lance Lovette[SMTP:Lovette@iftech.com]
Sent: 	Tuesday, July 30, 1996 5:13 PM
To: 	'mfc-l'
Subject: 	Function-Level Linking

Environment: [MSVC 4.2, NT 3.51 SP4 ]

What controls whether the function-level linking option (/Gy) is enabled =
or
disabled in the Project Settings dialog? It seems to be enabled for Debug=

builds and disabled for Release builds. Why does the IDE not want you to
have a release build with function-level linking? I have noticed that
changing the optimizations to something other than Maximize Speed will en=
able
it.

Thanks,

Lance
lovette@iftech.com

+------------------------------------------------------------------------=
-----+
Interface Technologies, Inc.

For a collection of free tutorials covering a variety of programming and
computer-related topics such as Visual C++, MFC, and Windows NT check out=

the ITI On-line Training Center at http://www.iftech.com.

     +---------------------------------------------------------------+
     |        You can get Farcast Droids!  Free for 60 days!         |
     |             Visit us at:  http://www.farcast.com              |
     +---------------------------------------------------------------+



begin 600 WINMAIL.DAT
M>)\^(B@,`0:0" `$```````!``$``0>0!@`(````Y 0```````#H``$-@ 0`
M`@````(``@`!!) &``P!```!````# ````,``# #````"P`/#@`````"`?\/
M`0```#\`````````@2L?I+ZC$!F=;@#=`0]4`@````!M9F,M;$!N971C;VTN
M8V]M`%--5% `;69C+6Q ;F5T8V]M+F-O;0``'@`", $````%````4TU44 ``
M```>``,P`0```!$```!M9F,M;$!N971C;VTN8V]M``````,`%0P!`````P#^
M#P8````>``$P`0```!,````G;69C+6Q ;F5T8V]M+F-O;2<```(!"S !````
M%@```%--5% Z349#+4Q 3D540T]-+D-/30````,``#D`````"P! .@$````"
M`?8/`0````0````````#/RP!"( '`!@```!)4$TN36EC`!X,`0````4```!33510`````!X`'PP!````$P```&MM87EG97) 871L
M8V]M+FYE= ```P`&$,!4%? #``<0`@8``!X`"! !````90```$Q!3D-%+$95
M3D-424].3$5614Q,24Y+24Y'5T%33U))1TE.04Q,64-214%414143TU!2T53
M34%,3$5215A%4TE44TQ)2T542$5)1$5!3T9!3$E"4D%2651(04E33$E.2T5$
M24X``````@$)$ $```#L!0``Z 4``,<*``!,6D9U@*\&B_\`"@$/`A4"J 7K
M`H,`4 +R"0(`8V@*P'-E=#(W!@`&PP*#,@/%`@!P)S=&5M`H,S=P+D
M!Q,"@'T*@ C/"=D[\18/,C4U`H *@0VQ"V#@;F82$B^&]B:@0@(H$%0 K 'W">8Q^R'O ED@#0='4>
M0_T+@&,*0 VP(T(A$R 1(%'_'#\=1">A!Y 1L!L1'P`(L#02!;!E(%%"0QYP#;%A=6QT)$!)_S"0'/ (D!S@(1,B\P7 `_#_
M*\$6$ 1@-D$`\"TF!" H+U!!0P!+
M1E5.0U1)3\A.4RD@44%D)B$'L/9/'P(A(G,D(!]P&.$=@'\LDB\!-R,=(B>2
M-^(J\2#.>0A@(1$#8'5G+0`E8?LO`1809PL1', $$2&Q+M'_(2(%H VP(U$`
MD$%"!"  >\&\%, =P:7K_'L YTR62*I(I
MHP5 (; NX=,LA`D!E0%M33510.E.%0),&D$X1
M:"X%H&U=3P_?4!T&8 (P44]26U1'$3)A321 2C6 'G S,"1 ,0`Y.38@-3HQ
M,Y@@4$U5CU =5&]7SXE26R=M$6 M;"=;CWU6GG4E`$XA7:]26RAV+3I,'--,
M'31*;TMS,S:'3.<:14WF16YV:0-@%FX'@%>B6P7@5D,@2#0N,B1 3E1:<"["
M-1K04U T(%5V"H7>5R52!: ", -@;#*3(2'_!< A(BTF7\ 2E!TQXP`F >X3UW"H4%L J%9 0`< 0GI5#_`V!B(@91`D =800@<7 '0-TC
M\#\@<1^ ">!M0P,U\,=OUP(0!R-V'_>)DW
M$2$@;6\=-'/A>]1Z@?YI.+(E0@J%$7$9$!UB)+-_1$LK8@-P;-%NHVSE`Y%-
M[&%X1&(?<%-#XS J@3\?$ <"&Q(]5$
M<):2+*#;@#8#<'"5H 20+7Q1'L5F<'^@!"!S=2SQ';%60P0`)K$@0RLK)$!-
M;$9#)$ LDE<+@'FP=[\'H6HP$7 %D#&0"&!T=@W_>@,ZP"K@;>$+@)'A(C +
M@%T=8D-7D1_A)6%H`D!PT#HO+W>A$"Y4V$A]?Z+3BX^D/Z5/IBN0YJ+3?/NB
MU"!@63[!)= #H##04.$_"L ET!/ ,A #8"%@:\2\!=2QQ8E&@FO\U8*ES53*LZZO\HS^RK[._OZ9O9=]F[V?Y"H45
M,0"Y8 ,`$! ``````P`1$ ````! ``>'N"NP% ``@P(/U>>'N"NP$>
5`#T``0````4```!213H@`````$10
`
end




Mike Blaszczak -- mikeblas@nwlink.com
Wednesday, August 07, 1996

[Mini-digest: 2 responses]

At 11:19 PM 8/4/96 -0400, you wrote:
>By default, I believe the linker will remove 
>any unreferenced packaged functions (/PACKFUNCTIONS). 

The 4.2 Linker, which Lance said he was using, has no such option. 
I think that this option was only on the 16-bit linkers.

.B ekiM
http://www.nwlink.com/~mikeblas/
These words are my own. I do not speak on behalf of Microsoft.

-----From: Dan Kirby 

/O1 and /O2 options encapsulate /Gy.  When these options are set, you can 
not turn off the /Gy and therefore this option is disables with the 
smallest code  or fastest code  optimizations.
--dan



Bok Nan Lo -- lo@ia-us.com
Monday, August 12, 1996

On Wednesday, August 07, 1996 11:35 PM, Mike 
Blaszczak[SMTP:mikeblas@nwlink.com] wrote:
> [Mini-digest: 2 responses]
>
> At 11:19 PM 8/4/96 -0400, you wrote:
> >By default, I believe the linker will remove
> >any unreferenced packaged functions (/PACKFUNCTIONS).
>
> The 4.2 Linker, which Lance said he was using, has no such option.
> I think that this option was only on the 16-bit linkers.
>
> .B ekiM
> http://www.nwlink.com/~mikeblas/
> These words are my own. I do not speak on behalf of Microsoft.
>
> -----From: Dan Kirby 
>
> /O1 and /O2 options encapsulate /Gy.  When these options are set, you can 
> not turn off the /Gy and therefore this option is disables with the
> smallest code  or fastest code  optimizations.
> --dan
>
>

Function level linking is available in VC 4.2:

Project Settings, C/C++, Customize -- Enable function-level linking

The checkbox is grayed out most of the time, but if you attempt to build a 
DLL with linking to some static libraries, the option will magically 
appear. I've only seen this option turned up once while messing around with 
a static linking of MFC libraries (mfco42.dll) into my OCX by re-compiling 
the library in hope that I can get rid of MFC runtime DLLs (of course I did 
not get it to work).

As a side, I spent only an hour messing around with static linking of an 
OCX to MFC static libraries, and this time it has only produced 2 errors, 
compared to hundreds in previous version (v4.0). Perhaps the MFC team is 
working very hard to enable static linking of MFC libraries to an OCX due 
to the pressure from the ActiveX Internet Control to create a smaller sized 
(I mean we do not need MFC4x.DLL) OCX?


--
Bok Nan Lo
IA Corporation
Phone: 510-4506871 Fax: 510-4507099
E-Mail: lo@ia-us.com




| Вернуться в корень Архива |