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

undefined reference to `__gxx_personality_v0' on Windows Vista 32bit with GCC 4.8.1 #7953

Closed
thadguidry opened this issue Jul 22, 2013 · 11 comments

Comments

@thadguidry
Copy link
Contributor

When trying to compile Rust on Windows Vista 32bit with toolchain set to:

export PATH="/c/mingw-builds/x32-4.8.1-release-win32-sjlj-rev2/mingw32/bin:/usr/local:$PATH"

I get the following error output:

$ make
cfg: build triple i686-pc-mingw32
cfg: host triples i686-pc-mingw32
cfg: target triples i686-pc-mingw32
cfg: host for i686-pc-mingw32 is i386
cfg: os for i686-pc-mingw32 is pc-mingw32
cfg: using gcc
cfg: disabling valgrind due to its unreliability on this platform
/home/Thad/rust/mk/stage0.mk:7: warning: overriding commands for target `i686-pc
-mingw32/stage0/bin/'
/home/Thad/rust/mk/stage0.mk:4: warning: ignoring old commands for target `i686-
pc-mingw32/stage0/bin/'
cfg: no pandoc found, omitting docs
cfg: no node found, omitting docs
cfg: no llnextgen found, omitting grammar-verification
cfg: no pandoc found, omitting library doc build
link: rt/i686-pc-mingw32/stage0/rustrt.dll
rt/rustrt.mingw32.def:2: Warning: path components stripped from LIBRARY, 'rt/rus
trt'
rt/i686-pc-mingw32/stage0/rust_upcall.o: In function `upcall_s_rust_personality'
:
C:/MinGW/msys/1.0/home/Thad/rust/src/rt/rust_upcall.cpp:279: undefined reference
 to `__gxx_personality_v0'
collect2.exe: error: ld returned 1 exit status
make: *** [rt/i686-pc-mingw32/stage0/rustrt.dll] Error 1
@luqmana
Copy link
Member

luqmana commented Jul 22, 2013

That would be because the gcc you're using seems to only support sjlj method for stack frame unwinding whereas the rust runtime seems to want DWARF exceptions.

@brson
Copy link
Contributor

brson commented Jul 22, 2013

That's right. But we're not using unwinding at all on windows, so this could be fixed with some #ifdefs and makefile options.

@thadguidry
Copy link
Contributor Author

What are the plans to use on Windows, then for the idea of stack unwinding ?

@thestinger
Copy link
Contributor

Proper exception handling on Windows still needs to be implemented in LLVM.

http://llvm.org/bugs/show_bug.cgi?id=11285

It looks like they might have gone with a half working hack for now resulting in 64-bit support on Windows being dropped.

@brson
Copy link
Contributor

brson commented Jul 22, 2013

#908 is the windows unwinding issue. We intend to implement unwinding with a special windows-only abi that passes an 'unwind' flag (referred to as 'return-based unwinding').

@brson
Copy link
Contributor

brson commented Jul 22, 2013

@graydon has a patch for return-unwind somewhere if somebody wants to pick it up.

@thadguidry
Copy link
Contributor Author

Some LLVM patches exist for simple Windows 64 Exception Handling support in LLVM. See LLVMdev message http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-April/060838.html

@thadguidry
Copy link
Contributor Author

@graydon @brson @thestinger @luqmana I found some additional info from Andrew Kaylor @ Intel that says he recently committed MCJIT to LLVM 3.4 and it can be used for Exception Handling support (and works on Windows, but however generates ELF object images). I'm wondering if this might be useful for us ? Here's the LLVMdev thread where Andrew makes mention of it https://groups.google.com/d/msg/llvm-dev/JvrxgC_OjM8/UMpDzMCQMGkJ

@thestinger
Copy link
Contributor

It's not really relevant to this, it works on Windows but doesn't have any more exception handling support than the ahead-of-time compiler does.

@klutzy
Copy link
Contributor

klutzy commented Aug 27, 2013

I think "undefined reference" issue is fixed by #8488, specifically by 63e53b8. @thadguidry, could you check this?

@thadguidry
Copy link
Contributor Author

@klutzy Yeap, it's fix now.

This was referenced Sep 4, 2013
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

5 participants