<div dir="ltr"><div dir="ltr">Peng,<br><br>You can also try using the gllvm wrapper: <a href="https://github.com/SRI-CSL/gllvm">https://github.com/SRI-CSL/gllvm</a> ; it's quite reliable and easy to use in my experience.<br><br>-JK</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jan 28, 2019 at 9:51 AM Peng Yu via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Mon, Jan 28, 2019 at 8:16 AM Tim Northover <<a href="mailto:t.p.northover@gmail.com" target="_blank">t.p.northover@gmail.com</a>> wrote:<br>
><br>
> On Mon, 28 Jan 2019 at 14:10, Peng Yu via llvm-dev<br>
> <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
> > ld: unknown option: -plugin-opt=save-temps<br>
><br>
> The macOS linker supports -save-temps directly (but not -plugin-opt).<br>
> I haven't tried, but I'd guess that if you modified the -Wl part of<br>
> your command line in the obvious manner it'll work.<br>
<br>
I can run the configure using this command.<br>
<br>
../../../extract/bash-5.0/configure CC=clang CXX=clang++<br>
RANLIB=llvm-ranlib CFLAGS=-g\ -flto LDFLAGS=-save-temps\ -flto<br>
<br>
But the command to generate the executable "bash" (called by make)<br>
does not produce a .bc file.<br>
<br>
clang -L./builtins -L./lib/readline -L./lib/readline -L./lib/glob<br>
-L./lib/tilde  -L./lib/sh  -save-temps -flto  -g -flto<br>
-Wno-parentheses -Wno-format-security   -o bash shell.o eval.o y.tab.o<br>
general.o make_cmd.o print_cmd.o  dispose_cmd.o execute_cmd.o<br>
variables.o copy_cmd.o error.o expr.o flags.o jobs.o subst.o hashcmd.o<br>
hashlib.o mailcheck.o trap.o input.o unwind_prot.o pathexp.o sig.o<br>
test.o version.o alias.o array.o arrayfunc.o assoc.o braces.o<br>
bracecomp.o bashhist.o bashline.o  list.o stringlib.o locale.o<br>
findcmd.o redir.o pcomplete.o pcomplib.o syntax.o xmalloc.o<br>
-lbuiltins -lglob -lsh -lreadline -lhistory -ltermcap -ltilde<br>
lib/intl/libintl.a -liconv -liconv  -ldl<br>
<br>
It is just the .o files are bitcode. But bash is an executable. And<br>
there are not .bc files accompanying it.<br>
<br>
$ file bash<br>
bash: Mach-O 64-bit executable x86_64<br>
<br>
Using the original commands on Linux, I got the following associated files.<br>
./configure CC=clang RANLIB=llvm-ranlib CFLAGS=-flto<br>
LDFLAGS=-Wl\,-plugin-opt=save-temps\ -flto\ -fuse-ld=gold<br>
make<br>
<br>
$ ls -gltr bash.*.bc<br>
-rw-r--r-- 1 staff 4769876 Jan 25 10:16 bash.0.0.preopt.bc<br>
-rw-r--r-- 1 staff 4769876 Jan 25 10:16 bash.0.2.internalize.bc<br>
-rw-r--r-- 1 staff 4739688 Jan 25 10:16 bash.0.4.opt.bc<br>
-rw-r--r-- 1 staff 4739688 Jan 25 10:16 bash.0.5.precodegen.bc<br>
<br>
-- <br>
Regards,<br>
Peng<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div>Jakub Kuderski</div></div>