aboutsummaryrefslogtreecommitdiff
path: root/src/link.cpp
AgeCommit message (Collapse)Author
2017-11-13Fixed duplicate decl detection for typedefs/enumsdimenus
2017-11-03slightly more verbose error message when building object file failsAndrew Kelley
2017-11-01windows: use the same libc search within a compilation unitAndrew Kelley
2017-11-01WIN32: Linking with the CRT at runtime. (#570)Dimenus
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-10-25cleaner verbose flags and zig build prints failed commandAndrew Kelley
2017-10-24fix missing compiler_rt in release modesAndrew Kelley
the optimizer was deleting compiler_rt symbols, so I changed the linkage type from LinkOnce to Weak also changed LinkOnce to mean linkonce_odr in llvm and Weak to mean weak_odr in llvm. See #563
2017-10-16look for libc at runtime on windowsAndrew Kelley
See #539 before we close the issue we should also detect MSVC 2017 but this gets us started with supporting MSVC 2015
2017-10-16ability to make a DLLAndrew Kelley
See #302
2017-10-15clean up some resourcesAndrew Kelley
2017-10-03replace __chkstk function with a stub that does not crashAndrew Kelley
Closes #508 See #302
2017-10-03add @setAlignStack builtinAndrew Kelley
2017-10-02better compiler-rt linkage logicAndrew Kelley
now the compiler-rt tests are passing on windows. See #302
2017-10-01still build compiler-rt when linking msvc CRTAndrew Kelley
because it's missing some things
2017-10-01remove unused functionAndrew Kelley
2017-10-01support linking against MSVC libcAndrew Kelley
2017-10-01implement standard library path searchAndrew Kelley
closes #463 See #302
2017-10-01fix implementation of --zig-std-dirAndrew Kelley
see #463
2017-09-30remove zigrtAndrew Kelley
adds test case for #394 partially reverts a32b5929ccf8cbf79396d8924097a1a911985dac
2017-09-24windows gui hello worldAndrew Kelley
2017-09-23macho linking: support full lib paths correctlyAndrew Kelley
2017-09-18coff linking passes -DEBUGAndrew Kelley
which makes a .pdb file
2017-09-18add --verbose-link optionAndrew Kelley
only prints the link line
2017-08-31add windows to test targetsAndrew Kelley
cross-compiling hello world with no libc for windows is working
2017-08-30successfully cross-building behavior tests for windowsAndrew Kelley
2017-08-30tests use darwin, not macosx since that's what macbook reports asAndrew Kelley
2017-08-30test suite cross-compile builds tests for other targetsAndrew Kelley
2017-08-27all tests passing in MacOSAndrew Kelley
depends on LLD 5.0.0 with 3 patches See #273
2017-08-27all behavior tests passing for macosAndrew Kelley
See #273
2017-08-27macos updatesAndrew Kelley
* try some macos travis stuff * put c in the link libs for macos since we always link with libSystem * for non-native targets on macos, allow runtime symbol resolution - it's causing an infinite loop in LLD. * for macos, always build compiler_rt and turn on LinkOnce because compiler_rt on darwin is missing some stuff.
2017-08-26update for llvm 5.0.0rc1Andrew Kelley
2017-08-15organize file path of compiler_rtAndrew Kelley
2017-06-14progress toward windows hello world workingAndrew Kelley
2017-06-04progress toward hello world without libc in windowsAndrew Kelley
2017-05-23building with mingw for windowsAndrew Kelley
2017-05-06builtin functions for division and remainder divisionAndrew Kelley
* add `@divTrunc` and `@divFloor` functions * add `@rem` and `@mod` functions * add compile error for `/` and `%` with signed integers * add `.bit_count` for float primitive types closes #217
2017-05-02add safe release build modeAndrew Kelley
closes #288
2017-04-30zig build: organize build artifactsAndrew Kelley
closes #328
2017-04-28zig puts temporary object files in zig-cache folderAndrew Kelley
See #298
2017-04-27zig test no longer requires a separate test_runner.o fileAndrew Kelley
See #298
2017-04-26build system: consolidate duplicate code and moreAndrew Kelley
* add ability to add assembly files when building an exe, obj, or lib * add implicit cast from `[N]T` to `?[]const T` (closes #343) * remove link_exe and link_lib in favor of allowing build_exe and build_lib support no root zig source file
2017-04-25add some timing diagnosticsAndrew Kelley
pass --enable-timing-info to print a nice table like this: ``` Name Start End Duration Percent Initialize 0.0000 0.0000 0.0000 0.0001 Semantic Analysis 0.0000 0.0421 0.0420 0.2109 Code Generation 0.0421 0.0620 0.0200 0.1003 LLVM Emit Object 0.0620 0.1852 0.1231 0.6180 Build Dependencies 0.1852 0.1974 0.0122 0.0615 LLVM Link 0.1974 0.1993 0.0018 0.0093 Generate .h 0.1993 0.1993 0.0000 0.0000 Total 0.0000 0.1993 0.1993 1.0000 ```
2017-04-19convert assemble and link tests to zig build systemAndrew Kelley
2017-04-13fix crash when using zig to linkAndrew Kelley
without explicit dynamic linker
2017-04-11run alwaysinline pass in debug modeAndrew Kelley
before this commit, the optimized IR code that is displayed in --verbose mode is not actually what gets emitted to an object file. that is now corrected, and we make sure to run the alwaysinliner pass even in debug mode, so you can rely on "inline" keyword inlining a function, guaranteed. See #306
2017-04-10fix some -Wconversion errorsAndrew Kelley
2017-04-05add support to use zig as a linker driverAndrew Kelley
closes #243 I also added --grep to ./run_tests if you want to single out some specific tests
2017-04-04link: correctly print debug linker invocationAndrew Kelley
2017-04-04link: fix ignoring first linker argAndrew Kelley
LLD treats the first argument as arg[0], the exe name
2017-04-03link: delete code that checks the linker versionAndrew Kelley
since we depend on LLD for linking
2017-03-26add stack protector safety when linking libcAndrew Kelley
* introduce zigrt file. it contains only weak symbols so that multiple instances can be merged. it contains __zig_panic so that multiple .o files can call the same panic function. * remove `@setFnVisible` builtin and add @setGlobalLinkage builtin which is more powerful * add `@panic` builtin function. * fix collision of symbols with extern prototypes and internal function names * add stack protector safety when linking against libc. To add the safety mechanism without libc requires implementing Thread Local Storage. See #276