aboutsummaryrefslogtreecommitdiff
path: root/src/libcxx.zig
AgeCommit message (Collapse)Author
2025-05-10compiler: Move vendored library support to `libs` subdirectory.Alex Rønne Petersen
2025-05-05compiler: Set libc++ ABI version to 2 for Emscripten.Alex Rønne Petersen
It remains 1 everywhere else. Also remove some code that allowed setting the libc++ ABI version on the Compilation since there are no current plans to actually expose this in the CLI.
2025-04-26compiler: Allow configuring UBSan mode at the module level.Alex Rønne Petersen
* Accept -fsanitize-c=trap|full in addition to the existing form. * Accept -f(no-)sanitize-trap=undefined in zig cc. * Change type of std.Build.Module.sanitize_c to std.zig.SanitizeC. * Add some missing Compilation.Config fields to the cache. Closes #23216.
2025-04-04libcxx: Update to Clang 20.Alex Rønne Petersen
See: * https://discourse.llvm.org/t/rfc-freezing-c-03-headers-in-libc/77319 * https://discourse.llvm.org/t/rfc-project-hand-in-hand-llvm-libc-libc-code-sharing/77701 We're dropping support for C++03 for Zig due to the first change; it would be insane to ship 1018 duplicate header files just for this outdated use case. As a result of the second change, I had to bring in a subset of the headers from llvm-libc since libc++ now depends on these. Hopefully we can continue to get away with not copying the entirety of llvm-libc.
2025-01-27frontend: use main Compilation code_model when building libxxAndrew Kelley
as well as libtsan, libunwind, and libc files
2025-01-23compiler: Fix computation of Compilation.Config.any_unwind_tables.Alex Rønne Petersen
This moves the default value logic to Package.Module.create() instead and makes it so that Compilation.Config.any_unwind_tables is computed similarly to any_sanitize_thread, any_fuzz, etc. It turns out that for any_unwind_tables, we only actually care if unwind tables are enabled at all, not at what level.
2025-01-20Compilation pipeline: linker input producing Job representationAndrew Kelley
Move all the remaining Jobs that produce linker inputs to be spawned earlier in the pipeline and registered with link_task_wait_group.
2024-12-11compiler: Improve the handling of unwind table levels.Alex Rønne Petersen
The goal here is to support both levels of unwind tables (sync and async) in zig cc and zig build. Previously, the LLVM backend always used async tables while zig cc was partially influenced by whatever was Clang's default.
2024-11-24std.Target: Add Os.HurdVersionRange for Os.Tag.hurd.Alex Rønne Petersen
This is necessary since isGnuLibC() is true for hurd, so we need to be able to represent a glibc version for it. Also add an Os.TaggedVersionRange.gnuLibCVersion() convenience function.
2024-11-05libcxx: Pass -fPIC via module options instead of CFLAGS.Alex Rønne Petersen
2024-10-23branch fixesAndrew Kelley
2024-10-23move linker input file parsing to the compilation pipelineAndrew Kelley
2024-09-28Initial port work for `*-windows-itanium` support.Alex Rønne Petersen
https://llvm.org/docs/HowToBuildWindowsItaniumPrograms.html This is a weird middle ground between `*-windows-gnu` and `*-windows-msvc`. It uses the C++ ABI of the former while using the system libraries of the latter.
2024-09-19libcxx: Synchronize some CXXFLAGS with upstream.Alex Rønne Petersen
2024-09-19libcxx: Update to LLVM 19.Alex Rønne Petersen
* Moved the tz.cpp patch to experimental/tzdb.cpp. * Extended the __config_site patch to a few more files.
2024-06-08libcxx: fix building when -fsingle-threadedMichael Dusan
* Skip building libcxx mt-only source files when single-threaded. * This change is required for llvm18 libcxx. * Add standalone test to link a trivial: - mt-executable with libcxx - st-executable with libcxx
2024-05-27update the codebase for the new std.Progress APIAndrew Kelley
2024-05-08libcxx, libtsan, libunwind: fix error reportingAndrew Kelley
use a consistent error set to avoid failure when bootstrapping from zig1
2024-05-08libcxx: update to LLVM 18Andrew Kelley
release/18.x branch, commit 78b99c73ee4b96fe9ce0e294d4632326afb2db42 This adds the flag `-D_LIBCPP_HARDENING_MODE` which is determined based on the Zig optimization mode. This commit also fixes libunwind, libcxx, and libcxxabi to properly report sub compilation errors.
2024-03-11std.builtin: make link mode fields lowercaseTristan Ross
2024-03-06Package.Module: deduplicate identical builtin modulesmlugg
Previously, when multiple modules had builtin modules with identical sources, two distinct `Module`s and `File`s were created pointing at the same file path. This led to a bug later in the frontend. These modules are now deduplicated with a simple hashmap on the builtin source.
2024-01-18libcxx: fix C++ builds with glibc <2.16 without aligned_allocEmil Tywoniak
2024-01-13libcxx: only pass -DHAVE___CXA_THREAD_ATEXIT_IMPL for glibc >=2.18jimying
this fix #9412
2024-01-10libcxx: fix not passing any_sanitize_thread correctlyAndrew Kelley
2024-01-01Compilation: make create() take an arena allocatorAndrew Kelley
Instead of making its own inside create. 10 out of 10 calls to create() had already an arena in scope, so this commit means that 10 instances of Compilation now reuse an existing arena with the same lifetime rather than creating a redundant one. In other words, this very slightly optimizes initialization of the frontend in terms of memory allocation.
2024-01-01fix compilation errors when enabling llvmAndrew Kelley
2024-01-01fix more compilation errors introduced by this branchAndrew Kelley
2024-01-01glibc: update to new Compilation APIAndrew Kelley
2024-01-01libcxx: update to new Compilation APIAndrew Kelley
2024-01-01compiler: update references to single_threadedAndrew Kelley
2023-10-20llvm: set PIE only for executablesMichael Dusan
closes #17575
2023-10-08CLI: finish updating module API usageAndrew Kelley
Finish the work started in 4c4fb839972f66f55aa44fc0aca5f80b0608c731. Now the compiler compiles again. Wire up dependency tree fetching code in the CLI for `zig build`. Everything is hooked up except for `createDependenciesModule` is not yet implemented.
2023-10-02Add illumos OS tagStephen Gregoratto
- Adds `illumos` to the `Target.Os.Tag` enum. A new function, `isSolarish` has been added that returns true if the tag is either Solaris or Illumos. This matches the naming convention found in Rust's `libc` crate[1]. - Add the tag wherever `.solaris` is being checked against. - Check for the C pre-processor macro `__illumos__` in CMake to set the proper target tuple. Illumos distros patch their compilers to have this in the "built-in" set (verified with `echo | cc -dM -E -`). Alternatively you could check the output of `uname -o`. Right now, both Solaris and Illumos import from `c/solaris.zig`. In the future it may be worth putting the shared ABI bits in a base file, and mixing that in with specific `c/solaris.zig`/`c/illumos.zig` files. [1]: https://github.com/rust-lang/libc/tree/6e02a329a2a27f6887ea86952f389ca11e06448c/src/unix/solarish
2023-09-19libcxx: update to LLVM 17Andrew Kelley
release/17.x branch, commit 8f4dd44097c9ae25dd203d5ac87f3b48f854bba8 This adds the flag `-D_LIBCPP_PSTL_CPU_BACKEND_SERIAL`. A future enhancement could possibly pass something different if there is a compelling parallel implementation. That libdispatch one might be worth looking into.
2023-06-19all: zig fmt and rename "@XToY" to "@YFromX"Eric Joldasov
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-03-17main: add debug option to dump unoptimized llvm irJacob Young
2023-03-15compiler: update function accepts a std.Progress.NodeAndrew Kelley
This makes progress be exposed to the top-level caller of update(). I tossed in a bonus change: when the `zig build` subcommand sees exit code 2, it omits the "following command failed" line, and the build runner uses exit code 2 when there are compile errors. This tidies up the output on build failure by a little bit.
2023-03-15progress towards semantic error serializationAndrew Kelley
Introduces std.zig.ErrorBundle which is a trivially serializeable set of compilation errors. This is in the standard library so that both the compiler and the build runner can use it. The idea is they will use it to communicate compilation errors over a binary protocol. The binary encoding of ErrorBundle is a bit problematic - I got a little too aggressive with compaction. I need to change it in a follow-up commit to use some indirection in the error message list, otherwise iteration is too unergonomic. In fact it's so problematic right now that the logic getAllErrorsAlloc() actually fails to produce a viable ErrorBundle because it puts SourceLocation data in between the root level ErrorMessage data. This commit has a simplification - redundant logic for rendering AST errors to stderr has been removed in favor of moving the logic for lowering AST errors into AstGen. So even if we get parse errors, the errors will get lowered into ZIR before being reported. I believe this will be useful when working on --autofix. Either way, some redundant brittle logic was happily deleted. In Compilation, updateSubCompilation() is improved to properly perform error reporting when a sub-compilation object fails. It no longer dumps directly to stderr; instead it populates an ErrorBundle object, which gets added to the parent one during getAllErrorsAlloc(). In package fetching code, instead of dumping directly to stderr, it now populates an ErrorBundle object, and gets properly reported at the CLI layer of abstraction.
2022-11-22Compilation: avoid Cache hash dependency on zig lib pathAndrew Kelley
* Update for the breaking changes to std.fs.path.resolve. This had a happy side effect of deleting some error handling code which is no longer needed. * Introduce cache_exempt_flags field to CSourceFile. This is used only for include directories when building libc++ and libc++abi which depend only on the zig lib path. * libc_include_dir_list is only added to the cache hash when it contains directories which have been obtained from system probing. It is exempt when the directories depend only on the zig lib path.
2022-10-27libcxx: only pass -DHAVE___CXA_THREAD_ATEXIT_IMPL for glibcAndrew Kelley
This definition communicates to libcxxabi that the libc will provide the `__cxa_thread_atexit_impl` symbol. This is true for glibc but not true for other libcs, such as musl.
2022-09-12libcxx: define _LIBCPP_ABI_VERSION and _LIBCPP_ABI_NAMESPACEAndrew Kelley
The changes from https://reviews.llvm.org/D119173 mean that __config no longer defaults the libc++ ABI to 1, relying on external configuration. This means Zig must provide the external configuration. This fixes static libraries built with zig with -lc++ to have the standard __1 namespace prefix, which had previously regressed in the llvm15 branch.
2022-08-29Merge remote-tracking branch 'origin/master' into llvm15Andrew Kelley
2022-08-19stage2: implement stack protectorsAndrew Kelley
This is one of the final remaining TODOs for the LLVM backend.
2022-08-04update libcxxabi to LLVM 15Andrew Kelley
release/15.x commit 134fd359a5d884f16662a9edd22ab24feeb1498c
2022-08-04update libcxx to LLVM 15Andrew Kelley
release/15.x commit 134fd359a5d884f16662a9edd22ab24feeb1498c
2022-07-02libcxx: add additional include directoryAndrew Kelley
It appears that libcxx files now want to additionally include based from the src/ directory.
2022-07-01update libcxx to llvm 14.0.6Andrew Kelley
2022-05-10Added _LIBCPP_HAS_NO_THREADS for single_threaded binaries linked with libcxx.Alexander Slesarev
Fixed single-threaded mode for Windows.
2022-01-30remove __muloti4 from libc++Jonathan Marler
fixes https://github.com/ziglang/zig/issues/10719 compiler_rt already provides __muloti4 but libc++ is also providing it and when linking libc++ it causes a crash on my windows x86_64 machine.
2022-01-10Build fs/filesystem libcxx module when targeting GNU WinJakub Konka