[llvm-dev] Clang 3.8 and gcc 5.2 has difference in symbol names

Nishidha Panpaliya via llvm-dev llvm-dev at lists.llvm.org
Wed May 4 06:26:05 PDT 2016


Thanks Yaron. I've seen this thread earlier. I also wanted to know when
will LLVM have a fix for this as mentioned in the thread, it is pending for
review. Will the fix be available for LLVM 3.8 or we'll have to take the
latest LLVM?
Also, if I downgrade gcc to 4.9, will LLVM 3.8 work perfectly ?

Thanks,
Nishidha



From:	Yaron Keren <yaron.keren at gmail.com>
To:	Nishidha Panpaliya/Austin/Contr/IBM at IBMUS
Cc:	llvm-dev <llvm-dev at lists.llvm.org>, David
            Clissold/Austin/IBM at IBMUS, Sudarshan
            Jagadale/Austin/Contr/IBM at IBMUS, Manish
            Patil/Austin/Contr/IBM at IBMUS
Date:	05/04/2016 06:31 PM
Subject:	Re: [llvm-dev] Clang 3.8 and gcc 5.2 has difference in symbol
            names



Please seeĀ https://llvm.org/bugs/show_bug.cgi?id=23529


2016-05-04 15:52 GMT+03:00 Nishidha Panpaliya via llvm-dev <
llvm-dev at lists.llvm.org>:
  Hi All,

  I've built LLVM 3.8 on POWER with gcc 5.2.1 version for one of our
  application. This application is built using -std=c++14 support.
  Using this particular combination, I'm getting one error where one of the
  exported symbols from our application (for a function returning
  std::string which is built by gcc) is different than the one when
  compiled by clang 3.8.

  I also tried to replicate this issue by using a small test application
  which has a function named GetString() returning std::string. When I
  compile this file using gcc 5.2, I see symbol name as
  "_Z9GetStringB5cxx11v" and when I compile the same file using clang++, I
  get symbol name as "_Z9GetStringv".

  In order to resolve this difference, I tried below things -
        gcc 5.2 with c++11 support has added this special behavior due to
        which symbol name contains B5cxx11. Hence, I tried building
        LLVM/clang with -std=c++14 support. But no luck.
        Even if I provide -std=c++14 while compiling this source file using
        clang++, the result remained same.
        I tried setting -D_GLIBCXX_USE_CXX11_ABI=0 flag while compiling my
        application using gcc. This approach atleast gave me some success.
        Symbols generated for my source file after using flag were same as
        that of clang++ (i.e. without B5cxx11). But later my application
        failed at linking step for some undefined references - some of the
        references were of the application itself and a few from dependent
        libraries. I wanted to know if I would also need to build my
        dependent libraries using this flag.

  I need some guidance here as to how I can build LLVM/clang so that it
  also generates symbols same as that of gcc5.2. I can't use any other
  version of gcc as I'll need rebuild lot of other dependencies.

  Kindly help me.

  Thanks,
  Nishidha

  _______________________________________________
  LLVM Developers mailing list
  llvm-dev at lists.llvm.org
  http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160504/24677ee2/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160504/24677ee2/attachment.gif>


More information about the llvm-dev mailing list