r192300 - Use aliases for more constructors and destructors.
Rafael EspĂndola
rafael.espindola at gmail.com
Thu Oct 10 05:02:52 PDT 2013
On 9 October 2013 19:04, Reid Kleckner <rnk at google.com> wrote:
> Another problem I encountered is that the Microsoft linker doesn't like it
> if you chain weak aliases like so:
>
> $ cat t.ll
> @my_alias = alias linkonce_odr void ()* @my_inline
> @my_alias2 = alias linkonce_odr void ()* @my_alias
> define linkonce_odr void @my_inline() {
> ret void
> }
> define i32 @main() {
> call void @my_alias2()
> ret i32 0
> }
>
> $ llc t.ll -o tll.obj -filetype=obj && link tll.obj -defaultlib:libcmt.lib
> -out:t.exe -nologo
> tll.obj : error LNK2001: unresolved external symbol _my_alias2
> tll.obj : error LNK2001: unresolved external symbol _my_alias
>
> To work around this, when should we forward my_alias2 through to my_inline?
> In clang, LLVM, or MC?
I will see if I can make MC handle this. In general having the backend
implement the alias limitations is probably better.
Thanks,
Rafael
More information about the cfe-commits
mailing list