WDK custom building questions

Hello there,

I recently have a project that requires building a kernel mode library with WDK build environment (VS is not an option here although it will be easier).

I encounter a scenario:

There are some specific .c sources that need to be compiled with LTCG-disabled due to some internal reasons, while others are still enabled. I tried to separate non-LTCG by moving them to children directory and update dirs as well but it didn’t work since it will build two seperated libraries.

My goal is to create a sources that can:

  • Specify which files will be compiled with LTCG, which files won’t.
  • All those sources are built to one library.

After research all around, the closest workaround I can find is to specify NTTAGETFILE1 for post-build operation, copy non-LTCG .obj to other dirs then call lib.exe to build the library. It works but I still want an official/legit approach to do it.

Any suggestion/idea is highly appreciated.
Thanks,

That is about as legit a process as it is going to get. Build.exe doesn’t allow for selective settings per file (unlike msbuild)

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of t4L
Sent: Wednesday, October 01, 2014 9:20 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] WDK custom building questions

Hello there,

I recently have a project that requires building a kernel mode library with WDK build environment (VS is not an option here although it will be easier).

I encounter a scenario:

There are some specific .c sources that need to be compiled with LTCG-disabled due to some internal reasons, while others are still enabled. I tried to separate non-LTCG by moving them to children directory and update dirs as well but it didn’t work since it will build two seperated libraries.

My goal is to create a sources that can:

  • Specify which files will be compiled with LTCG, which files won’t.
  • All those sources are built to one library.

After research all around, the closest workaround I can find is to specify NTTAGETFILE1 for post-build operation, copy non-LTCG .obj to other dirs then call lib.exe to build the library. It works but I still want an official/legit approach to do it.

Any suggestion/idea is highly appreciated.
Thanks,


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

Thanks a lot. If that’s build.exe limitation in this case, I will stick to the workaround.

Regards,

On Thursday, October 2, 2014 11:33 AM, Doron Holan wrote:

That is about as legit a process as it is going to get. Build.exe doesn’t allow for selective settings per file (unlike msbuild)

From:xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of t4L
Sent: Wednesday, October 01, 2014 9:20 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] WDK custom building questions

Hello there,

I recently have a project that requires building a kernel mode library with WDK build environment (VS is not an option here although it will be easier).

I encounter a scenario:

There are some specific .c sources that need to be compiled with LTCG-disabled due to some internal reasons, while others are still enabled. I tried to separate non-LTCG by moving them to children directory and update dirs as well but it didn’t work since it will build two seperated libraries.

My goal is to create a sources that can:

- Specify which files will be compiled with LTCG, which files won’t.
- All those sources are built to one library.

After research all around, the closest workaround I can find is to specify NTTAGETFILE1 for post-build operation, copy non-LTCG .obj to other dirs then call lib.exe to build the library. It works but I still want an official/legit approach to do it.

Any suggestion/idea is highly appreciated.
Thanks,


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

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