[llvm-dev] Linux/ARM: Segfault issue when we build clang sources including __thread variable using -O2 flag

Geunsik Lim via llvm-commits llvm-commits at lists.llvm.org
Tue May 17 19:22:41 PDT 2016


I have tried to append "std:cout ..." statement as following to check the
effect if your LLVM patch normally works at build-time of coreCLR.
It's strange. I could not see the "[DEBUG] ****" message while compiling
CoreCLR  with Clang/LLVM for Linux/ARM. Is it right? Can you give me an
opinion?

* CoreCLR (Cross-build for Ubuntu/ARM 14.04 after updating LLVM):
Instruction -
https://github.com/dotnet/coreclr/tree/master/Documentation/building
ubuntu14.04-x64$> sudo time ./cross/build-rootfs.sh arm
ubuntu14.04-x64$> time ROOTFS_DIR=/work/dotnet/rootfs-coreclr/arm
 ./build.sh arm release clean cross


* Patch:
diff --git a/lib/Target/ARM/ARMConstantPoolValue.cpp
b/lib/Target/ARM/ARMConstantPoolValue.
index 866ca82..ddf657d 100644
--- a/lib/Target/ARM/ARMConstantPoolValue.cpp
+++ b/lib/Target/ARM/ARMConstantPoolValue.cpp
@@ -20,6 +20,8 @@
 #include "llvm/IR/Type.h"
 #include "llvm/Support/raw_ostream.h"
 #include <cstdlib>
+#include <iostream>
+
 using namespace llvm;

 //===----------------------------------------------------------------------===//
@@ -73,6 +75,8 @@
ARMConstantPoolValue::addSelectionDAGCSEId(FoldingSetNodeID &ID) {

 bool
 ARMConstantPoolValue::hasSameValue(ARMConstantPoolValue *ACPV) {
+  //printf ("[DEBUG] Do not merge ldr instructions.\n");
+  std::cout << "[DEBUG] Linux/ARM: Do not merge ldr instructions.\n";
   if (ACPV->Kind == Kind &&
       ACPV->PCAdjust == PCAdjust &&
invain at target:/work/dotnet/llvm-3.6.2.src$

On Tue, May 17, 2016 at 2:26 AM, Tim Northover <t.p.northover at gmail.com>
wrote:

> On 16 May 2016 at 05:21, Geunsik Lim <leemgs at gmail.com> wrote:
> > I am sorry too late. I have experimented the effect of your proposal
> after
> > applying for your patch into the existing llvm version both build
> > environment (e.g. Ubuntu 14.04 x64) and ARM evaluation board (Ubuntu/ARM
> > 14.04 based on Raspberry Pi2 board). Result is same. I mean that I could
> not
> > still run the console apps with -O2/-O3 optimization levels of Clang. Do
> you
> > have any idea?
>
> I'm afraid not. I have a particular interest in TLS so I was able to
> spend some time debugging the original issue on those grounds, but
> generally the best way to get a bug fixed is to come up with a small
> test-case showing the same issue and report a bug at
> http://llvm.org/bugs.
>
> Tim.
>



-- 
http://leemgs.fedorapeople.org
Don't try to avoid pain if you fail.
If you decided to face the challenges in life,
you can gain a lot by giving your best.
Cheolsang Jeong's Book & life
--
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160518/66de0bed/attachment.html>


More information about the llvm-commits mailing list