aboutsummaryrefslogtreecommitdiff
path: root/src/target.zig
AgeCommit message (Collapse)Author
2021-05-24haiku case for libc link flagsAl Hoang
2021-05-23stage2: introduce clangAssemblerSupportsMcpuArgAndrew Kelley
Clang has a completely inconsistent CLI for its integrated assembler for each target architecture. For x86_64, for example, it does not accept an -mcpu parameter, and emits "warning: unused parameter". However, for ARM, -mcpu is needed in order to properly lower assembly to machine code instructions (see new standalone test case provided thanks to @g-w1). This is a compromise between b8f85a805bf61ae11d6ee2bd6d8356fbc98ee3ba and afb9f695b1bdbf81185e7d55d5783bcbab880989.
2021-05-23overhaul elf csu (c-runtime startup) logicMichael Dusan
- more support for linux, android, freebsd, netbsd, openbsd, dragonfly - centralize musl utils; musl logic is no longer intertwined with csu - fix musl compilation to build crti/crtn for full archs list - fix openbsd to support `zig build-lib -dynamic` - initial dragonfly linking success (with a warning) ancillary: - fix emutls (openbsd) tests to use `try`
2021-05-22stage2: only pass -lm -lc -ldl for android libcIsaac Freund
The other libc components are not available on android.
2021-05-20wasm: link dynamically by default when targeting wasmJakub Konka
This matches the behaviour of other languages and leaves us the ability to create actual static Wasm archives with ``` zig build-lib -static some.zig ``` which can then be combined with other Wasm object files and linked into either a Wasm lib or executable using `wasm-ld`. Update langref to reflect the fact we now ship WASI libc.
2021-05-20wasi,cc: fix naming and add stubs for buildingJakub Konka
Rename include dir to match the convention: from `wasm32-wasi` to `wasm-wasi-musl` Add building stubs which will be used to build and cache WASI libc sysroot.
2021-05-14stage2: clarify logic of passing `-integrated-as` to clangAndrew Kelley
make it clear that the logic is only there to lower the amount of noise on the clang command line.
2021-05-13stage2: fix build on OpenBSD/NetBSDIsaac Freund
Apparently these systems do not provide libdl or librt.
2021-05-11stage2: Allow building musl/glibc in thumb modeLemonBoy
2021-04-04glibc: add support for csky architectureAndrew Kelley
2021-02-27std.Target.Abi: add gnuilp32Michael Dusan
2021-02-27std.Target: add powerpcleAndrew Kelley
2021-02-25Merge remote-tracking branch 'origin/master' into llvm12Andrew Kelley
Conflicts: * src/clang.zig * src/llvm.zig - this file got moved to src/llvm/bindings.zig in master branch so I had to put the new LLVM arch/os enum tags into it. * lib/std/target.zig, src/stage1/target.cpp - haiku had an inconsistency with its default target ABI, gnu vs eabi. In this commit we make it gnu in both places to match the latest changes by @hoanga. * src/translate_c.zig
2021-02-01Merge pull request #7827 from Snektron/spirv-setupAndrew Kelley
Stage 2: SPIR-V setup
2021-01-22stage2: wasm arch does not support -mred-zone flagsAndrew Kelley
2021-01-19SPIR-V: Add glsl450 and vulkan spir-v operating system definitionsRobin Voetter
2021-01-11stage2: cleanups regarding red zone CLI flagsAndrew Kelley
* CLI: change to -mred-zone and -mno-red-zone to match gcc/clang. * build.zig: remove the double negative and make it an optional bool. This follows precedent from other flags, allowing the compiler CLI to be the decider of what is default instead of duplicating the default value into the build system code. * Compilation: make it an optional `want_red_zone` instead of a `no_red_zone` bool. The default is decided by a call to `target_util.hasRedZone`. * When creating a Clang command line, put -mred-zone on the command line if we are forcing it to be enabled. * Update update_clang_options.zig with respect to the recent {s}/{} format changes. * `zig cc` integration with red zone preference.
2021-01-06stage2: rename and move files related to LLVM backendTimon Kruiper
2020-12-30std: Remove duplicated codeLemonBoy
Make osRequiresLibC call Os.requiresLibC, let's keep a single list of OS that require the libc to be linked in.
2020-12-28stage2: rename llvm.zig to llvm_bindings.zigTimon Kruiper
Putting functions in this file will create functions like `llvm.function`, and the compiler thinks these are llvm intrinsics.
2020-12-24stage2: re-use compiler runtime libs across opt modes and strip flagAndrew Kelley
Previously Zig would need to recompile runtime libs if you changed the values of --strip or -O. Now, unless the `debug_compiler_runtime_libs` flag is set (which is currently not exposed to the CLI), Zig will always choose ReleaseFast or ReleaseSmall for compiler runtime libraries. When the main application chooses ReleaseFast or ReleaseSmall, that value is propagated to compiler runtime libraries. Otherwise a decision is made based on the target, which is currently ReleaseSmall for freestanding WebAssembly and ReleaseFast for everything else. Ultimately the purpose of this commit is to have Debug and ReleaseSafe builds of applications still get optimized builds of, e.g. libcxx and libunwind, as well as to spend less time unnecessarily rebuilding compiler runtime libraries.
2020-12-17macos: add unfiltered aarch64 libc headersJakub Konka
2020-12-16Update changes due to different CPU feature setsJakub Konka
llvm commit b2851aea80e5a8f0cfd6c3c5a56a6b00fb28c6b6
2020-12-16Update zig_llvm.cpp and other bitsJakub Konka
Include updates to corresponding zig sources llvm commit b2851aea80e5a8f0cfd6c3c5a56a6b00fb28c6b6
2020-12-08glibc: additionally provide -lcryptAndrew Kelley
also remove redundant "util" string matching.
2020-11-30restore -target wasm32-freestanding-musl for C headersAndrew Kelley
See #5854 Some tiny tweaks too: * Use `wasm-freestanding-musl` instead of `wasm32-freestanding-musl`, making it pointer-size-agnostic. * Fix trying to build non-existent wasm musl start files.
2020-11-08macOS: depend on bundled headers even for nativeAndrew Kelley
This is an alternate fix for #6773. Reverts 872bc787b56f71e53c80f4681523bc8356915b71.
2020-10-21Add minimal set of macOS libc headersJakub Konka
Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>
2020-10-17code cleanupsAndrew Kelley
* in selfExePath, return errors instead of defaulting to bogus data * less invasive edits to the logic of link/Elf.zig * less indentation
2020-10-17Merge branch 'master' into openbsd-minimalSebastien Marie
2020-10-12Rename .macosx to .macosVignesh Rajagopalan
2020-10-11add minimal openbsd supportSébastien Marie
2020-10-03stage2: Build libunwind for non-msvc Windows targetsLemonBoy
Closes #6497
2020-09-29stage2: infer --strip on wasm buildsAndrew Kelley
2020-09-28stage2: building DLL import lib filesAndrew Kelley
2020-09-26fix another round of regressions in this branchAndrew Kelley
* std.log: still print error messages in ReleaseSmall builds. - when start code gets an error code from main, it uses std.log.err to report the error. this resulted in a test failure because ReleaseSmall wasn't printing `error: TheErrorCode` when an error was returned from main. But that seems like it should keep working. So I changed the std.log defaults. I plan to follow this up with a proposal to change the names of and reduce the quantity of the log levels. * warning emitted when using -femit-h when using stage1 backend; fatal log message when using -femit-h with self-hosted backend (because the feature is not yet available) * fix double `test-cli` build steps in zig's build.zig * update docgen to use new CLI * translate-c uses `-x c` and generates a temporary basename with a `.h` extension. Otherwise clang reports an error. * --show-builtin implies -fno-emit-bin * restore the compile error for using an extern "c" function without putting -lc on the build line. we have to know about the libc dependency up front. * Fix ReleaseFast and ReleaseSmall getting swapped when passing the value to the stage1 backend. * correct the zig0 CLI usage text. * update test harness code to the new CLI.
2020-09-23stage2: don't build libunwind on OS's that don't need itAndrew Kelley
2020-09-21rename src-self-hosted/ to src/Andrew Kelley