-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
i686 mingw-w64 comdat functions use wrong .text section name #38566
Comments
Potential fix Questions I have:
Any feedback is welcome, and I am happy to submit another patch incorporating any suggested changes. |
Please consider for 7.0.1 release. This prevents using Clang 7 on i686 Windows NT. Thank you. |
Sorry, that should have read, "This prevents using Clang 7 for i686 Windows NT with GCC/mingw-w64." |
Has this patch been submitted to phabricator? |
Sorry, I'm new to this process. I've created a review now. https://reviews.llvm.org/D54762 |
Tom, feel free to merge r347431 to 7.0.1, although you might want to let it bake in tree for a few days. |
Added bug 39781 to track the merge. |
Extended Description
If you simply build and run the example from the original mingw-w64 comdat ABI compatibility bug (https://github.com/Alexpux/MINGW-packages/issues/1677#issuecomment-394906508, also below) for i686, it shows we don't use the right section names:
$ cat a.cpp
inline int foo(int a, int b) { return a + b; }
int bar(void);
int main() { return foo(1, 2) + bar(); }
$ cat b.cpp
inline int foo(int a, int b) { return a + b; }
int bar() { return foo(3, 4); }
$ gcc -m32 a.cpp -c -o a.o && clang --target=i686-w64-windows-gnu -c b.cpp -o b.o
$ dumpbin a.o | grep text
34 .text
10 .text$_Z3fooii
$ dumpbin b.o | grep text
1F .text
1F .text$__Z3fooii
Clang adds the extra '_' for Windows C symbol mangling, but GCC does not.
A user emailed me directly to report that they were getting linker errors, but I have not been able to observe any problems caused by this mismatch.
The text was updated successfully, but these errors were encountered: