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

'Unsupported relocation kind 0003' when trying to build zmq-windows with a static MXE #23

Closed
hcarty opened this issue Jan 24, 2017 · 6 comments

Comments

@hcarty
Copy link
Collaborator

hcarty commented Jan 24, 2017

I'm working on a zeromq package/installation for MXE. It works fine with opam-cross-windows when building against a dynamically linked MXE but not statically (MXE_TARGETS:=x86_64-w64-mingw32.static)

Do you have any suggestions on where to start looking? Based on ocaml/flexdll#29 hinting that SEH could be an issue I tried a fresh MXE build with gcc.mk patched to include --enable-sjlj-exceptions but I get the same error aside from a change in the problematic gcc symbol name from __gxx_personality_seh0 to __gxx_personality_sj0

The error when building zmq-windows with OCaml 4.04.0 from opam-cross-windows:

/home/hcarty/.opam/4.04.0/bin/ocamlfind ocamlmklib -o src/ZMQ_stubs -lzmq src/caml_zmq_stubs.o src/socket.o src/context.o src/fail.o src/poll.o
+ /home/hcarty/.opam/4.04.0/bin/ocamlfind ocamlmklib -o src/ZMQ_stubs -lzmq src/caml_zmq_stubs.o src/socket.o src/context.o src/fail.o src/poll.o
** Fatal error: Unsupported relocation kind 0003 for __gxx_personality_seh0 in /home/hcarty/mxe/usr/x86_64-w64-mingw32.static/lib/libzmq.a(src_libzmq_la-clock.o/

followed by the rest of the .o files in the libzmq.a archive.

@whitequark
Copy link
Member

Not really any suggestions. Perhaps use a 32-bit build if you can. I can probably fix flexdll but not quickly and this is not a priority for me. I'd be willing to do this as a contractual item at my usual rate but I'm not sure if this will fit your goals.

@whitequark
Copy link
Member

(The above assumes zeromq actually uses exceptions; if not just rebuild with -fno-exceptions, but that seems unlikely to work.)

@hcarty
Copy link
Collaborator Author

hcarty commented Jan 24, 2017

Finally got back to this and to my delight -fno-exceptions did the trick. Now there are linking issues with libzmq.a but that doesn't seem to be OCaml-related.

Thank you for the pointer!

@hcarty hcarty closed this as completed Jan 24, 2017
@whitequark whitequark reopened this Jan 24, 2017
@whitequark
Copy link
Member

No, this absolutely doesn't mean the issue is solved. Now, assuming zeromq actually does use exceptions, it will simply crash the entire process instead.

@whitequark
Copy link
Member

I went through the ZeroMQ source and it doesn't use exceptions as far as I can see, so the fix is fine.

@hcarty
Copy link
Collaborator Author

hcarty commented Jan 25, 2017

@whitequark Apologies - I should have been clearer. I also did a search through zeromq's source for anything referencing exceptions before trying the compilation option.

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

No branches or pull requests

2 participants