* Remove function parseAnyBaseInt.
* Replace calls to parseAnyBaseInt to calls to std.fmt.parseUnsigned
with radix 0.
* Replace calls to parseInt where the type is unsigned with calls to
parseUnsigned. Note that the functionality of these arguments haven't
changed, they still retain the original radix specified.
* it is now -fcompiler-rt and -fno-compiler-rt to override the (quite
reasonable) default of bundling compiler-rt only for executables and
dynamic libraries.
- the build.zig API is still called bundle_compiler_rt however it is
now an optional bool instead of a bool. leaving it as `null` means
to use the compiler default.
* renamed some internal identifiers to make the source more readable
* additionally support -fcompiler-rt when doing build-obj for ELF files
since that target already supports linking multiple objects into one.
- includes an error message when attempting this for non-ELF. in the
future this could additionally be supported with a more advanced
implementation that does not rely on the linker.
* properly populate the linker cache hash
Before this commit, the branch regressed this case:
zig build-lib foo.zig -dynamic
readelf -d libfoo.so
x000000000000000e (SONAME) Library soname: [libfoo.so]
Now it works again, but it preserves the property that using `zig cc`
has the SONAME off by default to match C compilers.
* stage2: Make zig cc more verbose
Make `zig cc` print more info from Clang itself and from our own linker
invocation, this is needed for CMake to properly discover all the
include directories and library search paths.
Closes#7110
* Update `update_clang_options`
* Typo fixes
Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
On Darwin, according to the man pages for setrlimit(), when adjusting
max number of open fds, the reported hard max by getrlimit() is only
theoretical, while the actual maximum, set in the kernel, is hardcoded
in the header file. Therefore, the reported max has to be adjusted
as `min(OPEN_MAX, lim.max)`.
Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>
* extract logic into a `os_can_execve` and use it in the other place
that we execve
* outdent some code by introducing `run_or_test` variable
* delete unnecessary and wasteful memory management logic
* better error message for when execve fails
* add comment to explain why we do not execve for `zig test`
* std.fs.File.copyRange and copyRangeAll return u64 instead of usize -
the returned value is how much of the `len` is transferred, so the
types should match. This removes the need for an `@intCast`.
* fix typo that removed a subtraction
* Fix the size of codegen.AnyMCValue which gave me a compile error when
I tried to build self-hosted for i386-linux.
* restore the coercion to u64 of syms_sect.sh_info. We want to make
sure the multiplication happens with 64 bits and not the smaller type
used by the ELF format.
* fix another offset parameter in link/Elf.zig to be u64 instead of usize
* add a nice little TODO note to help out Jakub
* FmtError already has FileTooBig in it; we just need to return it.
It was regressed in 2 ways from the merge of #6250:
* it was not being enabled by default when the target OS is native.
* we were testing the libfoo.so file path existence with bogus format
string ('{}' instead of '{s}') and so it ended up being something
like "libstd.HashMap(K,V,...).Entry.so" instead of "libfoo.so". Using
{} rather than {s} is a footgun, be careful!
Previous functionality is now restored.
closes#6523