Chris Lattner wrote:>>Why does llvm-gcc build its own libgcc_s.so? Would we have the same >>problem if we tried to build FSF GCC 4.01, or is this problem LLVM-specific? > > libgcc is part of the GCC distro. My (possibly flawed) understanding of > the issue is that GCC generates code that contains calls into libgcc. > This means that any code compiled with llvm-gcc should used llvm-gcc's > libgcc. It's quite possible that the GCC build is getting confused and > building cc1 with the system gcc but trying to use llvm-gcc's libgcc or > opposite.The problem is that the system standard libstdc++.so.6 has extern symbols that it expects to be resolved by linking against libgcc_s. In an FSF build, xgcc doesn't link to libstdc++. (As an aside, most programs compiled with g++ link to libstdc++ but not libgcc_s. I'm not clear on how that works for other programs, but not xgcc?) Nick
On Thu, 28 Sep 2006, Nick Lewycky wrote:> Thanks for that workaround. What I've been doing is copying > /lib/libgcc_s.so.1 over LLVM's copy and rebuilding xgcc. > > A long-term fix for this would be nice.I'm not hitting this, so I'm relying on you guys to figure out what the right solution is.> Why does llvm-gcc build its own libgcc_s.so? Would we have the same > problem if we tried to build FSF GCC 4.01, or is this problem LLVM-specific?libgcc is part of the GCC distro. My (possibly flawed) understanding of the issue is that GCC generates code that contains calls into libgcc. This means that any code compiled with llvm-gcc should used llvm-gcc's libgcc. It's quite possible that the GCC build is getting confused and building cc1 with the system gcc but trying to use llvm-gcc's libgcc or opposite. -Chris -- http://nondot.org/sabre/ http://llvm.org/
On Thu, 28 Sep 2006, Nick Lewycky wrote:>> libgcc. It's quite possible that the GCC build is getting confused and >> building cc1 with the system gcc but trying to use llvm-gcc's libgcc or >> opposite. > > The problem is that the system standard libstdc++.so.6 has extern > symbols that it expects to be resolved by linking against libgcc_s. In > an FSF build, xgcc doesn't link to libstdc++.Ah, so you're saying that LLVM's cc1 (which is a C++ program) is linking in the system libstdc++ but the llvm-gcc libgcc? That is bad. -Chris -- http://nondot.org/sabre/ http://llvm.org/