nuttx icon indicating copy to clipboard operation
nuttx copied to clipboard

arch/sim/cmake: remove the host specific -U when HOSTSRCS

Open jasonbu opened this issue 1 year ago • 1 comments

Summary

fix macos compile hostfs.c compile issue. /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/_string.h:131:62: error: expected function body after function declarator 131 | char *stpncpy(char *__dst, const char *__src, size_t __n) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); |

there is still deadloop on macos native sim, memset->bzero->memset... local remove the bzero can make macos run succ.

Impact

fix macos cmake build problem.

Testing

CI-test & macos, sim:nsh local build.

# nuttx dir
cmake -B ../build -DBOARD_CONFIG=sim:nsh -GNinja
cmake --build ../build -j
../build/nuttx

jasonbu avatar Oct 21 '24 18:10 jasonbu

[Experimental Bot, please feedback here]

NuttX PR Requirements Review

This PR appears to partially meet the NuttX requirements. Here's a breakdown:

Strengths:

  • Summary: Clearly states the "why" (fix compile issue) and "what" (addressing stpncpy error and removing bzero causing deadloop). However, it could benefit from a more detailed explanation of how the bzero issue was addressed.
  • Impact: Highlights the positive impact on macOS CMake builds.
  • Testing: Provides specific testing environments (CI, macOS, sim:nsh) and build commands for reproducibility. The inclusion of testing logs is commendable.

Areas for Improvement:

  • Summary:
    • Expand on the bzero fix. Was it simply removed, or replaced with a different function?
    • Include relevant NuttX Issue numbers if applicable.
  • Impact:
    • While it mentions fixing a build problem, specify if this is a new feature, existing feature change, or a bug fix.
    • The other impact fields (hardware, documentation, security, compatibility) are left blank. Even if the answer is "NO", it's good practice to explicitly state it for clarity.
  • Testing:
    • Before Change Logs: Currently missing. Include logs demonstrating the original compile error and the bzero deadloop to highlight the problem being solved.

Recommendation:

Before merging, consider addressing the "Areas for Improvement" to enhance clarity and completeness. This will make it easier for reviewers to understand the PR's full scope and impact.

nuttxpr avatar Oct 21 '24 18:10 nuttxpr

@xiaoxiang781216 @xuxin930 @jasonbu this pr broke build msvc

https://github.com/simbit18/nuttx_test_pr/actions/runs/11498059450/job/32003163671#step:8:1780 sched.vcxproj -> D:\a\nuttx_test_pr\nuttx_test_pr\sources\nuttx\vs2022\sched\Debug\sched.lib Generating nuttx_all.lib Microsoft (R) Library Manager Version 14.41.34123.0 Copyright (C) Microsoft Corporation. All rights reserved.

Building Custom Rule D:/a/nuttx_test_pr/nuttx_test_pr/sources/nuttx/CMakeLists.txt Building Custom Rule D:/a/nuttx_test_pr/nuttx_test_pr/sources/nuttx/CMakeLists.txt HOST_COMPILE_OPTIONS-NOTFOUND /HOST_COMPILE_OPTIONS-NOTFOUND(1,1): error C1083: Cannot open source file: 'HOST_COMPILE_OPTIONS-NOTFOUND': No such file or directory [D:\a\nuttx_test_pr\nuttx_test_pr\sources\nuttx\vs2022\nuttx.vcxproj] (compiling source file '/HOST_COMPILE_OPTIONS-NOTFOUND')

simbit18 avatar Oct 24 '24 11:10 simbit18

@xiaoxiang781216 @xuxin930 @jasonbu this pr broke build msvc

https://github.com/simbit18/nuttx_test_pr/actions/runs/11498059450/job/32003163671#step:8:1780 sched.vcxproj -> D:\a\nuttx_test_pr\nuttx_test_pr\sources\nuttx\vs2022\sched\Debug\sched.lib Generating nuttx_all.lib Microsoft (R) Library Manager Version 14.41.34123.0 Copyright (C) Microsoft Corporation. All rights reserved.

Building Custom Rule D:/a/nuttx_test_pr/nuttx_test_pr/sources/nuttx/CMakeLists.txt Building Custom Rule D:/a/nuttx_test_pr/nuttx_test_pr/sources/nuttx/CMakeLists.txt HOST_COMPILE_OPTIONS-NOTFOUND /HOST_COMPILE_OPTIONS-NOTFOUND(1,1): error C1083: Cannot open source file: 'HOST_COMPILE_OPTIONS-NOTFOUND': No such file or directory [D:\a\nuttx_test_pr\nuttx_test_pr\sources\nuttx\vs2022\nuttx.vcxproj] (compiling source file '/HOST_COMPILE_OPTIONS-NOTFOUND')

@simbit18 I did not try the win host and re-produce the problem, please help me verify if it will work, I will do verify later. please review #14499. the problem should be COMPILE_OPTIONS is not set yet in nuttx cmake target at this time.

jasonbu avatar Oct 24 '24 12:10 jasonbu