Git Product home page Git Product logo

Comments (5)

F-Loyer avatar F-Loyer commented on June 14, 2024

I have found the objdump -tT which find many symbols including the needed pg_query_parse, but none exported in the dynamic table.

from flexdll.

dra27 avatar dra27 commented on June 14, 2024

Lack of time I'm afraid means that FlexDLL issues can be very long-burning - please do try to include full reproductions with issues (i.e. concrete links to branches and instructions to build them) so that when we do get spare minutes to have a look, they're not all spent just trying to reproduce the issue!

This is possibly a shot in the dark, but this is ringing a bell with symbols not being properly available because they're not being referenced - @jonahbeckford, does this look like a familiar type of failure?

from flexdll.

dra27 avatar dra27 commented on June 14, 2024

Ah - ocaml/ocaml#12412 was what I was thinking of, but that's MSVC and I don't think should be applying here (assuming you're using mingw-w64).

from flexdll.

jonahbeckford avatar jonahbeckford commented on June 14, 2024

As David asked, are you compiling with MSVC or GCC?

Either way, pasting in the first 10 lines of ocamlobjinfo pg_check.cmxa may help. (Or .cma if you created a bytecode executable)

from flexdll.

F-Loyer avatar F-Loyer commented on June 14, 2024

I am trying with Cygwin/MinGW. (On MSVC, even a simple (run %{make} build) is troublesome: not found) Instead of the whole pg_query, I propose this tiny project which spots the actual issue.

https://github.com/F-Loyer/ctype_error

On Windows, there are 2 symbol tables the (normal) SYMBOL TABLE and the DYNAMIC SYMBOL TABLE. By default the linker put symbols only in the SYMBOL TABLE, the DYNAMIC SYMBOL TABLE remains empty. However, the ffi library searches symbols in this latest table. Then, this can't work.

See https://github.com/F-Loyer/ctype_error/blob/main/main_objdump.txt#L10406 The function my_function is present, but not in the right table and FFI can't see it.

I have managed to solve the issue with the executable link flags of dune (the commented line in the project), with:

(link_flags -cclib -Wl,-Wl,--export-all-symbols)

I guess the default configuration should work without this tweak. (Note, I had to double the -Wl... perhaps one is eaten by gcc, the other by FlexDll or something like this).

Note: the ffi-7.dll I use comes from a Gtk installation from sources. I don't know if there is an official version I should prefer. EDIT: Same issue with a ffi-8.dll from vcpkg.

(Since pg_check and my project are executable - not libraries - no cmxa, but the issue is not there I think)

Note, the external __my_function__ : unit -> unit = "my_function" is to for the given function to be linked... the linker links all *.o, but select from an *.a what seems to be (statically) used.

from flexdll.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.