[LLVMdev] Question about compile Systemc code

Rui Chen chenrui333 at gmail.com
Sat Jul 30 19:47:11 PDT 2011


Dear all,

I am quite new to llvm, after installing both llvm and systemc
library, I checked with the command to compile the "hello world"
systemc code, it works:
g++ -I $SYSTEMC/include -L $SYSTEMC/lib-linux -o example.o example.cpp
-lsystemc -lm
./example.o

But when I replace g++ with llvm-g++, some error comes out:

/home/chenrui/Desktop/llvm/systemc-2.2.0/lib-linux/libsystemc.a(sc_main_main.o):
In function `sc_core::message_function(char const*)':
sc_main_main.cpp:(.text+0x8c): undefined reference to
`std::ctype<char>::_M_widen_init() const'
/home/chenrui/Desktop/llvm/systemc-2.2.0/lib-linux/libsystemc.a(sc_simcontext.o):
In function `sc_core::sc_process_table::~sc_process_table()':
sc_simcontext.cpp:(.text+0x184): undefined reference to
`std::ctype<char>::_M_widen_init() const'
sc_simcontext.cpp:(.text+0x1a4): undefined reference to
`std::ctype<char>::_M_widen_init() const'
/home/chenrui/Desktop/llvm/systemc-2.2.0/lib-linux/libsystemc.a(sc_simcontext.o):
In function `sc_core::pln()':
sc_simcontext.cpp:(.text+0x44c): undefined reference to
`std::ctype<char>::_M_widen_init() const'
sc_simcontext.cpp:(.text+0x46c): undefined reference to
`std::ctype<char>::_M_widen_init() const'
/home/chenrui/Desktop/llvm/systemc-2.2.0/lib-linux/libsystemc.a(sc_simcontext.o):sc_simcontext.cpp:(.text+0x48c):
more undefined references to `std::ctype<char>::_M_widen_init() const'
follow
collect2: ld returned 1 exit status

I wonder if someone can give me some hints on it. What I want to do is
compile the systemc to IR and then write a VHDL backend for it.

Thanks very much.

Best regards,

Rui



More information about the llvm-dev mailing list