Page 1 of 1

Calling convention

Posted: Mon Jan 15, 2018 6:02 pm
by pdelprat
Hello,

Is it possible to change calling convention with xtensa-esp32-elf-gcc ?

Kind regards,
Pascal

Re: Calling convention

Posted: Mon Jan 15, 2018 9:01 pm
by ESP_Angus
Hi Pascal,

Unfortunately not. When gcc is compiled to target an xtensa core, it's compiled with an "overlay" file of source/header files that describes that core's specific features. This is used to "configure" gcc at compile time. The overlay includes the ABI configuration. For our ESP32 toolchain it can be found here:
https://github.com/espressif/crosstool- ... x/overlays

(There's an xtensa-config.h file in the xtensa_esp32.tar file.)

To change ABIs you need to recompile gcc with a modified overlay.

Why do you ask?


Angus

Re: Calling convention

Posted: Mon Jan 15, 2018 9:55 pm
by pdelprat
Hello Angus,

Thanks for your quick answer,

Why this question ? The answer is related to MSIL. I'm working on a project to compile MSIL to extensa processor.

I'm learning how gcc generate assembler, and the calling convention is based on store parameters on registers more than on the stack, which is not realy the way of MSIL works.

Kind regards,
Pascal