clang invokes assembler when generating obj file?

Dear there,

I’m trying to use clang to invoke my backend to generate obj code using command:

clang -target x-linux-gnu global.c -c

But it shows me an error:

clang: error: assembler command failed with exit code 1 (use -v to see invocation)

I have assembler setup in my backend but it is incorrectly setup (not currently using any assembler). Is there a way for clang to not invoke assembler to generate obj code?

Thanks,
Xiaochu

Dear there,

I'm trying to use clang to invoke my backend to generate obj code using
command:

clang -target x-linux-gnu global.c -c

Try passing the -fintegrated-as option.

-Tom

Nice! Thanks, Tom. It works.

Nice! Thanks, Tom. It works.

You can also modify your tool chain to indicate that -fintegrated-as is
the default so that you don't need to use this option. See for example:

https://github.com/llvm-mirror/clang/blob/master/lib/Driver/ToolChains.h#L764

-Tom

Thanks! That’s very helpful.