Jump to content

MINGW64 : undefined symbol in libsystemc.a


JIBI3731

Recommended Posts

Dear fellows,

I just downloaded systemc2.3.3  and when i generate the test  exe (using make check) i get  an error  at link :

undefined symbol in libsystemc.a(sc_simcontext.o):sc_simcontext.cpp:(.text+0x6704): undefined reference to `sc_core::sc_cor_pkg_qt::sc_cor_pkg_qt

 

i had no problem to build  the libs (libsystemc.a , libsysc.a, libtlm_core.a and libtlm_utils.a) but apparetnly the libsystemc.a  contains unresolved reference ? 

i use  MSYS2 with mingw64  and before building, i set the CXXFLAGS  variable : 

CXXFLAGS='-O3 -g -Wall -Wextra -Winvalid-pch -Wno-unused-parameter --std=gnu++11'
 

Please help me , i'm stuck 😞

Thanks in advance

Best regards

JB

 

Link to comment
Share on other sites

Building SystemC using G++ from MSYS2/MinGW-64 should work as described in the INSTALL file. To diagnose your problem, it would help if you could provide all commands, which you used to configure and build SystemC 2.3.3 and then to run the tests. Please, also provide the log file generated by configure. Did you observe any errors/warnings during the compilation of the SystemC library? You should pass in the CXXFLAGS to your configure call as described in the INSTALL file, section "SystemC Library Configuration Switches":

../configure CXXFLAGS="-DSC_OVERRIDE_DEFAULT_STACK_SIZE=0x80000"

You can also try to build SystemC with the latest fixes released in its official public Git repository. You can also try to build SystemC from that repository using CMake as described in cmake/INSTALL_USING_CMAKE.

Link to comment
Share on other sites

Hi,

I made the following

./configure --target=mingw64  CXXFLAGS="-DSC_OVERRIDE_DEFAULT_STACK_SIZE=0x80000"

then : 

make : OK , no compilation error error 

and then : 

make check : i get the following

 

make[3] : on entre dans le répertoire « /d/BOULOT/tools/SYSTEMC/NEW2/systemc-2.3.3/examples/sysc »
  CXX      fft/fft_flpt/fft_fft_flpt_test-fft.o
  CXX      fft/fft_flpt/fft_fft_flpt_test-main.o
  CXX      fft/fft_flpt/fft_fft_flpt_test-sink.o
  CXX      fft/fft_flpt/fft_fft_flpt_test-source.o
  CXXLD    fft/fft_flpt/test.exe
../../src/.libs/libsystemc.a(sc_simcontext.o):sc_simcontext.cpp:(.text+0x6704): undefined reference to `sc_core::sc_cor_pkg_qt::sc_cor_pkg_qt(sc_core::sc_simcontext*)'
../../src/.libs/libsystemc.a(sc_simcontext.o):sc_simcontext.cpp:(.text+0x6704): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `sc_core::sc_cor_pkg_qt::sc_cor_pkg_qt(sc_core::sc_simcontext*)'
../../src/.libs/libsystemc.a(sc_simcontext.o):sc_simcontext.cpp:(.text+0x6713): undefined reference to `sc_core::sc_cor_pkg_qt::get_main()'
../../src/.libs/libsystemc.a(sc_simcontext.o):sc_simcontext.cpp:(.text+0x6713): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `sc_core::sc_cor_pkg_qt::get_main()'
collect2: error: ld returned 1 exit status
 

I also atatched the config.log 

Many thanks for the support 

JB

config.log

Link to comment
Share on other sites

Actually, it is expected that you don't have the QuickThreads package built on MinGW.  As you can see from your config.log, the threading package to use is

Quote

---------------------------------------------------------------------
Configuration summary of SystemC 2.3.3 for x86_64-pc-mingw64
---------------------------------------------------------------------

...

 Build settings:
   Enable compiler optimizations  : yes
   Include debugging symbols      : no
   Coroutine package for processes: WinFiber
   Enable VCD scopes by default   : yes
   Disable async_request_update   : no
   Phase callbacks (experimental) : no
--------------------------------------------------------------------

But it seems that the source code is missing an explicit check for _WIN64 to catch the MinGW-64 case. Can you try compiling with WIN64 defined (without leading underscore):

../configure CXXFLAGS="-DWIN64"

Hope that helps,
  Philipp

Link to comment
Share on other sites

Thanks Philipp

I tried :  ../configure CXXFLAGS="-DWIN64" --target=mingw64

but i get an error , early at compile  time : 

make[3] : on entre dans le répertoire « /d/BOULOT/tools/SYSTEMC/NEW2/systemc-2.3.3/objdir/src/sysc »
  CXX      kernel/sc_attribute.lo
  CXX      kernel/sc_cor_fiber.lo
../../../src/sysc/kernel/sc_cor_fiber.cpp: In destructor 'virtual sc_core::sc_cor_fiber::~sc_cor_fiber()':
../../../src/sysc/kernel/sc_cor_fiber.cpp:72:7: error: 'PVOID' was not declared in this scope
       PVOID cur_fiber = GetCurrentFiber();
       ^~~~~
../../../src/sysc/kernel/sc_cor_fiber.cpp:73:22: error: 'cur_fiber' was not declared in this scope
       if( m_fiber != cur_fiber && this != m_pkg->get_main() )

and then other errors in cascade .....

 

The missing PVOID is a declaration i think in <windows.h> ?????? 

I keep searching ....

Regards

JB

config.log

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...