<div dir="ltr">It looks like that's just wasmate. I'll accelerate its deletion.</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 6, 2016 at 6:41 PM, JF Bastien <span dir="ltr"><<a href="mailto:jfb@chromium.org" target="_blank">jfb@chromium.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Dan,<div><br></div><div>I think this change (or one of the surrounding ones) broken compiling C code with WebAssembly.</div><div><br></div><div>Errors look like: error at line 3: unknown section: .text.foobar</div><div><br></div><div>See: <a href="https://build.chromium.org/p/client.wasm.llvm/builders/linux/builds/1507/steps/Link%20LLVM%20Torture%20with%20wasmate/logs/stdio" target="_blank">https://build.chromium.org/p/client.wasm.llvm/builders/linux/builds/1507/steps/Link%20LLVM%20Torture%20with%20wasmate/logs/stdio</a></div><div><br></div><div>Could you look into it?</div><div><br></div><div>Thanks,</div><div><br></div><div>JF</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 6, 2016 at 4:50 PM, Dan Gohman via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: djg<br>
Date: Wed Jan 6 18:50:27 2016<br>
New Revision: 257005<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=257005&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=257005&view=rev</a><br>
Log:<br>
[WebAssembly] Enable -ffunction-sections and -fdata-sections by default.<br>
<br>
These remain user-overridable with -fno-function-sections and<br>
-fno-data-sections.<br>
<br>
Modified:<br>
cfe/trunk/lib/Driver/Tools.cpp<br>
cfe/trunk/test/Driver/wasm-toolchain.c<br>
<br>
Modified: cfe/trunk/lib/Driver/Tools.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=257005&r1=257004&r2=257005&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=257005&r1=257004&r2=257005&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Driver/Tools.cpp (original)<br>
+++ cfe/trunk/lib/Driver/Tools.cpp Wed Jan 6 18:50:27 2016<br>
@@ -4176,8 +4176,11 @@ void Clang::ConstructJob(Compilation &C,<br>
CmdArgs.push_back("-generate-type-units");<br>
}<br>
<br>
- // CloudABI uses -ffunction-sections and -fdata-sections by default.<br>
- bool UseSeparateSections = Triple.getOS() == llvm::Triple::CloudABI;<br>
+ // CloudABI and WebAssembly use -ffunction-sections and -fdata-sections by<br>
+ // default.<br>
+ bool UseSeparateSections = Triple.getOS() == llvm::Triple::CloudABI ||<br>
+ Triple.getArch() == llvm::Triple::wasm32 ||<br>
+ Triple.getArch() == llvm::Triple::wasm64;<br>
<br>
if (Args.hasFlag(options::OPT_ffunction_sections,<br>
options::OPT_fno_function_sections, UseSeparateSections)) {<br>
@@ -6536,7 +6539,9 @@ void wasm::Linker::ConstructJob(Compilat<br>
CmdArgs.push_back("ld");<br>
<br>
// Enable garbage collection of unused input sections by default, since code<br>
- // size is of particular importance.<br>
+ // size is of particular importance. This is significantly facilitated by<br>
+ // the enabling of -ffunction-sections and -fdata-sections in<br>
+ // Clang::ConstructJob.<br>
if (areOptimizationsEnabled(Args))<br>
CmdArgs.push_back("--gc-sections");<br>
<br>
<br>
Modified: cfe/trunk/test/Driver/wasm-toolchain.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/wasm-toolchain.c?rev=257005&r1=257004&r2=257005&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/wasm-toolchain.c?rev=257005&r1=257004&r2=257005&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/Driver/wasm-toolchain.c (original)<br>
+++ cfe/trunk/test/Driver/wasm-toolchain.c Wed Jan 6 18:50:27 2016<br>
@@ -1,7 +1,19 @@<br>
// A basic clang -cc1 command-line.<br>
<br>
// RUN: %clang %s -### -target wasm32-unknown-unknown 2>&1 | FileCheck -check-prefix=CC1 %s<br>
-// CC1: clang{{.*}} "-cc1" "-triple" "wasm32-unknown-unknown" {{.*}}<br>
+// CC1: clang{{.*}} "-cc1" "-triple" "wasm32-unknown-unknown" {{.*}} "-ffunction-sections" "-fdata-sections"<br>
+<br>
+// Ditto, but ensure that a user -fno-function-sections disables the<br>
+// default -ffunction-sections.<br>
+<br>
+// RUN: %clang %s -### -target wasm32-unknown-unknown -fno-function-sections 2>&1 | FileCheck -check-prefix=NO_FUNCTION_SECTIONS %s<br>
+// NO_FUNCTION_SECTIONS-NOT: function-sections<br>
+<br>
+// Ditto, but ensure that a user -fno-data-sections disables the<br>
+// default -fdata-sections.<br>
+<br>
+// RUN: %clang %s -### -target wasm32-unknown-unknown -fno-data-sections 2>&1 | FileCheck -check-prefix=NO_DATA_SECTIONS %s<br>
+// NO_DATA_SECTIONS-NOT: data-sections<br>
<br>
// A basic C link command-line.<br>
<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>