lgtm contingent on verifying intended behavior changes and adding comments. The factoring suggestion for the triple,triple searching is preferred but at your discretion, though I'd really like to see at least comments.
Fri, May 24
Tue, May 21
lgtm with one nit: either change to an assert or improve the comment to clarify what other cases are expected
Tue, May 14
Mon, May 6
Previously the same local symbol name was being used for both things in an uncoordinated fashion. The logic in places like ValueSymbolTable::createValueName leads to the second one getting renamed with some ".digits" suffix to make them unique.
Then the code that emits the references between the init_array and the actual function and sets the COMDAT group name assumed it could use the original name throughout, but in some places this was replaced with the suffixed name and in some places it was not, leading to the incorrect references.
Sorting R_*_RELATIVE relocs first and setting REL(A)COUNT is a format requirement, period. It's not a debatable question of optimization.
Sun, May 5
Sat, May 4
This works for my case that led to me to file https://bugs.llvm.org/show_bug.cgi?id=41693 as a linker issue.
Fri, May 3
The sorting behavior is entirely an optimization for locality at dynamic reloc time. Both locality of symtab indices and locality of reloc offsets are useful to that goal.
Tue, Apr 30
Apr 24 2019
Apr 3 2019
IMHO the library code should use #if !__has_feature(...) to avoid the definitions entirely when built with a sanitizer whose runtime provides them.
But this is a fine way to achieve that while we wait for those libraries to be fixed for sanitized builds.
Apr 2 2019
Mar 28 2019
Feb 16 2019
This is only on GCC trunk (i.e. 9), not in 8.2 or even the current gcc-8 branch. So clarify the log entry. We don't know if 8.x,x>2 will add it or only gcc 9.
Feb 14 2019
Feb 13 2019
I only really looked at the Fuchsia code.
Feb 9 2019
lgtm with a comment (and perhaps an assertion).
Jan 30 2019
Jan 25 2019
Should you add -nostdinc++ to the compilation flags to drive home that this code can't depend on any library headers?
Jan 20 2019
Jan 14 2019
Jan 5 2019
Jan 4 2019
lgtm. Wouldn't hurt to comment that this depends on a linker new enough to support the new reloc types (only reason it's conditional at all) and since we default to lld we don't worry about host system linkers that might be too old to support the new reloc types.
Dec 10 2018
Nov 15 2018
lgtm with a comment in the code
Nov 13 2018
Nov 10 2018
Nov 6 2018
Nov 5 2018
Is this patch still needed now that Fuchsia uses:CmdArgs.push_back("--push-state"); CmdArgs.push_back("--as-needed"); if (OnlyLibstdcxxStatic) CmdArgs.push_back("-Bstatic"); ToolChain.AddCXXStdlibLibArgs(Args, CmdArgs); if (OnlyLibstdcxxStatic) CmdArgs.push_back("-Bdynamic"); CmdArgs.push_back("-lm"); CmdArgs.push_back("--pop-state");
This breaks the semantics we want. The -Bdynamic is there to apply to -lm, which is also what --as-needed is there for in this case (it appears earlier because of the conditional logic, since in the other case it applies to -lc++ as well). It's correct as is.
Nov 3 2018
Nov 2 2018
So the default is not per-target? It should be.
Nov 1 2018
Oct 31 2018
Other symbols must have exactly one definition (modulo the permission for duplicate identical definitions for some cases), but these ones have a default definition that is designed to be overridable by a different definition appearing anywhere in the program.
I don't understand this claim. These are symbols like any others at link time. A single definition must be supplied as for any other function.
The program has two choices: either it provides a definition, and that gets used everywhere, or it does not, and the default version (provided by the toolchain) gets used everywhere.
These symbols really are special. Other symbols are introduced explicitly by a declaration, whereas these are declared implicitly by the compiler.
Replacing the global new and delete is supposed to be a whole-program operation (you only get one global allocator). Otherwise you couldn't allocate memory in one DSO and deallocate it in another. (And nor could inline functions etc.)
If you really want to do this weird thing, and you understand what you're getting yourself into, I don't see a problem with having a dedicated flag for it, but don't break all existing users of -fvisibility=.
Oct 30 2018
Oct 28 2018
I don't know what's affected by the presence of that declaration. Certainly it should be defined.
AFAICT this has nothing to do with solving the problem of the symbol not existing in the library.
That needs CMakeLists.txt:34 changed so it compiles cxa_thread_atexit.cpp for Fuchsia.
We also need to make sure that the cmake check for presence of __cxa_thread_atexit_impl in libc is passing correctly.
Oct 23 2018
Oct 19 2018
Oct 17 2018
Oct 3 2018
The motivating use case always pairs noderef with an address_space attribute, and it's already invalid to convert between pointer types in different address spaces without a cast.
So I don't think we have a strong opinion one way or the other. In the abstract, I'd say noderef feels like a "constraining" qualifier a la const/volatile so that going from unconstrained to constrained implicitly is OK but not vice versa.
Sep 28 2018
Sep 26 2018
Sep 23 2018
lgtm as long as we revert when the underlying bugs are resovled
Sep 19 2018
Sep 18 2018
Sep 17 2018
The test will need to verify that the emitted relocs are correct too.
Sep 16 2018
lgtm. Note that most sanitizer runtime ports for Fuchsia will be DSO-only, but I think the #ifndef PIC condition will cover that if/when those cases come up.
For always-static runtimes that can't be statically linked into DSOs (i.e. runtime library is not included in -shared links) this should now be right for Fuchsia.
IIRC profile is always-static but meant to be statically linked separately into each DSO, but presumably that means it's built with PIC defined too.
Sep 14 2018
Sep 11 2018
Sep 8 2018
Sep 4 2018
Sep 1 2018
The log message could give concrete examples.
Aug 26 2018
Aug 1 2018
I thought the plan was to produce JSON, not YAML.
Jul 27 2018
I think this wants to be a hard error rather than a warning. Though since we use -Werror anyway if others feel strongly contrary I won't object.
Jul 23 2018
Jul 14 2018
Is this still live? Should it be different after all the multiarch stuff?
LGTM with these few substantive nits and then a whole lot more comments (mostly a more thorough overview covering linkage and output model).
Jul 10 2018
Almost there, but some nits.
Jun 26 2018
Jun 18 2018
Jun 15 2018
Jun 11 2018
In response to Jake's comments about GNUStyle:
Jun 7 2018
Jun 5 2018
Jun 4 2018
Jun 1 2018
lgtm modulo unnecessary #include
May 30 2018
I don't have enough context on how the profiling runtime works to properly review this implementation strategy for Fuchsia. Perhaps adequate comments here would tell me enough. Certainly it needs a lot more comments.
But probably we just need to talk through the implementation plan in person first.
May 23 2018
May 22 2018
May 21 2018
May 9 2018
LGTM assuming the Fuchsia build still works (I don't see any problems in the source off hand).
@jakehehrlich will verify the Fuchsia Build.