Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: dump out --with-arch options the compiler was built with #775

Closed
MarcKarasek opened this issue Nov 16, 2020 · 4 comments
Closed

Comments

@MarcKarasek
Copy link

option for gcc to printout what arch extensions it was built with.

for example built with --with-arch=rv64imafdc some option to dump rv64imafdc to console.

Something like --arch

@jim-wilson
Copy link
Collaborator

gcc -v will show the configure options, including the --with-arch and --with-abi if any.

touch tmp.c; gcc -v tmp.c will show default options passed to cc1 and as which will show the default arch and abi options.

touch tmp.c; gcc -E -dM | grep __riscv will show the default predefined RISC-V macros. This doesn't give arch directly, but will give xlen and all extensions. It also give the abi by combining xlen and the float abi.

If you have an embedded elf compiler, then "touch tmp.c; gcc -S tmp.c; grep arch tmp.s" will give arch.

touch tmp.c; gcc -c tm-.c; readelf -h tmp.o will give float ABI. You can get xlen from whether this is ELF32 or ELF64. That gives you ABI.

@MarcKarasek
Copy link
Author

MarcKarasek commented Nov 16, 2020 via email

@TommyMurphyTM1234
Copy link
Collaborator

Duplicate issue?

#1101

@TommyMurphyTM1234
Copy link
Collaborator

-dumpspecs also shows the default arch/abi:

./riscv32-unknown-linux-gnu-gcc -dumpspecs 
...
*multilib_defaults:
march=rv32imafdc mabi=ilp32d
...

On this basis I'm closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants