Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
899 views
in Technique[技术] by (71.8m points)

assembly - How to switch off LLVM's integrated assembler?

I have a project involving hand-written assembly—AT&T syntax, works fine with GCC, but not done by me plus I know very little about assembly—which exhibits a weird problem when trying to build it with Clang.

LLVM documentation mentions that "most X86 targets" use LLVM's integrated assembler as opposed to the system assembler; as a possible workaround I would like to explicitly use the latter. I (well, Google) haven't been successful in finding information on how to do this.

Question: Is there a way to ask or rather force Clang / LLVM to use the system assembler instead of the integrated one?

(I know I could always go and Read The Source?, but I want to know whether there's a documented approach.)

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Turns out I completely missed this in the man page:

-integrated-as -no-integrated-as

Used to enable and disable, respectively, the use of the integrated assembler. Whether the integrated assembler is on by default is target dependent.

To disable it at compiler invocation:

clang -no-integrated-as -c foo.c

Or:

export CC="clang -no-integrated-as"
make

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...