aboutsummaryrefslogtreecommitdiff
path: root/src/link.cpp
AgeCommit message (Collapse)Author
2019-03-06cross compile glibc startup filesAndrew Kelley
2019-03-06support other architectures for glibc startup filesAndrew Kelley
2019-03-05build libunwind.a from source and link itAndrew Kelley
2019-03-05support glibc dl, m, pthread, rtAndrew Kelley
2019-03-05dynamic linker path is independent from libc installationAndrew Kelley
2019-03-05stop linking against gcc filesAndrew Kelley
2019-03-05support crtbegin.o and crtend.o when using explicit libcAndrew Kelley
2019-03-05building glibc from sourceAndrew Kelley
2019-03-04initial glibc supportAndrew Kelley
2019-03-02rename std lib files to new conventionAndrew Kelley
2019-03-02compile error for import outside package pathAndrew Kelley
closes #2024 there's a new cli option `--main-pkg-path` which you can use to choose a different root package directory besides the one inferred from the root source file and a corresponding build.zig API: foo.setMainPkgPath(path)
2019-02-27uefi os: better auto detection of subsystemAndrew Kelley
2019-02-26breaking changes to the way targets work in zigAndrew Kelley
* CLI: `-target [name]` instead of `--target-*` args. This matches clang's API. * `builtin.Environ` renamed to `builtin.Abi` - likewise `builtin.environ` renamed to `builtin.abi` * stop hiding the concept of sub-arch. closes #1526 * `zig targets` only shows available targets. closes #438 * include all targets in readme, even those that don't print with `zig targets` but note they are Tier 4 * refactor target.cpp and make the naming conventions more consistent * introduce the concept of a "default C ABI" for a given OS/Arch combo. As a rule of thumb, if the system compiler is clang or gcc then the default C ABI is the gnu ABI.
2019-02-25fix not finding libgcc_s when looking for native libcAndrew Kelley
closes #2011
2019-02-25building DLLs on Windows works betterAndrew Kelley
2019-02-23better libc detection (#1996)Andrew Kelley
* better libc detection This introduces a new command `zig libc` which prints the various paths of libc files. It outputs them to stdout in a simple text file format that it is capable of parsing. You can use `zig libc libc.txt` to validate a file. These arguments are gone: --libc-lib-dir [path] directory where libc crt1.o resides --libc-static-lib-dir [path] directory where libc crtbegin.o resides --msvc-lib-dir [path] (windows) directory where vcruntime.lib resides --kernel32-lib-dir [path] (windows) directory where kernel32.lib resides Instead we have this argument: --libc [file] Provide a file which specifies libc paths This is used to pass a libc text file (which can be generated with `zig libc`). So it is easier to manage multiple cross compilation environments. `--cache on` now works when linking against libc. `ZigTarget` now has a bool field `is_native` Better error messaging when you try to link against libc or use `@cImport` but the various paths cannot be found. It should also be faster. * save native_libc.txt in zig-cache This avoids having to detect libc at runtime on every invocation.
2019-02-19valgrind client requests for undefined valuesAndrew Kelley
with this change, when you assign undefined, zig emits a few assembly instructions to tell valgrind that the memory is undefined it's on by default for debug builds, and disabled otherwise. only support for linux, darwin, solaris, mingw on x86_64 is currently implemented. --disable-valgrind turns it off even in debug mode. --enable-valgrind turns it on even in release modes. It's always disabled for compiler_rt.a and builtin.a. Adds `@import("builtin").valgrind_support` which lets code know at comptime whether valgrind client requests are enabled. See #1989
2019-02-19remove --no-rosegment workaround now that valgrind bug is fixedAndrew Kelley
See #896 Zig 0.3.0+ and Valgrind 3.14+ do not need the workaround.
2019-02-18export _mh_execute_header with weak linkageAndrew Kelley
* also fix extern variables with initialiaztion values to generate runtime code * remove the workaround in example/shared_library/mathtest.zig * introduce the ability for global variables to have Weak and LinkOnce linkage * fix `@export` to work for non-functions. this code needs to be audited though. * fix comptime ptrcast not keeping bigger alignment * fix linker warnings when targeting darwin closes #1903
2019-02-17Add NetBSD supportMaya Rashish
Mostly picking the same paths as FreeBSD. We need a little special handling for crt files, as netbsd uses its own (and not GCC's) for those, with slightly different names.
2019-02-06require running std lib tests coherentlyAndrew Kelley
this should actually improve CI times a bit too See the description at the top of std/os/startup.zig (deleted in this commit) for a more detailed understanding of what this commit does.
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