Opened 10 years ago

Closed 10 years ago

#2989 closed defect (fixed)

Bootstrapped compiler - build shared libOpenModelicaCompiler.dll also on Windows

Reported by: Adrian Pop Owned by: Adrian Pop
Priority: high Milestone: 1.9.2
Component: Installation program Version: trunk
Keywords: Cc:

Description (last modified by Adrian Pop)

There are some issues when building the shared compiler on Windows.
Currently if you comment out STATIC=static inside Compiler/boot/Makefile.omdev.mingw you get undefined references to omc_assert and omc_throw.

Where are these defined?

Change History (5)

comment:1 by Adrian Pop, 10 years ago

Description: modified (diff)
Owner: changed from Adeel Asghar to Adrian Pop
Status: newaccepted

comment:2 by Adeel Asghar, 10 years ago

I think they are defined in libOpenModelicaRuntime.a but you need to use -WI,--whole-archive to export all symbols.

comment:3 by Adrian Pop, 10 years ago

No. They are defined via script Compiler/boot/GenerateEntryPoint.mos which calls API: generateEntryPoint which builds _main.c.
I'll try to split that file into _main_shared.c containing the needed omc_assert and other definitions which is compiled together with the dll.

comment:4 by Adeel Asghar, 10 years ago

OK. omc_assert_function & omc_assert_warning_function and defined in SimulationRuntime/c/util/omc_error.c. I thought omc_assert is also defined there.

comment:5 by Adrian Pop, 10 years ago

Resolution: fixed
Status: acceptedclosed

Fixed in r23420.
Note that I don't know how the dll is used from OMEdit and it might not work if is not used in a certain way.
Extreme care is needed especially with globals that are populated by phtread_get_specific.

Note: See TracTickets for help on using tickets.