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

Bad unwind tables on Solaris-11/x86-64 w/ "-m64" #76

Open
PHHargrove opened this issue Mar 9, 2015 · 1 comment
Open

Bad unwind tables on Solaris-11/x86-64 w/ "-m64" #76

PHHargrove opened this issue Mar 9, 2015 · 1 comment

Comments

@PHHargrove
Copy link
Collaborator

With clang-upc as it exists in the repo currently, I have no problems with clang and the default ILP32 ABI on Solaris-11 for x86-64, except the already reported issue with stdarg.h.

With -m64, however, the system linker is unable to deal with the unwind tables that clang is generating:

{phargrov@pcp-j-20 ~}$ clang -m64 hello.c -fasynchronous-unwind-tables
ld: fatal: unwind table: file /tmp/hello-f265e5.o: section .eh_frame: bad cie version 0: offset 0x4

clang: error: linker command failed with exit code 1 (use -v to see invocation)

On a per-compilation basis I can work-around with -fno-asynchronous-unwind-tables.
However, I am currently building on Solaris-11/x86-64 with the following patch instead, which may or may not be "overkill".

diff --git a/lib/Driver/ToolChains.h b/lib/Driver/ToolChains.h
index b5df866..971414f 100644
--- a/lib/Driver/ToolChains.h
+++ b/lib/Driver/ToolChains.h
@@ -526,6 +526,7 @@ protected:
   Tool *buildAssembler() const override;
   Tool *buildLinker() const override;

+  bool IsUnwindTablesDefault() const override { return false; }
 };


@PHHargrove PHHargrove changed the title Bad unwind tables on Solaris-11/x86-64 w/ "-m32" Bad unwind tables on Solaris-11/x86-64 w/ "-m64" Mar 9, 2015
@PHHargrove
Copy link
Collaborator Author

Sorry, I committed the issue before I had proof-read it (and got the title wrong as a result).

I should have mentioned for clarity that -fasynchronous-unwind-tables in the example is required to reproduce the error message with the patched build. Prior to the one-line patch the error message would appear when invoking clang with just -m64 and a filename.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant