On 2014 Mar 28, at 08:45, Alexey Samsonov <[email protected]> wrote:
> I've submitted the -whole-archive change as r205012. > > > On Fri, Mar 28, 2014 at 11:42 AM, Kostya Serebryany <[email protected]> wrote: > This does not help. > For asan&co we solve the same problem by adding > -whole-archive/-no-whole-archive around the library in the linker command. > > —kcc I’ve now committed r205023, which I’m hoping is more portable. (Let me know if my solution *still* doesn’t work on Linux.) As I mentioned in my review of r205012, -whole-archive doesn’t quite solve the problem. The main problem with -whole-archive is that any of the profiling options would have (incorrectly) pulled in all of the profiling library. A finer point (to be documented soon in llvm:docs/Something.rst) is that even when -fprofile-instr-generate is specified, we don’t even want all of the instrumented profiling library to be pulled in. The current design allows an advanced user to give their own definition of __llvm_profile_runtime. Primarily, this avoids the hook that registers writing to file with atexit(); an advanced user can call __llvm_profile_write_file() directly. Secondarily, it allows the user to avoid any dependencies on libc. The user can extract the data by calling __llvm_profile_get_size_for_buffer(), allocating a buffer, and calling __llvm_profile_write_buffer(). _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
