LLVM 12 included a patch that changed the way availability annotations
are specified. We now have to define the _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS
flag to make sure that we tell the c++ headers that we don't use
visibility annotations.
Related LLVM patch: D90843
OCB has been around for a long time.
It's simpler, faster and more secure than AES-GCM.
RFC 7253 was published in 2014. OCB also won the CAESAR competition
along with AEGIS.
It's been implemented in OpenSSL and other libraries for years.
So, why isn't everybody using it instead of GCM? And why don't we
have it in Zig already?
The sad reason for this was patents. GCM was invented only to work
around these patents, and for all this time, OCB was that nice
thing that everybody knew existed but that couldn't be freely used.
That just changed. The OCB patents are now abandoned, and OCB's
author just announced that OCB was officially public domain.
Add support for OffsetOfExpr that contain exactly 1 component, when that component
is a field.
For example, given:
```c
struct S {
float f;
double d;
};
struct T {
long l;
int i;
struct S s[10];
};
```
Then:
```c
offsetof(struct T, i) // supported
offsetof(struct T, s[2].d) // not supported currently
```
Beside the new order being consistent with the ThreadPool API and making
more sense, this shuffling allows to write the context argument type in
terms of the startFn arguments, reducing the use of anytype (eg. less
explicit casts when using comptime_int parameters, yay).
Sorry for the breakage.
Closes#8082
Our glibc stub assembly file looked something like this:
```
.globl _Exit_2_2_5
.type _Exit_2_2_5, %function;
.symver _Exit_2_2_5, _Exit@@GLIBC_2.2.5
.hidden _Exit_2_2_5
_Exit_2_2_5:
```
With clang 12, the shared objects this produced stopped having any
exported symbols. When I removed the `.hidden` directive, it resolved
the issue, however, there are now unwanted exports:
```
$ readelf -W --dyn-syms libc.so.6 | grep sys_errlist
139: 000000000001ee08 0 FUNC GLOBAL DEFAULT 7 _sys_errlist_GLIBC_2_3
147: 000000000001ee08 0 FUNC GLOBAL DEFAULT 7 _sys_errlist_GLIBC_2_4
395: 000000000001ee08 0 FUNC GLOBAL DEFAULT 7 _sys_errlist_GLIBC_2_2_5
487: 000000000001ee08 0 FUNC GLOBAL DEFAULT 7 sys_errlist_GLIBC_2_2_5
1266: 000000000001ee08 0 FUNC GLOBAL DEFAULT 7 _sys_errlist@@GLIBC_2.12
1267: 000000000001ee08 0 FUNC GLOBAL DEFAULT 7 _sys_errlist@GLIBC_2.2.5
1268: 000000000001ee08 0 FUNC GLOBAL DEFAULT 7 _sys_errlist@GLIBC_2.3
1269: 000000000001ee08 0 FUNC GLOBAL DEFAULT 7 _sys_errlist@GLIBC_2.4
2137: 000000000001ee08 0 FUNC GLOBAL DEFAULT 7 sys_errlist@@GLIBC_2.12
2138: 000000000001ee08 0 FUNC GLOBAL DEFAULT 7 sys_errlist@GLIBC_2.2.5
2139: 000000000001ee08 0 FUNC GLOBAL DEFAULT 7 sys_errlist@GLIBC_2.3
2140: 000000000001ee08 0 FUNC GLOBAL DEFAULT 7 sys_errlist@GLIBC_2.4
2156: 000000000001ee08 0 FUNC GLOBAL DEFAULT 7 sys_errlist_GLIBC_2_3
2161: 000000000001ee08 0 FUNC GLOBAL DEFAULT 7 sys_errlist_GLIBC_2_4
```
Every line here without an `@` symbol is an unwanted export. Before, the
unwanted ones had LOCAL HIDDEN linkage.
As a mitigation, I did two things:
* Added `_GLIBC_` to the unwanted exports so that they would not
conflict with anything.
* Made the default export (the `@@` one) the bare symbol name. This
appears to reduce the unwanted exports to only symbols that have more
than one symbol (which is still quite many).
This will unblock progress on this branch, however, there is now a new
issue to solve, that the provided glibc stub .so files have too many
symbols exported. We will have to find a way to avoid this.
This completes the process. All target CPU features are now
auto-generated by the tools/update_cpu_features.zig script, which
contains all the overrides.
Invoking this tool against LLVM 12rc2 now produces an empty git diff.
With this change, added & modified cpus & features participate in the
same pruning system, and sorting takes into account the zig name, not
the pre-modified llvm name.
The modified target files in this commit are due to the improved
sorting and pruning.
The script now fully supports extra cpus & features.
The tools/update_cpu_features script is coming along, and generates
correct information for all these targets. The remaining targets are:
* arm
* aarch64
* amdgpu
* riscv
I will commit them once the issues with the updater tool are resolved.
This introduces {'} to indicate escape for a single-quoted string,
and {} to indicate escape for a double quoted string.
Without this, there would be unnecessary \' inside double quoted
strings, and unnecessary \" inside single quoted strings.
Motivated by the llvm12 branch, in the new tool I am writing for
updating target CPU features.
also avoid unnecessary escaping of single quotes inside double quoted
strings (depends on a master branch commit that will be merged into this
branch in a future commit)
This replaces the previous target cpu features tool, taking advantage of
llvm-tblgen --dump-json instead of trying to use python to parse the .td
files.
This is an initial version that has the basics working, including a
simple feature override system, as well as multi-threaded processing.
Follow-up commits will do clean ups to make the diff of the newly generated
source files against previous versions be as desired.
LLVM 12 requires sret attributes to have the struct type as a parameter,
and provides no C function for supplying it. Therefore, we must add
another C++ wrapper API for adding the sret attribute.
Fixes ability to build from source in the llvm12 branch.
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