[LLVMdev] [cfe-dev] [windows] is there a way to tell llvm to generate symbol with a leading _ ?

Reid Kleckner rnk at google.com
Sat Jan 25 15:17:55 PST 2014


bcc cfe-dev

llvmdev would probably be more appropriate.

We used to choose whether to use a _ prefix based on the OS, which would be
mingw32 or win32.  Now I believe we ask the user to put something in the IR
data layout to tell us what mangling they want:
http://llvm.org/docs/LangRef.html#data-layout

You probably need to add "m:w" to your data layout string.


On Sat, Jan 25, 2014 at 2:49 PM, Carl <name.is.carl at gmail.com> wrote:

> Hello,
>
> here is the context for my question.
> On Windows, mingw generates symbols with a leading _ in their name.
>
> I have a project that combines regular C libraries compiled by mingw
> (runtime.a) and IR code that I generated and compile via llvm libraries
> (generated.a).
> In my case generated.a uses variables exported by runtime.a.
> And here lies the run, while those variables have the same name in the c
> files that make runtime.a and in the IR code that I feed llvm, once they
> get compiled, the former has a leading _ and the latter not.
>
> To complicate things a little further, that project already work on macosx
> and linux.
> So, I can't want to rename the said variables in the IR code without
> recreating ripples on the platforms.
> Which I do want to avoid.
>
> What I am looking for is the switch to tell llvm assembler "hey, we're on
> windows, please add the dreaded _".
> Does such thing exist?
>
> Where can I look for it?
>
> Cheers,
> Carl.
>
> PS: I'm posting in the correct mailing list?
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140125/2297f1e4/attachment.html>


More information about the llvm-dev mailing list