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

Flexdll's dll produced from several object files fails to load #5613

Closed
vicuna opened this issue May 12, 2012 · 5 comments
Closed

Flexdll's dll produced from several object files fails to load #5613

vicuna opened this issue May 12, 2012 · 5 comments

Comments

@vicuna
Copy link

vicuna commented May 12, 2012

Original bug ID: 5613
Reporter: joedralliam
Assigned to: @alainfrisch
Status: assigned (set by @alainfrisch on 2012-05-15T12:22:27Z)
Resolution: open
Priority: normal
Severity: minor
Platform: Visual C++
OS: Windows
OS Version: Windows 7
Version: 3.12.1
Target version: later
Category: platform support (windows, cross-compilation, etc)

Bug description

Launching a byte-code executable which uses primitives defined in the dll (mixed C/C++) fails with following output:
No master relocation table
Fatal error: unknown C primitive `foo__impl'

Removing '/Ox' compilation option fix the 'bug'.
Replacing the object constructors/destructor behaviour (calling caml_release_runtime_system and caml_acquire_runtime_system) by explicit calls fix also the 'bug'.

Is this behaviour expected ?

Steps to reproduce

cl /MD /Ox /EHs /DCAML_NAME_SPACE /IC:/ocamlms/lib /c foo.cpp
cl /MD /Ox /EHs /DCAML_NAME_SPACE /IC:/ocamlms/lib /c bar.cpp

flexlink -chain msvc64 -merge-manifest foo.obj bar.obj -o dlltest.dll
cp dlltest.dll $(shell ocamlc -where)/lib/stublibs/dlltest.dll

ocamlc -c test.ml -o test.cmo
ocamlc -a test.cmo -o test.cma -dllib -ltest
ocamlc test.cma test_prog.ml -o test_prog.exe

File attachments

@vicuna
Copy link
Author

vicuna commented May 12, 2012

Comment author: joedralliam

I'm sorry, I uploaded the wrong archive ("test.tar.gz", the correct one is "test_corrected.tar.gz"). But I can't delete it ??

@vicuna
Copy link
Author

vicuna commented May 13, 2015

Comment author: @damiendoligez

Is flexdll even supposed to work with C++ code?

@vicuna
Copy link
Author

vicuna commented May 15, 2015

Comment author: @alainfrisch

There has been some effort to have flexdll support C++ code, but no guarantee is provided. I'll happily integrate patches that fix the mentionned problem, but won't be able to investigate myself.

Anyway, this is an old problem, which would most likely be addressed in flexdll, not OCaml, so there is no reason to delay the release of OCaml for this one.

@github-actions
Copy link

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

@github-actions github-actions bot added the Stale label May 15, 2020
@xavierleroy
Copy link
Contributor

Looks like a FlexDLL issue.

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

No branches or pull requests

3 participants