llvm / llvm/llvm-project

[ARM64EC] LTO fails with a simple C++ testcase

Open
#168,469 3 comments 1 reaction 0 assignees View on GitHub
LTO platform:windows
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

Consider the following:

```
int main() { return (long long)new int[11]; }
```

Building in a VS2022 developer command prompt:

```
> clang-cl newtest.cpp /O2 /arm64EC -flto -fuse-ld=lld
lld-link: error: undefined symbol: void * __cdecl operator new[](unsigned __int64) (EC symbol)
>>> referenced by newtest.cpp
>>> [...]\newtest-bfd17a.obj
clang-cl: error: linker command failed with exit code 1 (use -v to see invocation)
```

Works fine without -flto.

I suspect this is an issue with the symbol table of the bitcode file. But I haven't spent time trying to figure out the current state of LTO with Arm64EC, in general.

CC @cjacek

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.