Closed Irvise closed 3 months ago
Most likely you have an old configuration.in in your platform directory.
The master Makefile (if not in the process of configuration with the "createkernelcfg" target) tries to read the kernel.cfg file.
You probably have a "PLATFORM :=
The "CPU :=" line selects the "whole" CPU type. I recently made some changes in order to select a CPU model. Check if the
CPU_MODEL :=
Current accepted values are: CPU_MODEL := RV32[xxxxx] (e.g., RV32, RV32IMAFC, etc) CPU_MODEL := RV64[xxxxx] (e.g., RV64, RV64IMAC, etc)
CPU_MODEL so far is only a coarse select between SweetAda's 32/64-bit cpu libraries.
The problem vanishes because you just overrides values in the command line with correct ones.
Then, the exact string specifier of your CPU model must be recognized by your toolchain, otherwise you get an error during the compile phase, but this is another story because you have to write it down in GCC_SWITCHES_PLATFORM with something like "-march=......".
That being said, I can think about a change, so that the configuration file is not read when one specifies an empty target or the "help" target. Maybe also a message hint if the CPU is wrong. Errors in configuration files should not interfere with other Makefile targets, that is fair. I've already taken countemeasures, but this case perhaps is not covered.
Let me know if this solves your problem, bye.
Hi Gabriele,
I have just done a clean clone of SweetAda, and, without any other modifications or changes, when I run make help
, the problem still exists. I assume there are no "dirty" files as it is a clean clone. Here is what I just did:
fernando@localhost:~/Build> git clone --depth=1 https://github.com/gabriele-galeotti/SweetAda SweetAda-truck
Cloning into 'SweetAda-truck'...
remote: Enumerating objects: 1652, done.
remote: Counting objects: 100% (1652/1652), done.
remote: Compressing objects: 100% (1129/1129), done.
remote: Total 1652 (delta 1128), reused 758 (delta 512), pack-reused 0
Receiving objects: 100% (1652/1652), 4.45 MiB | 7.13 MiB/s, done.
Resolving deltas: 100% (1128/1128), done.
fernando@localhost:~/Build> cd SweetAda-truck/
fernando@localhost:~/Build/SweetAda-truck> make help
Makefile:548: *** Error: no valid CPU. Stop.
fernando@localhost:~/Build/SweetAda-truck>
After selecting a CPU, it does work as expected:
fernando@localhost:~/Build/SweetAda-truck> make help CPU=RISC-V
cpus/RISC-V/configuration.in:11: *** Warning: "": no CPU model supported. Available CPU_MODEL are: RV32[...] RV64[...].
make help (default)
Display an help about make targets.
make [RTS=<rts>] [CPU=<cpu>] [CPU_MODEL=<cpu_model>] [TOOLCHAIN_NAME=<toolchain_name>] rts
Build RTS <rts> for CPU <cpu> [CPU model <cpu_model>] using toolchain <toolchain_name>.
make PLATFORM=<platform> [SUBPLATFORM=<subplatform>] createkernelcfg
Create the 'kernel.cfg' main configuration file.
make configure
Create configuration/support files for this platform.
make all
Perform the same as 'make kernel'.
[...]
It would be better if not even the CPU had to be selected. After all, a new user may not know the available CPU values that the Makefile is expecting.
Best regards, Fer
An update from my side.
From the indications that you gave me, you are right. I indeed have the $CPU
variable set to x86_64
. I do not know where it comes from or where it is set.
After I run a unset CPU
and I ask make help
, it works without issue!!!
I will close the issue now as this is related to my own computer and not SweetAda.
Thank you very much for your help, Fer
When running
make
ormake help
, the errorMakefile:522: *** Error: no valid CPU. Stop.
shows up. Nothing else gets printed.The line 522 is being processed before the target
help
, and therefore it errors out even before printing any form or useful information.Could the
help
target be moved earlier than the checks in order to ensure that it can always be printed?Edit:
If i run
make CPU=RISC-V
the error then becomescpus/RISC-V/configuration.in:11: *** Error: : no CPU model supported. Stop.
as I have not provided the variant version. I believe the error message should report what the user has to select. Something likeAfter running
make CPU=RISC-V CPU_MODEL=RV32
, the help finally appears.