Skip to content

Conversation

Jason2866
Copy link
Contributor

currently the ASFLAG is set with the basic features.
The PR sets the ASFLAG accordingly to the setting done in CFLAGS

Tested and verified working in fork. The change only affects pioarduino

@me-no-dev

@troyhacks
Copy link

@Jason2866 I appreciate this. Thank you for looking into it!

@troyhacks
Copy link

Almost fixes it!

Current patch gives me:

ASFLAGS=[
    "-march=rv32imafc_zicsr_zifencei_xesppie"
],

ASPPFLAGS=[
    "-x", "assembler-with-cpp"
],

...which gives me p4_mul16x16.S.o: can't link soft-float modules with single-float modules for my p4_mul16x16.S file.

My experience says we need a bit more defined:

ASFLAGS=[
    "-march=rv32imafc_zicsr_zifencei_xesppie",
    "-mabi=ilp32f"
],

ASPPFLAGS=[
    "-x", "assembler-with-cpp",
    "-march=rv32imafc_zicsr_zifencei_xesppie",
    "-mabi=ilp32f"
],

@Jason2866
Copy link
Contributor Author

@troyhacks Mhh, in this case, the way it is done to provide the SCons flags ASFLAGS and ASPPFLAGS needs to be rethinked.
Will test if it works to use all AS_FLAGS for both

@Jason2866 Jason2866 marked this pull request as draft September 7, 2025 08:49
Refactor assembler flags handling to streamline the extraction of -march, -mabi, and -mlongcalls flags from CXX and CC flags.
@Jason2866 Jason2866 marked this pull request as ready for review September 7, 2025 11:47
@Jason2866
Copy link
Contributor Author

The needed flags are in PIOARDUINO_CXX_FLAGS or PIOARDUINO_CC_FLAGS (depends on MCU) and are extracted now from there. No hard coded arch flags now.

@Jason2866 Jason2866 changed the title Update ASFLAGS for esp32p4 target and default for riscv targets for pioarduino Update ASFLAGS for pioarduino Sep 7, 2025
@Jason2866
Copy link
Contributor Author

For the P4 the result is now

env.Append(
    ASFLAGS=[
        "-march=rv32imafc_zicsr_zifencei_xesppie",
        "-mabi=ilp32f",
    ],

    ASPPFLAGS=[
        "-march=rv32imafc_zicsr_zifencei_xesppie",
        "-mabi=ilp32f",
        "-x", "assembler-with-cpp"
    ],

@troyhacks
Copy link

Amazing. I will try the next time I build!

@me-no-dev me-no-dev merged commit 1cec1dd into espressif:master Sep 10, 2025
10 checks passed
@Jason2866 Jason2866 deleted the patch-2 branch September 10, 2025 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants