[cfe-dev] clang dependence on gcc for assembler even with -filetype=obj

Bigcheese bigcheesegs at gmail.com
Thu Jun 10 16:05:16 PDT 2010


On Thu, Jun 10, 2010 at 6:01 PM, Aaron Gray <aaronngray.lists at gmail.com> wrote:
> Okay, looks good, a few points.
>  - The Tools.cpp diff seems to be a bit odd, its done a total replacement
> rather than just the changes, you may want to look into this.

I have no idea why it's like that. I made the patch with git, so I
must have messed something up in there.

>  - InitHeaderSearch.cpp is going to want to have a conditional '#ifdef
> WIN32' round it as 'getSystemRegistryString() as this as obviously this is
> not supported on non Windows platforms.

It's already ifdefed.

>  - We will probably want a non native WindowsToolChain for Cygwin and MinGW,
> both of these require to be based on Generic GCC, and have '.o' suffixes on
> object modules where are native windows wants '.obj' suffixes.

Yep, we should have Windows{Clang,MSVC,Cygwin,MinGW}. I have only
worked on the clang + windows native bit.

> Its just a COFF linker, so far I have implemented COFF::ObjectModule,
> COFF::Reader, COFF::Writer, COFF::Dumper.
> I was hoping the Reader and Dumper could be used for a test tool.
> Here's a link to the code if you are interested :-
>     http://www.aarongray.org/LLVM-COFF/Dumper
> I am currently looking at a library ArchiveReader, and maybe a Writer too
> for a library tool.

Cool, I'll take a look.

On Thu, Jun 10, 2010 at 6:42 PM, Aaron Gray <aaronngray.lists at gmail.com> wrote:
> Okay got it working with attached patch for cc1as_main.cpp for WinCOFF with
> '-c' outputting an object module but without '-c' the linker is not being
> found.
> C:\cygwin\home\ang\tests\llvm\C++>"\open
> source\llvm+clang\bin\Debug\clang++" -x
>  c HelloWorldStdio.cpp
> /cygdrive/c/Cygwin/bin/link: extra operand
> `C:/Users/ang/AppData/Local/Temp/cc-0
> 00000.o'
> Try `/cygdrive/c/Cygwin/bin/link --help' for more information.
> clang++: error: linker command failed with exit code 1 (use -v to see
> invocation
> )
> Anyway half way there, object module looks fine.
> Aaron

Ah, my patch did something it should not have. It switched all windows
builds (not just native) to use MSVC link.exe.

For now you can just remove my patch (keep Nathan's) and pass
-integrated-as and it should use the Cygwin ld linker.

Oh, and can you reply to cfe-dev at cs.uiuc.edu too?

- Michael Spencer




More information about the cfe-dev mailing list