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

gollvm, libbacktrace: CMake's checks on _alloca, __alloca #40658

Closed
advancedwebdeveloper opened this issue Aug 9, 2020 · 1 comment
Closed

Comments

@advancedwebdeveloper
Copy link

From my CMakeError.log file:

Determining if the function _alloca exists failed with the following output:
Change Dir: D:/workarea/test.rel/CMakeFiles/CMakeTmp

Run Build Command(s):D:/Python38-32/Scripts/ninja.exe cmTC_44264 && [1/2] Building C object CMakeFiles\cmTC_44264.dir\CheckFunctionExists.c.obj

FAILED: CMakeFiles/cmTC_44264.dir/CheckFunctionExists.c.obj

D:\LLVM\bin\clang-cl.exe /nologo /DWIN32 /D_WINDOWS /W3 -DCHECK_FUNCTION_EXISTS=_alloca -Werror=unguarded-availability-new /MDd /Zi /Ob0 /Od /RTC1 /showIncludes /FoCMakeFiles\cmTC_44264.dir\CheckFunctionExists.c.obj /FdCMakeFiles\cmTC_44264.dir\ -c D:\CMake\share\cmake-3.18\Modules\CheckFunctionExists.c

D:\CMake\share\cmake-3.18\Modules\CheckFunctionExists.c(7,3): error: conflicting types for '_alloca'
CHECK_FUNCTION_EXISTS(void);
^
(6,31): note: expanded from here
#define CHECK_FUNCTION_EXISTS _alloca
^
D:\CMake\share\cmake-3.18\Modules\CheckFunctionExists.c(7,3): *note: '_alloca' is a builtin with type 'void (unsigned long long)'
(6,31): note: expanded from here
#define CHECK_FUNCTION_EXISTS _alloca
^
D:\CMake\share\cmake-3.18\Modules\CheckFunctionExists.c(17,25): error: too few arguments to function call, expected 1, have 0
CHECK_FUNCTION_EXISTS();

2 errors generated.
ninja: build stopped: subcommand failed.

I see that it is present within Microsoft's include directories/headers: https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/alloca?view=vs-2019

And this function shouldn't be searched, on Windows, since it never had to exist (within any header file):

Determining if the function __alloca exists failed with the following output:
Change Dir: D:/workarea/test.rel/CMakeFiles/CMakeTmp

Run Build Command(s):D:/Python38-32/Scripts/ninja.exe cmTC_8b6e0 && [1/2] Building C object CMakeFiles\cmTC_8b6e0.dir\CheckFunctionExists.c.obj

[2/2] Linking C executable cmTC_8b6e0.exe

FAILED: cmTC_8b6e0.exe

cmd.exe /C "cd . && D:\CMake\bin\cmake.exe -E vs_link_exe --intdir=CMakeFiles\cmTC_8b6e0.dir --rc="C:\Program Files (x86)\WINDOW1\10\bin\1001901.0\x64\rc.exe" --mt="C:\Program Files (x86)\WINDOW1\10\bin\1001901.0\x64\mt.exe" --manifests -- D:\LLVM\bin\lld-link.exe /nologo CMakeFiles\cmTC_8b6e0.dir\CheckFunctionExists.c.obj /out:cmTC_8b6e0.exe /implib:cmTC_8b6e0.lib /pdb:cmTC_8b6e0.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."

LINK Pass 1: command "D:\LLVM\bin\lld-link.exe /nologo CMakeFiles\cmTC_8b6e0.dir\CheckFunctionExists.c.obj /out:cmTC_8b6e0.exe /implib:cmTC_8b6e0.lib /pdb:cmTC_8b6e0.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:CMakeFiles\cmTC_8b6e0.dir/intermediate.manifest CMakeFiles\cmTC_8b6e0.dir/manifest.res" failed (exit code 1) with the following output:
lld-link: error: undefined symbol: __alloca

referenced by D:\CMake\share\cmake-3.18\Modules\CheckFunctionExists.c:17

          CMakeFiles\cmTC_8b6e0.dir\CheckFunctionExists.c.obj:(main)

ninja: build stopped: subcommand failed.

What did you expect to see?

-- Looking for _alloca
-- Looking for _alloca - found
-- Looking for __alloca
-- Looking for __alloca - not found

or, if being more precise:

-- Looking for _alloca
-- Looking for _alloca - found

What did you see instead?

-- Looking for _alloca
-- Looking for _alloca - not found
-- Looking for __alloca
-- Looking for __alloca - not found

Ivan

@cherrymui
Copy link
Member

Currently gollvm does not support Windows, so it is expected not to work. If you want to work on it, that is great. Otherwise there is no need to file a bug report, as it is technically not a bug. Thanks.

@golang golang locked and limited conversation to collaborators Aug 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants