-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[win][arm64ec] Fixes to unblock building LLVM and Clang as Arm64EC #150068
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -79,7 +79,7 @@ inline BENCHMARK_ALWAYS_INLINE int64_t Now() { | |
| int64_t ret; | ||
| __asm__ volatile("rdtsc" : "=A"(ret)); | ||
| return ret; | ||
| #elif defined(__x86_64__) || defined(__amd64__) | ||
| #elif (defined(__x86_64__) || defined(__amd64__)) && !defined(__arm64ec__) | ||
| uint64_t low, high; | ||
| __asm__ volatile("rdtsc" : "=a"(low), "=d"(high)); | ||
| return (high << 32) | low; | ||
|
|
@@ -139,7 +139,7 @@ inline BENCHMARK_ALWAYS_INLINE int64_t Now() { | |
| struct timespec ts = {0, 0}; | ||
| clock_gettime(CLOCK_MONOTONIC, &ts); | ||
| return static_cast<int64_t>(ts.tv_sec) * 1000000000 + ts.tv_nsec; | ||
| #elif defined(__aarch64__) | ||
| #elif defined(__aarch64__) || defined(__arm64ec__) | ||
|
||
| // System timer of ARMv8 runs at a different frequency than the CPU's. | ||
| // The frequency is fixed, typically in the range 1-50MHz. It can be | ||
| // read at CNTFRQ special register. We assume the OS has set up | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This syntax is not supported by lld-linker, so this is causing linking failures on Windows using lld-link. Can you please have a look? Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then that's a bug with lld-link, since it's a documented and supported format for MSVC's linker: https://learn.microsoft.com/en-us/cpp/build/reference/export-exports-a-function?view=msvc-170
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please point me to an example of one of these failures? It seems like lld should correctly handle this...
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are seeing this in internal build using lld-linker on windows.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, ok, it is not
lld-linknot supporting,DATA, it is the icx compiler driver icx not supporting this. :("icx.exe /Qoption,link,/machine:x64 -fuse-ld=lld /Qoption,link,/EXPORT:??_7type_info@@6b@,DATA lib/LLVMRuntimeDyld.lib -v
"lld-link" -out:LLVMRuntimeDyld.exe "-libpath:..." -nologo /machine:x64 /EXPORT:??_7type_info@@6b@ DATA lib/LLVMRuntimeDyld.lib
lld-link: error: could not open 'DATA': no such file or directory
icx: error: linker command failed with exit code 1 (use -v to see invocation)"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a bug in icx driver, we will investigate and fix ourselves. Sorry for the false alarm.