Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Before Posting...
Please check out the Community Guidelines in the Announcements and Administration Category.

Possible MSDN doc err: Link-time code generation and precompiled headers

Maxim_S._ShatskihMaxim_S._Shatskih Member Posts: 10,396
Can MS employees here confirm whether the modern (CL >= 14) compilers are fine combining "link-time code generation" aka "whole program optimization" (LTCG or /GL) with precompiled headers?

MSDN page says that this combination is not safe in some scenarios, since the PCH file is a must for link phase of LTCG, thus LTCG cannot be used for LIBs shared across machines.

Nevertheless, the practical attempt (linking a LIB with all its source, PCH and OBJ files deleted and full path to the build dir renamed to break the possible embedded full pathnames in the LIB) says it works with WDK 6001.18002, which uses LTCG for x64 builds.

Also, the MS's person on Answers said that these features should not and do not have interops.

Is the MSDN page obsolete?

--
Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com

Comments

  • Doron_HolanDoron_Holan Member - All Emails Posts: 10,428
    I don't understand the question. You can use PCH and LTCG. The fragility of LTCG is that it embeds cl version specific information into the lib, IOW you can't take an ltcg lib from cl v.Foo and use it with v.Foo+1, you need to strip out the ltcg'ness first (link /cvtcil)

    d

    -----Original Message-----
    From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Maxim S. Shatskih
    Sent: Thursday, May 29, 2014 7:37 AM
    To: Windows System Software Devs Interest List
    Subject: [ntdev] Possible MSDN doc err: Link-time code generation and precompiled headers

    Can MS employees here confirm whether the modern (CL >= 14) compilers are fine combining "link-time code generation" aka "whole program optimization" (LTCG or /GL) with precompiled headers?

    MSDN page says that this combination is not safe in some scenarios, since the PCH file is a must for link phase of LTCG, thus LTCG cannot be used for LIBs shared across machines.

    Nevertheless, the practical attempt (linking a LIB with all its source, PCH and OBJ files deleted and full path to the build dir renamed to break the possible embedded full pathnames in the LIB) says it works with WDK 6001.18002, which uses LTCG for x64 builds.

    Also, the MS's person on Answers said that these features should not and do not have interops.

    Is the MSDN page obsolete?

    --
    Maxim S. Shatskih
    Microsoft MVP on File System And Storage xxxxx@storagecraft.com http://www.storagecraft.com


    ---
    NTDEV is sponsored by OSR

    Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

    OSR is HIRING!! See http://www.osr.com/careers

    For our schedule of WDF, WDM, debugging and other seminars visit:
    http://www.osr.com/seminars

    To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
    d
  • Maxim_S._ShatskihMaxim_S._Shatskih Member Posts: 10,396
    Thank Doron!

    MSDN page on /GL option says:

    ".obj files produced with /GL and precompiled header files should not be used to build a .lib file unless the .lib file will be linked on the same machine that produced the /GL .obj file. Information from the .obj file's precompiled header file will be needed at link time."

    Is it still true for modern compilers?

    "Doron Holan" <xxxxx@microsoft.com> wrote in message news:xxxxx@ntdev...
    >I don't understand the question. You can use PCH and LTCG. The fragility of LTCG is that it embeds cl version specific information into the lib, IOW you can't take an ltcg lib from cl v.Foo and use it with v.Foo+1, you need to strip out the ltcg'ness first (link /cvtcil)
    >
    > d
    >
    > -----Original Message-----
    > From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Maxim S. Shatskih
    > Sent: Thursday, May 29, 2014 7:37 AM
    > To: Windows System Software Devs Interest List
    > Subject: [ntdev] Possible MSDN doc err: Link-time code generation and precompiled headers
    >
    > Can MS employees here confirm whether the modern (CL >= 14) compilers are fine combining "link-time code generation" aka "whole program optimization" (LTCG or /GL) with precompiled headers?
    >
    > MSDN page says that this combination is not safe in some scenarios, since the PCH file is a must for link phase of LTCG, thus LTCG cannot be used for LIBs shared across machines.
    >
    > Nevertheless, the practical attempt (linking a LIB with all its source, PCH and OBJ files deleted and full path to the build dir renamed to break the possible embedded full pathnames in the LIB) says it works with WDK 6001.18002, which uses LTCG for x64 builds.
    >
    > Also, the MS's person on Answers said that these features should not and do not have interops.
    >
    > Is the MSDN page obsolete?
    >
    > --
    > Maxim S. Shatskih
    > Microsoft MVP on File System And Storage xxxxx@storagecraft.com http://www.storagecraft.com
    >
    >
    > ---
    > NTDEV is sponsored by OSR
    >
    > Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
    >
    > OSR is HIRING!! See http://www.osr.com/careers
    >
    > For our schedule of WDF, WDM, debugging and other seminars visit:
    > http://www.osr.com/seminars
    >
    > To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
    >
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Upcoming OSR Seminars
Writing WDF Drivers 25 Feb 2019 OSR Seminar Space
Developing Minifilters 8 April 2019 OSR Seminar Space