aboutsummaryrefslogtreecommitdiff
path: root/src/link.cpp
AgeCommit message (Collapse)Author
2018-06-16add basic std lib code for loading dynamic librariesAndrew Kelley
this is going to only work for very basic libraries; I plan to slowly add more features over time to support more complicated libraries
2018-06-09support `--target-arch wasm32` (#1094)Ben Noordhuis
Add wasm32 support to the build-obj, build-exe and build-lib commands of the stage 1 compiler. Wasm64 should work transparently once it's supported in upstream LLVM. To export a function: // lib.zig - for exposition, not necessary for this example pub use @import("add.zig"); // add.zig export fn add(a: i32, b: i32) i32 { return a + b; } To import a function: // cube.zig extern fn square(x: i32) i32; export fn cube(x: i32) i32 { return x * square(x); }
2018-04-18add --no-rosegment cli optionAndrew Kelley
this provides a workaround for #896 until valgrind adds support for clang/LLD (equivalent to gcc/gold -rosegment)
2018-03-31musl-friendly dynamic linkingAndrew Kelley
2018-03-31fix regressions on windowsAndrew Kelley
2018-03-30find libc and zig std lib at runtimeAndrew Kelley
this removes the following configure options: * ZIG_LIBC_LIB_DIR * ZIG_LIBC_STATIC_LIB_DIR * ZIG_LIBC_INCLUDE_DIR * ZIG_DYNAMIC_LINKER * ZIG_EACH_LIB_RPATH * zig's reliance on CMAKE_INSTALL_PREFIX these options are still available as command line options, however, the default will attempt to execute the system's C compiler to collect system defaults for these values. closes #870
2018-03-10zen-specific: main -> _startAndrea Orru
2018-01-07Adding zen supportAndrea Orru
2018-01-06Darwin -> MacOSX, added Zen. See #438Andrea Orru
2018-01-03fix self hosted compiler on windowsAndrew Kelley
2017-12-26self-hosted: build against zig_llvm and embedded LLDAndrew Kelley
Now the self-hosted compiler re-uses the same C++ code for interfacing with LLVM as the C++ code. It also links against the same LLD library files.
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