nuttx icon indicating copy to clipboard operation
nuttx copied to clipboard

cmake:fix protected build link option break,init canmv230 protected build

Open xuxin930 opened this issue 1 year ago • 9 comments

Summary

this should resolve https://github.com/apache/nuttx/issues/12019#issuecomment-2024806454

the link_option of nuttx_user target should be allowed to be set freely

Impact

protected mode

Testing

cmake -B build -DBOARD_CONFIG=canmv230/pnsh

cmake --build build 

xuxin930 avatar Mar 29 '24 08:03 xuxin930

@xuxin930 @xiaoxiang781216 any idea why the CI reported this issue many times:

Check failure on line 51 in include/nuttx/wdog.h GitHub Actions / macOS (macos)

missing binary operator before token "("

acassis avatar Mar 29 '24 11:03 acassis

@acassis @xiaoxiang781216 The problem is here https://github.com/apache/nuttx/actions/runs/8479414330/job/23233475816?pr=12022#step:7:1313 Configuring... make: *** [olddefconfig] Error 1 Enabling CONFIG_ARM_TOOLCHAIN_GNU_EABI make: *** [olddefconfig] Error 1

I think clearing the cache solves the problem https://github.com/apache/nuttx/actions/caches

simbit18 avatar Mar 29 '24 11:03 simbit18

@acassis @xiaoxiang781216 The problem is here https://github.com/apache/nuttx/actions/runs/8479414330/job/23233475816?pr=12022#step:7:1313 Configuring... make: *** [olddefconfig] Error 1 Enabling CONFIG_ARM_TOOLCHAIN_GNU_EABI make: *** [olddefconfig] Error 1

I think clearing the cache solves the problem https://github.com/apache/nuttx/actions/caches

@acassis @simbit18 It seems that similar situations have happened before refer to: https://github.com/apache/nuttx/pull/10543

xuxin930 avatar Mar 29 '24 14:03 xuxin930

@xuxin930 exactly !!! cache must be cleared manually.

simbit18 avatar Mar 29 '24 15:03 simbit18

@xuxin930

I tried this and it works, the artifact runs on CanMV230 device as well:

ABC                                                                             
NuttShell (NSH) NuttX-12.4.0                                                    
nsh> cat /proc/version                                                          
NuttX version 12.4.0 da63218c4d Apr  5 2024 08:03:09 canmv230/pnsh
nsh> free                                                                       
                   total       used       free    maxused    maxfree  nused  nfree                                                                              
        Kmem:    1034232       5816    1028416       6408    1028368     16     2                                                                              
        Umem:    1045112       6040    1039072       6040    1039072      9     1 

Only one minor issue met during CMake configuration process:

$ rm -rf * && cmake ~/Projects/Nuttx/nuttx -DBOARD_CONFIG=canmv230/pnsh -G Ninja 
-- Initializing NuttX
--   Board:  canmv230
--   Config: pnsh
--   Appdir: /home/yf/Projects/Nuttx/nuttx/../apps
-- The C compiler identification is GNU 10.2.0
-- The CXX compiler identification is GNU 10.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/riscv64-unknown-elf-gcc
riscv64-unknown-elf-gcc: error:  -Wstrict-prototypes -fno-common -Wall -Wshadow -Wundef -Wno-attributes -Wno-unknown-pragmas: No such file or directory
-- Configuring done
-- Generating done
-- Build files have been written to: /home/yf/tmp/bbb

yf13 avatar Apr 05 '24 00:04 yf13

@xuxin930,

Here I tried this again with GCC toolchain v10.2 got via apt install gcc-riscv64-unknown-elf on Ubuntu.

It seems that we can avoid the above cmake config time warning by dropping the CMAKE_C_FLAGS from the libgcc checking command in line 755.

yf13 avatar Jul 11 '24 01:07 yf13

@xuxin930 should we rebase the code

xiaoxiang781216 avatar Jul 15 '24 12:07 xiaoxiang781216

@xuxin930 should we rebase the code

Done, rebased

xuxin930 avatar Jul 15 '24 13:07 xuxin930

CI seems failed because fetch timeout try retrigger

xuxin930 avatar Jul 16 '24 02:07 xuxin930