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

[BUG] cmake on macOS is broken #14936

Closed
1 task done
yamt opened this issue Nov 25, 2024 · 4 comments · Fixed by #15064
Closed
1 task done

[BUG] cmake on macOS is broken #14936

yamt opened this issue Nov 25, 2024 · 4 comments · Fixed by #15064
Labels
Arch: simulator Issues related to the SIMulator Area: Build system OS: Mac Issues related to MacOS (building system, etc) Type: Bug Something isn't working

Comments

@yamt
Copy link
Contributor

yamt commented Nov 25, 2024

Description / Steps to reproduce the issue

cmake sim build on macOS is broken.

it's partly because of #14852.
it doesn't seem like the only issue though.

(venv) spacetanuki% cmake -B build -DBOARD_CONFIG=sim:libcxxtest -GNinja
-- Initializing NuttX
  Select HOST_MACOS=y
  Select HOST_X86_64=y
--   CMake:  3.30.4
--   Ninja:  1.12.1
--   Board:  sim
--   Config: libcxxtest
--   Appdir: /Users/yamamoto/git/nuttx/apps
-- The C compiler identification is AppleClang 16.0.0.16000026
-- The CXX compiler identification is AppleClang 16.0.0.16000026
-- The ASM compiler identification is AppleClang
-- Found assembler: /Users/yamamoto/git/nuttx/prebuilt/ccache/bin/cc
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /Users/yamamoto/git/nuttx/prebuilt/ccache/bin/cc
-- Check for working C compiler: /Users/yamamoto/git/nuttx/prebuilt/ccache/bin/cc - broken
CMake Error at /usr/local/Cellar/cmake/3.30.4/share/cmake/Modules/CMakeTestCCompiler.cmake:67 (message):
  The C compiler

    "/Users/yamamoto/git/nuttx/prebuilt/ccache/bin/cc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: '/Users/yamamoto/git/nuttx/nuttx/build/CMakeFiles/CMakeScratch/TryCompile-XwhWZC'

    Run Build Command(s): /usr/local/bin/ninja -v cmTC_3fc14
    [1/2] /Users/yamamoto/git/nuttx/prebuilt/ccache/bin/cc   -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.1.sdk -mmacosx-version-min=14.7 -U_AIX -U_WIN32 -U__APPLE__ -U__FreeBSD__ -U__NetBSD__ -U__linux__ -U__sun__ -U__unix__ -U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ -fno-strict-aliasing -fomit-frame-pointer -fno-common -fvisibility=hidden -ffunction-sections -fdata-sections -Wall -Wshadow -Wundef -Wno-attributes -Wno-unknown-pragmas -Wstrict-prototypes -Wno-deprecated-declarations -no-pie -MD -MT CMakeFiles/cmTC_3fc14.dir/testCCompiler.c.o -MF CMakeFiles/cmTC_3fc14.dir/testCCompiler.c.o.d -o CMakeFiles/cmTC_3fc14.dir/testCCompiler.c.o -c /Users/yamamoto/git/nuttx/nuttx/build/CMakeFiles/CMakeScratch/TryCompile-XwhWZC/testCCompiler.c
    clang: warning: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument]
    [2/2] : && /Users/yamamoto/git/nuttx/prebuilt/ccache/bin/cc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.1.sdk -mmacosx-version-min=14.7 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -Wl,-no-pie -Wl,-dead_strip CMakeFiles/cmTC_3fc14.dir/testCCompiler.c.o -o cmTC_3fc14   && :
    FAILED: cmTC_3fc14
    : && /Users/yamamoto/git/nuttx/prebuilt/ccache/bin/cc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.1.sdk -mmacosx-version-min=14.7 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -Wl,-no-pie -Wl,-dead_strip CMakeFiles/cmTC_3fc14.dir/testCCompiler.c.o -o cmTC_3fc14   && :
    ld: unknown options: -no-pie
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    ninja: build stopped: subcommand failed.





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:407 (project)


-- Configuring incomplete, errors occurred!
(venv) spacetanuki% 

On which OS does this issue occur?

[OS: Mac]

What is the version of your OS?

macOS 14.7

NuttX Version

master

Issue Architecture

[Arch: simulator]

Issue Area

[Area: Build System]

Verification

  • I have verified before submitting the report.
@yamt yamt added the Type: Bug Something isn't working label Nov 25, 2024
@github-actions github-actions bot added Arch: simulator Issues related to the SIMulator Area: Build system OS: Mac Issues related to MacOS (building system, etc) labels Nov 25, 2024
@yamt
Copy link
Contributor Author

yamt commented Nov 25, 2024

@cuiziwei1 can you take a look? thank you.

@cuiziwei1
Copy link
Contributor

cuiziwei1 commented Dec 5, 2024

@yamt sorry about this, can you check if CONFIG_HOST_MACOS is enable?

@xuxin930
Copy link
Contributor

xuxin930 commented Dec 5, 2024

Hi @yamt @cuiziwei1
CONFIG_HOST_MACOS is loaded after CMake generator execution completed.

However, this error occurs during the ToolChain file verification phase.
At this time, the generator has not yet been successfully executed.
So CONFIG_HOST_MACOS cannot be read

let change NOT CONFIG_HOST_MACOS to NOT APPLE

xuxin930 added a commit to xuxin930/nuttx that referenced this issue Dec 5, 2024
@xiaoxiang781216
Copy link
Contributor

but can we unify the host check on both CMake and Makefile?

@xiaoxiang781216 xiaoxiang781216 linked a pull request Dec 5, 2024 that will close this issue
xiaoxiang781216 pushed a commit that referenced this issue Dec 5, 2024
linguini1 pushed a commit to CarletonURocketry/nuttx that referenced this issue Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arch: simulator Issues related to the SIMulator Area: Build system OS: Mac Issues related to MacOS (building system, etc) Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants