Skip to content

Unresolved external symbol in X86 inline asm after r314493/r314494 #34638

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

Open
llvmbot opened this issue Nov 13, 2017 · 2 comments
Open

Unresolved external symbol in X86 inline asm after r314493/r314494 #34638

llvmbot opened this issue Nov 13, 2017 · 2 comments
Labels
backend:X86 bugzilla Issues migrated from bugzilla inline-asm

Comments

@llvmbot
Copy link
Member

llvmbot commented Nov 13, 2017

Bugzilla Link 35290
Version unspecified
OS Windows NT
Blocks #11360
Reporter LLVM Bugzilla Contributor
CC @jrmuizel,@RKSimon,@rnk

Extended Description

I bisected this to r314493/r314494:

$ cat yuv_row_table.cpp
extern const int kCoefficientsRgbY[1];
const int kCoefficientsRgbY[1] = {0};
int main() { return 0; }

$ cat yuv_row_win.cpp
extern const int kCoefficientsRgbY[1];
void FastConvertYUVToRGB32Row_SSE() {
  __asm {
    movq      mm1, [kCoefficientsRgbY + 8 * eax]
  }
}

$ clang-cl.exe -m32 yuv_row_table.cpp yuv_row_win.cpp
yuv_row_win-f72966.obj : error LNK2019: unresolved external symbol kCoefficientsRgbY referenced in function "void __cdecl FastConvertYUVToRGB32Row_SSE(void)" (?FastConvertYUVToRGB32Row_SSE@@YAXXZ)
yuv_row_table.exe : fatal error LNK1120: 1 unresolved externals
@llvmbot
Copy link
Member Author

llvmbot commented Dec 4, 2017

it's basically due to the use of mangled names, which aforementioned patches/revs aren't bothered with introducing as part of the (IR) incarnation of the inline-asm string.
fix is relatively easy (and ugly), hope i'll get there anytime soon

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
@llvmbot
Copy link
Member Author

llvmbot commented Jul 6, 2024

@llvm/issue-subscribers-backend-x86

Author: None (llvmbot)

| | | | --- | --- | | Bugzilla Link | [35290](https://llvm.org/bz35290) | | Version | unspecified | | OS | Windows NT | | Blocks | llvm/llvm-project#11360 | | Reporter | LLVM Bugzilla Contributor | | CC | @jrmuizel,@RKSimon,@rnk |

Extended Description

I bisected this to r314493/r314494:

$ cat yuv_row_table.cpp
extern const int kCoefficientsRgbY[1];
const int kCoefficientsRgbY[1] = {0};
int main() { return 0; }

$ cat yuv_row_win.cpp
extern const int kCoefficientsRgbY[1];
void FastConvertYUVToRGB32Row_SSE() {
  __asm {
    movq      mm1, [kCoefficientsRgbY + 8 * eax]
  }
}

$ clang-cl.exe -m32 yuv_row_table.cpp yuv_row_win.cpp
yuv_row_win-f72966.obj : error LNK2019: unresolved external symbol kCoefficientsRgbY referenced in function "void __cdecl FastConvertYUVToRGB32Row_SSE(void)" (?FastConvertYUVToRGB32Row_SSE@@<!-- -->YAXXZ)
yuv_row_table.exe : fatal error LNK1120: 1 unresolved externals

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:X86 bugzilla Issues migrated from bugzilla inline-asm
Projects
None yet
Development

No branches or pull requests

2 participants