0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00
zig/src/link.cpp

951 lines
31 KiB

2017-08-15 07:16:22 -04:00
2016-02-15 20:56:52 -07:00
2017-10-15 21:06:04 -04:00
2017-08-15 07:16:22 -04:00
2017-03-13 11:54:56 -04:00
2017-03-13 11:54:56 -04:00
2017-02-03 12:34:20 -05:00
2016-09-01 11:05:36 -07:00
2016-09-01 11:05:36 -07:00
2017-05-23 00:26:12 -04:00
2017-05-23 00:26:12 -04:00
2017-03-13 11:54:56 -04:00
2017-03-13 11:54:56 -04:00
2016-09-01 11:05:36 -07:00
2017-08-15 07:16:22 -04:00
2016-02-13 23:03:16 -07:00
2017-10-01 21:07:02 -04:00
2017-03-13 11:54:56 -04:00
2017-10-01 21:05:08 -04:00
2017-10-16 01:14:28 -04:00
2017-10-01 21:05:08 -04:00
WIN32: Linking with the CRT at runtime. (#570) Disclaimer: Forgive me if my format sucks, I've never submitted a PR before! Fixes: #517 I added a few things to allow zig to link with the CRT properly both statically and dynamically. In Visual Studio 2017, Microsoft changed how the c-runtime is factored again. With this change, they also added a COM interface to allow you to query the respective Visual Studio instance for two of them. This does that and also falls back on a registry query for 2015 support. If you're using a Visual Studio instance older than 2015, you'll have to use the existing options available with the zig compiler. Changes are listed below along with a general description of the changes. all_types.cpp: The separate variables for msvc/kern32 have been removed and all win32 libc directory paths have been combined into a ZigList since we're querying more than two directories and differentiating one from another doesn't matter to lld. analyze.cpp: The existing functions were extended to support querying libc libs & libc headers at runtime. codegen.cpp/hpp: Microsoft uses the new 'Universal C Runtime' name now. Doesn't matter from a functionality standpoint. I left the compiler switches as is to not introduce any breaking changes. link.cpp: We're linking 4 libs and generating another in order to support the UCRT. Dynamic: msvcrt/d, vcruntime/d, ucrt/d, legacy_stdio_definitions.lib Static: libcmt/d, libvcruntime/d libucrt/d, legacy_stdio_definitions.lib main.cpp: Update function call names. os.cpp/hpp: COM/Registry interface for querying Windows UCRT/SDK. Sources: [Windows CRT](https://docs.microsoft.com/en-us/cpp/c-runtime-library/crt-library-features) [VS 2015 Breaking Changes](https://msdn.microsoft.com/en-us/library/bb531344.aspx)
2017-11-01 14:33:14 -05:00
2018-01-03 04:55:16 -05:00
WIN32: Linking with the CRT at runtime. (#570) Disclaimer: Forgive me if my format sucks, I've never submitted a PR before! Fixes: #517 I added a few things to allow zig to link with the CRT properly both statically and dynamically. In Visual Studio 2017, Microsoft changed how the c-runtime is factored again. With this change, they also added a COM interface to allow you to query the respective Visual Studio instance for two of them. This does that and also falls back on a registry query for 2015 support. If you're using a Visual Studio instance older than 2015, you'll have to use the existing options available with the zig compiler. Changes are listed below along with a general description of the changes. all_types.cpp: The separate variables for msvc/kern32 have been removed and all win32 libc directory paths have been combined into a ZigList since we're querying more than two directories and differentiating one from another doesn't matter to lld. analyze.cpp: The existing functions were extended to support querying libc libs & libc headers at runtime. codegen.cpp/hpp: Microsoft uses the new 'Universal C Runtime' name now. Doesn't matter from a functionality standpoint. I left the compiler switches as is to not introduce any breaking changes. link.cpp: We're linking 4 libs and generating another in order to support the UCRT. Dynamic: msvcrt/d, vcruntime/d, ucrt/d, legacy_stdio_definitions.lib Static: libcmt/d, libvcruntime/d libucrt/d, legacy_stdio_definitions.lib main.cpp: Update function call names. os.cpp/hpp: COM/Registry interface for querying Windows UCRT/SDK. Sources: [Windows CRT](https://docs.microsoft.com/en-us/cpp/c-runtime-library/crt-library-features) [VS 2015 Breaking Changes](https://msdn.microsoft.com/en-us/library/bb531344.aspx)
2017-11-01 14:33:14 -05:00
2017-10-01 21:05:08 -04:00
WIN32: Linking with the CRT at runtime. (#570) Disclaimer: Forgive me if my format sucks, I've never submitted a PR before! Fixes: #517 I added a few things to allow zig to link with the CRT properly both statically and dynamically. In Visual Studio 2017, Microsoft changed how the c-runtime is factored again. With this change, they also added a COM interface to allow you to query the respective Visual Studio instance for two of them. This does that and also falls back on a registry query for 2015 support. If you're using a Visual Studio instance older than 2015, you'll have to use the existing options available with the zig compiler. Changes are listed below along with a general description of the changes. all_types.cpp: The separate variables for msvc/kern32 have been removed and all win32 libc directory paths have been combined into a ZigList since we're querying more than two directories and differentiating one from another doesn't matter to lld. analyze.cpp: The existing functions were extended to support querying libc libs & libc headers at runtime. codegen.cpp/hpp: Microsoft uses the new 'Universal C Runtime' name now. Doesn't matter from a functionality standpoint. I left the compiler switches as is to not introduce any breaking changes. link.cpp: We're linking 4 libs and generating another in order to support the UCRT. Dynamic: msvcrt/d, vcruntime/d, ucrt/d, legacy_stdio_definitions.lib Static: libcmt/d, libvcruntime/d libucrt/d, legacy_stdio_definitions.lib main.cpp: Update function call names. os.cpp/hpp: COM/Registry interface for querying Windows UCRT/SDK. Sources: [Windows CRT](https://docs.microsoft.com/en-us/cpp/c-runtime-library/crt-library-features) [VS 2015 Breaking Changes](https://msdn.microsoft.com/en-us/library/bb531344.aspx)
2017-11-01 14:33:14 -05:00
2017-10-01 21:05:08 -04:00
2018-01-03 04:55:16 -05:00
2017-10-16 01:14:28 -04:00
2017-09-24 03:54:59 -04:00
2017-10-16 01:14:28 -04:00
2017-08-15 07:16:22 -04:00
2017-09-24 03:54:59 -04:00
2017-09-24 03:54:59 -04:00
2017-09-24 03:54:59 -04:00
2017-09-24 03:54:59 -04:00
2016-02-13 23:03:16 -07:00
2017-10-01 21:05:08 -04:00
2017-10-01 21:05:08 -04:00
2017-10-01 21:05:08 -04:00
2017-10-01 21:05:08 -04:00
2017-10-01 21:05:08 -04:00
2017-10-01 21:05:08 -04:00
2017-10-01 21:05:08 -04:00
2016-02-15 20:56:52 -07:00
2017-04-10 20:02:39 -04:00
2016-02-15 20:56:52 -07:00
2017-04-10 20:02:39 -04:00
2016-02-15 20:56:52 -07:00
2017-04-10 20:02:39 -04:00
2016-02-15 20:56:52 -07:00
2016-02-15 20:56:52 -07:00
2016-02-15 20:56:52 -07:00
2017-03-13 11:54:56 -04:00
2016-02-15 20:56:52 -07:00
2016-02-15 20:56:52 -07:00
2016-02-15 20:56:52 -07:00
2016-02-15 20:56:52 -07:00
2016-02-15 20:56:52 -07:00
2016-02-15 20:56:52 -07:00
2016-02-15 20:56:52 -07:00
2016-02-15 20:56:52 -07:00
2016-02-15 20:56:52 -07:00
2016-02-15 20:56:52 -07:00
2017-03-13 11:54:56 -04:00
2017-03-13 11:54:56 -04:00
2017-06-19 21:36:54 -04:00
2017-03-13 11:54:56 -04:00
2017-03-13 11:54:56 -04:00