* Linux: implement signal stacktrace using SA_SIGINFO + sigaltstack
Adds proper signal handlers for SIGSEGV/SIGBUS/SIGILL on Linux,
enables backtraces from signal context, and exits with correct POSIX
signal codes (128+signal). Fixes missing "signal stacktrace" support
Signed-off-by: Manuel Barrio Linares <mbarriolinares@gmail.com>
* defer libc::dlclose(handle);
Signed-off-by: Manuel Barrio Linares <mbarriolinares@gmail.com>
* fix double backtrace on panic
Signed-off-by: Manuel Barrio Linares <mbarriolinares@gmail.com>
* add guards for Linux X86_64
- remove comments
- uncomment MContext_t for Linux AARCH64
Signed-off-by: Manuel Barrio Linares <mbarriolinares@gmail.com>
* fix guards, missed in two places
Signed-off-by: Manuel Barrio Linares <mbarriolinares@gmail.com>
---------
Signed-off-by: Manuel Barrio Linares <mbarriolinares@gmail.com>
Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
* Add NetBSD Support
Includes:
- Hints to find non-compatibility libc functions
- Struct and constant definitions for sockets, polling, etc.
- Changes to the linker code to work around some quirks in the NetBSD dynamic linker
- A target triple for netbsd aarch64 so llvm builds/links the compiler properly on this platform
* Updated releasenotes and some compacting
---------
Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
* ChaCha20 implementation, first pass
* fix bug with clone_slice when length is 0
* final ChaCha20 crypto tidying
* final adjustments; add benchmark
* add guards everywhere else or w/e
* stdlib 'i++' conformity
* release notes & security warning updates
* update tests; cleanup; default counter should be 0 not 1
* remove prints in test file
* add extra unit tests for unaligned buffers
Co-authored-by: Manu Linares <mbarriolinares@gmail.com>
* one final alignment test
* nice contraction of tests w/ some paranoia sprinkled in
* nearly double the efficiency of chacha20's transform
Co-authored-by: Manu Linares <mbarriolinares@gmail.com>
* fix memory leak in test case
* improve one of the unit tests to cover more cases
* greatly simplify chacha20 'transform'
Co-authored-by: Manu Linares <mbarriolinares@gmail.com>
---------
Co-authored-by: Manu Linares <mbarriolinares@gmail.com>
* fix memory leak in string_escape.c3
* add unescape_lenient and tunescape_lenient
* Optimize for the use of the temp allocator.
---------
Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
* added `--linux-libc=host` and set default to `default_linux` from `src/build/builder.c`
* updated `resources/project_schema.json` for `linux-libc` host build option
* Update how libc is set.
---------
Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
This feature adds an option from project.json and build options to disable libc unreachable statements in order to be able to implement one for yourself. Useful feature for bare metal developing.
---------
Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
* add join for ThreadPool without destroying the threads
* Make the main Thread block waiting for the worker threads to finish instead of buzy looping and do proper initialization and freeing of all variables.
* Updated test to use `atomic_store` and take into account the maximum queue size of the threadpool.
* - Add `ThreadPool` join function to wait for all threads to finish in the pool without destroying the threads.
- Return of Thread/Mutex/CondVar `destroy()` is now "@maydiscard" and should be ignored. It will return void in 0.8.0.
- Return of Mutex `unlock()` and `lock()` is now "@maydiscard" and should be ignored. They will return void in 0.8.0.
- Return of ConditionVariable `signal()` `broadcast()` and `wait()` are now "@maydiscard". They will return void in 0.8.0.
- Return of Thread `detatch()` is now "@maydiscard". It will return void in 0.8.0.
- Buffered/UnbufferedChannel, and both ThreadPools have `@maydiscard` on a set of functions. They will retunr void in 0.8.0.
- Pthread bindings correctly return Errno instead of CInt.
- Return of Thread `join()` is now "@maydiscard".
---------
Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
* added switch statement to link musl-based linux distros to ld-musl-x86-64.so.2
* Update linker.c
/lib/ld-musl-x86-64.so.1 is musl's ld so. My bad
* don't need ENV_MUSLEABI.* in the switch for x86_64
* typo
* Added a CI test for an Alpine Linux container
* Update main.yml
Forgot to have bundle_output job use `env.LLVM_RELEASE_VERSION_ALPINEv3_22`.
* Added env.LLVM_RELEASE_VERSION_ALPINEv3_22 to `upload artifacts`
* changed bundle name to c3-musl-${{matrix,build_type}}.tar.gz
* Undid an accidental name change in build-linux-ubuntu22
* Update main.yml
sudo doesn't exist in alpine by default, and runs in root by default.
* Update main.yml
* Update main.yml
* Update main.yml
* Update main.yml
`--linker=builtin` fails because it forces search of `/lib64/ld-linux-x86-64.so.2`. lib64 doesn't exist on musl unless created as a symlink, and the appropriate so is /lib/ld-musl-<arch>.so.1
* Update main.yml
* Update main.yml
* Update main.yml
* Update main.yml
make isn't in alpine by default. added it in for risc-v example.
* gcc-riscv-none-elf is alpine's package
* using realpath for c3c over using relative pathing
* Have to use relative path for arguments in compiler test
* added --linker=builtin to
* Added linux-musl-<arch> targets
* Added more ld targets for glibc
* set both testproject libs as folders until they behave better
* added linux-musl-x64 target to clib2
* added riscv targets for ld-linux
* ubuntu doesn't have ld in /lib, but solely in /lib64?
* Make MUSL distinct from the target.
* Fix default in project schema
* Fix define
* Fix manifests.
* Update main.yml
add --linux-libc flag for builtin linking
* Grammar refresh
* Update releasenotes.
---------
Co-authored-by: Christoffer Lerno <christoffer@aegik.com>