[llvm-dev] How to generate .bc file using configure && make on Mac OS X?
Peng Yu via llvm-dev
llvm-dev at lists.llvm.org
Mon Jan 28 09:45:00 PST 2019
It seems that it does not really work. When I run the generated .bc
file, it gives me the following error. Do you what is wrong?
$ lli bash.bc
0. Program arguments: lli bash.bc
0 lli 0x0000000105153922
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
1 lli 0x0000000105153d26 SignalHandler(int) + 200
2 libsystem_platform.dylib 0x00007fff7d6daf5a _sigtramp + 26
3 libsystem_platform.dylib 0x00007ffeeb06cb20 _sigtramp + 1838750688
4 lli 0x0000000104ed5045
llvm::ArrayRef<llvm::GenericValue>) + 535
5 lli 0x0000000104e67ae7
std::__1::char_traits<char>, std::__1::allocator<char> >,
std::__1::char_traits<char>, std::__1::allocator<char> > > > const&,
char const* const*) + 1159
6 lli 0x0000000104b94b84 main + 9104
7 libdyld.dylib 0x00007fff7d3cc015 start + 1
Segmentation fault: 11
On Mon, Jan 28, 2019 at 10:40 AM Jakub (Kuba) Kuderski
<kubakuderski at gmail.com> wrote:
>> but doesn't emit optnone and nounwind attributes
> On Mon, Jan 28, 2019 at 11:35 AM Jakub (Kuba) Kuderski <kubakuderski at gmail.com> wrote:
>> As far as I understand, gllvm doesn't run LTO pipeline or any cross-module optimization, and the optimization level provided is only used to compile each Translation Unit separately.
>> If you want to have LTO-like build, you can first run gllvm with `-O3 -Xclang -disable-llvm-optzns` (builds code with no optimizations, but doesn't emit optnone and nounwind attributes) and later run opt on the final bitcode. Note that the results might not be the same as running a proper LTO build because of different pass manager pipelines.
>> On Mon, Jan 28, 2019 at 11:24 AM Peng Yu <pengyu.ut at gmail.com> wrote:
>>> This works great.
>>> > You can also try using the gllvm wrapper: https://github.com/SRI-CSL/gllvm ; it's quite reliable and easy to use in my experience.
>>> Just to be sure. Only one version of bc file will be generated that
>>> corresponds to the compiler options provide at configure?
>>> The original approach using ld.gold will provide several .bc files
>>> that correspond to different stages of the optimization.
>>> I think using gllvm, I need to specify the corresponding -O? option to
>>> the correct optimization stage of the bc file? Thanks.
>> Jakub Kuderski
> Jakub Kuderski
More information about the llvm-dev