aboutsummaryrefslogtreecommitdiff
path: root/src/link.cpp
AgeCommit message (Collapse)Author
2018-12-26fixupsAndrew Kelley
2018-12-23msvc subsystem option handling; added uefi os typenebulaeonline
2018-11-19Merge branch 'freebsd-up' of https://github.com/myfreeweb/zig into freebsd2Andrew Kelley
2018-11-02support building static self hosted compiler on macosAndrew Kelley
* add a --system-linker-hack command line parameter to work around poor LLD macho code. See #1535 * build.zig correctly handles static as well as dynamic dependencies when building the self hosted compiler. - no more unnecessary libxml2 dependency - a static build on macos produces a completely static self-hosted compiler for macos (except for libSystem as intended).
2018-10-20Set up libc/rtld paths for FreeBSDGreg V
2018-10-20Set FreeBSD ELF OS/ABI when targetingMarc Tiehuis
Closes #553.
2018-10-09add workaround for bad LLD macos codeAndrew Kelley
2018-10-09stage1 link: compiler_rt and builtin libs know ...Andrew Kelley
...whether they will be linked with libc
2018-10-09fix error limit linker arg on windowsAndrew Kelley
2018-10-09more efficient builtin library code generationAndrew Kelley
* introduce --disable-pic option which can generally be allowed to be the default. compiler_rt.a and builtin.a get this option when you build a static executable. * compiler_rt and builtin libraries are not built for build-lib --static * posix_spawn instead of fork/execv * disable the error limit on LLD. Fixes the blank lines printed
2018-10-09support building static librariesAndrew Kelley
closes #1493 closes #54
2018-10-05on linux, link statically if not linking any shared libsAndrew Kelley
2018-10-02fix build-exe for --target-arch wasm32 (#1570)Ben Noordhuis
Pass --no-entry instead of --relocatable to lld. Both stop a reference to the _start() entry point from being emitted but --relocatable also prevents public symbols from being exported when creating an executable.
2018-10-01increase stack size on windows for all executablesAndrew Kelley
fixes test failures See #157
2018-09-30Fixes --emit asm on windows and makes C header file generation explicit. (#1612)Sahnvour
* build: only do codegen_link when emitting an actual binary. Fixes #1371 * build: only output C header file when explicitely asked to
2018-09-11ability to disable cache. off by default except for...Andrew Kelley
...zig run, zig build, compiler_rt.a, and builtin.a
2018-09-10stage1 caching: zig no longer uses zig-cacheAndrew Kelley
2018-09-10caching is workingAndrew Kelley
* add almost all the input parameter state to the hash - missing items are the detected MSVC installation on Windows and detected libc installation on POSIX - also missing are C files and .h files that libclang finds * artifacts are created in global cache directory instead of zig-cache. - exception: builtin.zig is still in zig-cache * zig run uses the new cache correctly * zig run uses execv on posix systems
2018-09-10stage1: always optimize blake and softfloat even in debug modeAndrew Kelley
2018-09-05start creating a hash of input parametersAndrew Kelley
See #1416
2018-09-04port std.os.path.resolve to stage1Andrew Kelley
2018-07-23self-hosted: basic linker code for macosAndrew Kelley
2018-07-02always link against compiler_rt.o even when linking libcAndrew Kelley
sometimes libgcc is missing things we need, so we always link compiler_rt and rely on weak linkage to allow libgcc to override.
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