]> granicus.if.org Git - clang/commit
Enable -ffunction-sections and -fdata-sections for CloudABI by default.
authorEd Schouten <ed@nuxi.nl>
Thu, 26 Mar 2015 17:50:28 +0000 (17:50 +0000)
committerEd Schouten <ed@nuxi.nl>
Thu, 26 Mar 2015 17:50:28 +0000 (17:50 +0000)
commit5c5a4462447588d713ef1adc3218f994d036e8b8
treed16fab1dcaf592cd1aab31c0a88f8f82e428e8ea
parentbfb53fd201a54895141c2f9df1014598e9c27ba3
Enable -ffunction-sections and -fdata-sections for CloudABI by default.

Unlike most of the other platforms supported by Clang, CloudABI only
supports static linkage, for the reason that global filesystem access is
prohibited. Functions provided by dlfcn.h are not present. As we know
that applications will not try to do any symbol lookups at run-time, we
can garbage collect unused code quite aggressively. Because of this, it
makes sense to enable -ffunction-sections and -fdata-sections by
default.

Object files will be a bit larger than usual, but the resulting binary
will not be affected, as the sections are merged again. However, when
--gc-sections is used, the linker is able to remove unused code far more
more aggressively. It also has the advantage that transitive library
dependencies only need to be provided to the linker in case that
functionality is actually used.

Differential Revision: http://reviews.llvm.org/D8635
Reviewed by: echristo

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233299 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Driver/Tools.cpp
test/Driver/cloudabi.c
test/Driver/cloudabi.cpp