[llvm-dev] How to pass march flag to GCC Assembler arch64-linux-gnu-as

79 views
Skip to first unread message

Sri via llvm-dev

unread,
Oct 26, 2015, 12:52:59 PM10/26/15
to llvm...@lists.llvm.org
I am trying to cross compile an assembly file using clang but with "-fno-integrated-as" so that clang does not use its own assembler.

Clangs calls the command: /usr/bin/aarch64-linux-gnu-as -o Myfile.o Myfile.s but it fails because of missing -march=armv8-a+crypto which is required to build build my source file Myfile.s

I am passing "-march=armv8-a+crypto" to clang command but how do i promote the same flag to assembler arch64-linux-gnu-as through clang?

-- 
-Sri

Tim Northover via llvm-dev

unread,
Oct 26, 2015, 1:05:40 PM10/26/15
to Sri, LLVM Developers Mailing List
On 26 October 2015 at 09:52, Sri via llvm-dev <llvm...@lists.llvm.org> wrote:
> I am passing "-march=armv8-a+crypto" to clang command but how do i promote
> the same flag to assembler arch64-linux-gnu-as through clang?

You could certainly argue Clang should be forwarding that argument
automatically (assuming you did specify it to Clang itself) as part of
supporting -fno-integrated-as. Not that I think we really encourage
-fno-integrated-as; what problems are you having with the internal
one?

Until someone fixes that issue though, you can use
"-Wa,-march=armv8-a+crypto" to give an argument to the assembler
manually.

Tim.
_______________________________________________
LLVM Developers mailing list
llvm...@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

Sri via llvm-dev

unread,
Oct 26, 2015, 1:31:59 PM10/26/15
to Tim Northover, LLVM Developers Mailing List
I am trying to build chromium and at this moment, They see some issues with internal one so recommended to use the flag -fno-integrated-as. 
Here is my exact build command (with -v and  --save-temps):

$ clang  -Igen -I../../include -target aarch64-linux-gnu -march=armv8-a+crypto -fno-integrated-as --sysroot=./debian_jessie_arm64-sysroot -O2 -c MyFile.S -o MyFile.o -v  --save-temps
clang version 3.8.0 (trunk 247874)
Target: aarch64--linux-gnu
Thread model: posix
Found candidate GCC installation: ./src/build/linux/debian_jessie_arm64-sysroot/usr/lib/gcc/aarch64-linux-gnu/4.8
Selected GCC installation: ./src/build/linux/debian_jessie_arm64-sysroot/usr/lib/gcc/aarch64-linux-gnu/4.8
Candidate multilib: .;@m64
Selected multilib: .;@m64
 "clang" -cc1 -triple aarch64--linux-gnu -E -disable-free -main-file-name MyFile.S -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -no-integrated-as -mconstructor-aliases -fuse-init-array -target-cpu generic -target-feature +neon -target-feature +crypto -target-abi aapcs -v -dwarf-column-info -coverage-file MyFile.o -resource-dir ../lib/clang/3.8.0 -I gen -I ../../include -isysroot ./debian_jessie_arm64-sysroot -internal-isystem ./debian_jessie_arm64-sysroot/usr/local/include -internal-isystem ../lib/clang/3.8.0/include -internal-externc-isystem ./debian_jessie_arm64-sysroot/usr/include/aarch64-linux-gnu -internal-externc-isystem ./debian_jessie_arm64-sysroot/include -internal-externc-isystem ./debian_jessie_arm64-sysroot/usr/include -O2 -fno-dwarf-directory-asm -fdebug-compilation-dir ./out/Release -ferror-limit 19 -fmessage-length 205 -fallow-half-arguments-and-returns -fno-signed-char -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -o MyFile.s -x assembler-with-cpp ../../third_party/boringssl/linux-aarch64/crypto/modes/MyFile.S
clang -cc1 version 3.8.0 based upon LLVM 3.8.0svn default target x86_64-unknown-linux-gnu

#include "..." search starts here:
#include <...> search starts here:
 gen
 ../../third_party/boringssl/src/include
../lib/clang/3.8.0/include
./debian_jessie_arm64-sysroot/usr/include/aarch64-linux-gnu
./debian_jessie_arm64-sysroot/usr/include
End of search list.
 "/usr/bin/aarch64-linux-gnu-as" -I gen -I ../include -o MyFile.o MyFile.s
../../third_party/boringssl/linux-aarch64/crypto/modes/ghashv8-armx64.S:31: Error: selected processor does not support `pmull v0.1q,v20.1d,v20.1d'


Manually running  /usr/bin/aarch64-linux-gnu-as -march=armv8-a+crypto -I gen -I ../include -o MyFile.o MyFile.s works fine without any errors


-Sri


On Mon, Oct 26, 2015 at 12:05 PM, Tim Northover <t.p.no...@gmail.com> wrote:
On 26 October 2015 at 09:52, Sri via llvm-dev <llvm...@lists.llvm.org> wrote:
> I am passing "-march=armv8-a+crypto" to clang command but how do i promote
> the same flag to assembler arch64-linux-gnu-as through clang?

You could certainly argue Clang should be forwarding that argument
automatically (assuming you did specify it to Clang itself) as part of
supporting -fno-integrated-as. Not that I think we really encourage
-fno-integrated-as; what problems are you having with the internal
one?

Until someone fixes that issue though, you can use
"-Wa,-march=armv8-a+crypto" to give an argument to the assembler
manually.

Tim.



--
-Sri

Renato Golin via llvm-dev

unread,
Oct 26, 2015, 1:36:23 PM10/26/15
to Sri, LLVM Developers Mailing List
On 26 October 2015 at 17:31, Sri via llvm-dev <llvm...@lists.llvm.org> wrote:
> I am trying to build chromium and at this moment, They see some issues with
> internal one so recommended to use the flag -fno-integrated-as.

Hi Sri,

We were clearing all the bugs from the integrated assembler
(https://llvm.org/bugs/show_bug.cgi?id=20422), so if you could try it,
I'd love to hear how much we have progressed since the last time Hans
tried, for both ARM and AArch64.


> Manually running /usr/bin/aarch64-linux-gnu-as -march=armv8-a+crypto -I gen
> -I ../include -o MyFile.o MyFile.s works fine without any errors

Have you tried -Wa that Tim suggested? It should work just fine.

I agree Clang should pass down the architecture flags to the
assembler, but we're assuming the external assembler will accept all
variations Clang does, which may not be true.

cheers,
--renato

Sri via llvm-dev

unread,
Oct 26, 2015, 1:38:26 PM10/26/15
to Renato Golin, LLVM Developers Mailing List
Thanks alot Renato and Tim. 
Yes i tried and it worked fine. I am just trying to figure out minimizing my clags.

Thanks again.

On Mon, Oct 26, 2015 at 12:36 PM, Renato Golin <renato...@linaro.org> wrote:
On 26 October 2015 at 17:31, Sri via llvm-dev <llvm...@lists.llvm.org> wrote:
> I am trying to build chromium and at this moment, They see some issues with
> internal one so recommended to use the flag -fno-integrated-as.

Hi Sri,

We were clearing all the bugs from the integrated assembler
(https://llvm.org/bugs/show_bug.cgi?id=20422), so if you could try it,
I'd love to hear how much we have progressed since the last time Hans
tried, for both ARM and AArch64.


> Manually running  /usr/bin/aarch64-linux-gnu-as -march=armv8-a+crypto -I gen
> -I ../include -o MyFile.o MyFile.s works fine without any errors

Have you tried -Wa that Tim suggested? It should work just fine.

I agree Clang should pass down the architecture flags to the
assembler, but we're assuming the external assembler will accept all
variations Clang does, which may not be true.

cheers,
--renato



--
-Sri
Reply all
Reply to author
Forward
0 new messages