P
Peter Riocreux
Guest
I am trying to develop some PLI code that is portable across platforms
and can be built semi-automagically. Thus I am using libtool to do
this.
I am linking together 7 libtool-generated libraries, another
that is causing problems and an automagically generated C file.
My problem is that the resultant .so file works happily with verilog
XL and NCverilog, but VCS barfs on it during its link phase. (This is
on a Solaris 8 or 9 platform with VCS version 6.0.1)
The messages VCS gives are:
Undefined first referenced
symbol in file
BalsaSimBuiltinFunction_check /tmp/v101905NrIB_d.o
(symbol belongs to implicit dependency /tmp/balsa-3.4/lib/libbalsasimverilog.so.0)
tf_setworkarea /tmp/balsa-3.4/lib/libbalsasimverilog.so.0
tf_getworkarea /tmp/balsa-3.4/lib/libbalsasimverilog.so.0
BalsaSimBuiltinFunction_call /tmp/v101905NrIB_d.o
(symbol belongs to implicit dependency /tmp/balsa-3.4/lib/libbalsasimverilog.so.0)
tf_message /tmp/balsa-3.4/lib/libbalsasimverilog.so.0
tf_nump /tmp/balsa-3.4/lib/libbalsasimverilog.so.0
ld: fatal: Symbol referencing errors. No output written to simv
At first glance this looks like the problem file
(libbalsasimverilog.so.0) has not been linked in properly, but that is
the only file that uses the tf_* routines, so it is discovering it
needs them. So it *is* linking in that file and it appears to be
linking that file to the others as functions provided by the 7 other
libs appear to be resolved as far as the problem one goes. In fact it
seems that the *only* symbols remaining unresolved are things that
cross the problem library/vcs boundary. But it is not all of them, as
the _check and _call functions also use acc_* functions.
$nm -g /tmp/balsa-3.4/lib/libbalsasimverilog.so.0 gives, amongst other
stuff:
[79] | 4200| 912|FUNC |GLOB |0 |8 |BalsaSimBuiltinFunction_call
[54] | 2420| 1708|FUNC |GLOB |0 |8 |BalsaSimBuiltinFunction_check
So the symbols are there and have some code behind them.
To confuse matters further, if I specify the problem library also on
the command line, the link stage works fine, whether or not I include
the problem library in my big, combined one.
The problem library itself is built using an automake libtool rule, as
are three of the non-problem libraries, so I have some difficulty
believing it is anything special about the problem library itself. The
final, all linked together thing is built using a script that invokes
libtool in the various modes.
The relevant lines from what libtool does in the final stage are:
gcc -c -I/home/amulocal/solaris/include -I/home/amulocal/common/include foo.c -fPIC -DPIC -o foo.lo
ld -G -h foo.so.0 -o foo.so.0.0.0 foo.lo -R/tmp/balsa-3.4/lib .......[deleted bunch of libs]
foo.c is the test, automagically generated file.
Does anyone have any idea what the cause of my problem is?
I can generate enormous amounts of info if it will help anyone.
Peter
--
Peter Riocreux, Amulet Group, Dept. Computer Science, Manchester University,
Oxford Road, MANCHESTER, M13 9PL, UK. <http://www.cs.man.ac.uk/apt/>
and can be built semi-automagically. Thus I am using libtool to do
this.
I am linking together 7 libtool-generated libraries, another
that is causing problems and an automagically generated C file.
My problem is that the resultant .so file works happily with verilog
XL and NCverilog, but VCS barfs on it during its link phase. (This is
on a Solaris 8 or 9 platform with VCS version 6.0.1)
The messages VCS gives are:
Undefined first referenced
symbol in file
BalsaSimBuiltinFunction_check /tmp/v101905NrIB_d.o
(symbol belongs to implicit dependency /tmp/balsa-3.4/lib/libbalsasimverilog.so.0)
tf_setworkarea /tmp/balsa-3.4/lib/libbalsasimverilog.so.0
tf_getworkarea /tmp/balsa-3.4/lib/libbalsasimverilog.so.0
BalsaSimBuiltinFunction_call /tmp/v101905NrIB_d.o
(symbol belongs to implicit dependency /tmp/balsa-3.4/lib/libbalsasimverilog.so.0)
tf_message /tmp/balsa-3.4/lib/libbalsasimverilog.so.0
tf_nump /tmp/balsa-3.4/lib/libbalsasimverilog.so.0
ld: fatal: Symbol referencing errors. No output written to simv
At first glance this looks like the problem file
(libbalsasimverilog.so.0) has not been linked in properly, but that is
the only file that uses the tf_* routines, so it is discovering it
needs them. So it *is* linking in that file and it appears to be
linking that file to the others as functions provided by the 7 other
libs appear to be resolved as far as the problem one goes. In fact it
seems that the *only* symbols remaining unresolved are things that
cross the problem library/vcs boundary. But it is not all of them, as
the _check and _call functions also use acc_* functions.
$nm -g /tmp/balsa-3.4/lib/libbalsasimverilog.so.0 gives, amongst other
stuff:
[79] | 4200| 912|FUNC |GLOB |0 |8 |BalsaSimBuiltinFunction_call
[54] | 2420| 1708|FUNC |GLOB |0 |8 |BalsaSimBuiltinFunction_check
So the symbols are there and have some code behind them.
To confuse matters further, if I specify the problem library also on
the command line, the link stage works fine, whether or not I include
the problem library in my big, combined one.
The problem library itself is built using an automake libtool rule, as
are three of the non-problem libraries, so I have some difficulty
believing it is anything special about the problem library itself. The
final, all linked together thing is built using a script that invokes
libtool in the various modes.
The relevant lines from what libtool does in the final stage are:
gcc -c -I/home/amulocal/solaris/include -I/home/amulocal/common/include foo.c -fPIC -DPIC -o foo.lo
ld -G -h foo.so.0 -o foo.so.0.0.0 foo.lo -R/tmp/balsa-3.4/lib .......[deleted bunch of libs]
foo.c is the test, automagically generated file.
Does anyone have any idea what the cause of my problem is?
I can generate enormous amounts of info if it will help anyone.
Peter
--
Peter Riocreux, Amulet Group, Dept. Computer Science, Manchester University,
Oxford Road, MANCHESTER, M13 9PL, UK. <http://www.cs.man.ac.uk/apt/>