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

Improper build support for multi-target ARM + Risc-V project #496

Open
nvitya opened this issue Oct 24, 2021 · 13 comments
Open

Improper build support for multi-target ARM + Risc-V project #496

nvitya opened this issue Oct 24, 2021 · 13 comments
Labels

Comments

@nvitya
Copy link

nvitya commented Oct 24, 2021

Description

Hi,

I've created a project with multiple build configurations. The project was originally created with Risc-V target, and then I've added a build configuration with ARM (Cortex-M). The build configuration for ARM is not fully supported. At the Project properties / "C/C++ Build" / "Settings" / "Toolchains" tab is a limited version is displayed without "Create Flash Image" and "Print Size" checkboxes.

The build basically works for the ARM, but without creating HEX file or printing the size of the compiled project.

If you create a new project with ARM first then the ARM is fully supported and the Risc-V build will be somewhat limited.

Steps to Reproduce

  1. Create a C/C++ Managed Project with "Risc-V Cross GCC"
  2. Add a new build configuration "ARM TEST", and set the toolchain to "Arm Cross GCC"
  3. Select the "ARM TEST" build configuration, and go to the Project properties / "C/C++ Build" / "Settings" / "Toolchains" tab

Expected behaviour: there should be the "Create Flash Image" and "Print Size" checkboxes.

Actual behaviour: they are not there...

Versions

  • [plug-in version] 6.1.2.202102181132
  • [Eclipse version] 19-06, 21-09 (4.21)
  • [Java version] OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.20.04)
  • [operating system] KUbuntu 20.04
  • [toolchain version]
@ilg-ul ilg-ul added the bug label Oct 24, 2021
@ilg-ul
Copy link
Contributor

ilg-ul commented Oct 24, 2021

I confirm the bug.

ilg-ul added a commit that referenced this issue Oct 24, 2021
@ilg-ul ilg-ul added this to the v6.1.3 milestone Oct 24, 2021
@ilg-ul
Copy link
Contributor

ilg-ul commented Oct 24, 2021

The problem was related to the logic that identifies own managed build plug-ins by the ids, which use both ilg.gnuarmeclipse and ilg.gnumcueclipse.

Fixed on 2021-10-24.

@ilg-ul
Copy link
Contributor

ilg-ul commented Oct 24, 2021

Please use Install new Software to install the 6.2.0 pre-release from:

and let me know if it is ok.

@nvitya
Copy link
Author

nvitya commented Oct 25, 2021

I've installed the pre-release. Now the "Toolchains" tabs looks the same, but still no HEX file generation and size report is done, however the checkboxes are active. Even if I toggled them.
I've also created a new project from zero to test it properly, without success (still no HEX + size report for the secondary architecture - after successful compilation and linking).

@ilg-ul
Copy link
Contributor

ilg-ul commented Oct 25, 2021

Can you double check if you have the 6.2.0 features installed?

Screenshot 2021-10-25 at 22 29 33

The bug affected the logic used to decide what elements should be displayed, and normally should not store anything in the persistent store, so it should help for old projects too.

@ilg-ul
Copy link
Contributor

ilg-ul commented Oct 25, 2021

Here it is how it looks on my Mac:

Screenshot 2021-10-25 at 22 25 12

The original build configurations were created for RISC-V:

Screenshot 2021-10-25 at 22 26 56

@nvitya
Copy link
Author

nvitya commented Oct 25, 2021

Yes, that's fine, I see these pages already too. But the "Create flash image" and "Print size" does not have an effect on the second created architecture.

@ilg-ul
Copy link
Contributor

ilg-ul commented Oct 25, 2021

Ah, that's different. So you see the radio buttons, but the functionality associated with them is not there?

@nvitya
Copy link
Author

nvitya commented Oct 25, 2021

multiarch_test.zip

Here is a small test project.
Risc-V output:

21:39:50 **** Build of configuration RV32I for project multiarch_test ****
make all 
Building file: ../main.c
Invoking: GNU RISC-V Cross C Compiler
riscv-none-embed-gcc -march=rv32i -msmall-data-limit=8 -mno-save-restore -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding  -g3 -std=gnu11 -MMD -MP -MF"main.d" -MT"main.o" -c -o "main.o" "../main.c"
Finished building: ../main.c
 
Building target: multiarch_test.elf
Invoking: GNU RISC-V Cross C Linker
riscv-none-embed-gcc -march=rv32i -msmall-data-limit=8 -mno-save-restore -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding  -g3 -nostartfiles -Xlinker --gc-sections -Wl,-Map,"multiarch_test.map" --specs=nano.specs -o "multiarch_test.elf"  ./main.o   
Finished building target: multiarch_test.elf
 
Invoking: GNU RISC-V Cross Create Flash Image
riscv-none-embed-objcopy -O ihex "multiarch_test.elf"  "multiarch_test.hex"
Finished building: multiarch_test.hex
 
Invoking: GNU RISC-V Cross Print Size
riscv-none-embed-size --format=berkeley "multiarch_test.elf"
   text	   data	    bss	    dec	    hex	filename
     32	      0	      0	     32	     20	multiarch_test.elf
Finished building: multiarch_test.siz
 
21:39:50 Build Finished. 0 errors, 0 warnings. (took 161ms)

ARMM compile output:

21:44:04 **** Incremental Build of configuration ARMM for project multiarch_test ****
make all 
Building file: ../main.c
Invoking: GNU Arm Cross C Compiler
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -O2 -fmessage-length=0 -ffunction-sections -fdata-sections -ffreestanding  -g -std=gnu11 -MMD -MP -MF"main.d" -MT"main.o" -c -o "main.o" "../main.c"
Finished building: ../main.c
 
Building target: multiarch_test.elf
Invoking: GNU Arm Cross C Linker
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -O2 -fmessage-length=0 -ffunction-sections -fdata-sections -ffreestanding  -g -nostartfiles -Xlinker --gc-sections -Wl,-Map,"multiarch_test.map" --specs=nano.specs -o "multiarch_test.elf"  ./main.o   
Finished building target: multiarch_test.elf
 

21:44:04 Build Finished. 0 errors, 0 warnings. (took 110ms)

@ilg-ul
Copy link
Contributor

ilg-ul commented Oct 25, 2021

Thank you, that should be helpful.

I don't know yet how difficult to fix is this, I'll further investigate.

@ilg-ul
Copy link
Contributor

ilg-ul commented Oct 25, 2021

I successfully imported your project and took a look at the .cproject file. At first sight I could not spot anything wrong, it'll require a more thorough analysis.

The creation of the make files is done in the parent CDT classes, based on the content of .cproject and the toolchain definitions in the plug-ins.

I'll take a second look in a few days, time permitting.

@ilg-ul ilg-ul modified the milestones: v6.1.3, v6.2.1, Time permitting Apr 4, 2022
@ilg-ul
Copy link
Contributor

ilg-ul commented Jun 11, 2022

I confirm that I encountered this issue myself.

My use case was reversed, I had several Arm build configurations and added a RISC-V configuration. So the problem is not specific to Arm or RISC-V separately, it seems to affect all configurations.

The 3 options related to hex/listing/size did not show in the configuration page, although they were present in the .cproject. However they were functional, the build created those files, and manually editing .cproject changed the behaviour.

@jonahgraham, time permitting, probably we should try to identify why CDT does not display these options, otherwise functional in ECDT.

@ilg-ul
Copy link
Contributor

ilg-ul commented Jun 12, 2022

@jonahgraham, please ignore the previous request, I took a more careful look and the missing widgets are not in the tab rendered by CDT, but in a tab rendered by the ECDT plug-ins, so it is a bug in my code.

I'll fix it shortly.

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

No branches or pull requests

2 participants