GNOME Bugzilla – Bug 573858
link fail on Solaris for plugin symbol-db
Last modified: 2009-03-05 01:57:53 UTC
I'm building anjuta trunk r4824 under Solaris with suncc, but get following error while linking under plugin/symbol-db /opt/SUNWspro/bin/cc -g -pg -g -o .libs/benchmark benchmark.o readtags.o symbol-db-engine-core.o symbol-db-engine-queries.o symbol-db-engine-iterator.o symbol-db-engine-utils.o symbol-db-engine-iterator-node.o symbol-db-view.o ../../../libanjuta/.libs/libanjuta.so -L/usr/X11/lib -L/lib -lgnomeui-2 -lSM -lICE -lbonoboui-2 -lgnomevfs-2 -lgnomecanvas-2 -lgnome-2 -lpopt -lbonobo-2 -lbonobo-activation -lORBit-2 -lart_lgpl_2 -lgconf-2 -lglade-2.0 -lunique-1.0 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lm -lmlib -lpangocairo-1.0 -lgio-2.0 -lXext -lXrender -lXi -lXcursor -lXcomposite -lXdamage -lXfixes -lcairo -lX11 -lpango-1.0 -lfreetype -lfontconfig -lgmodule-2.0 -lgda-4.0 -lgobject-2.0 -lgthread-2.0 -lpthread -lthread -lxml2 -lglib-2.0 -lsocket -R/export/home/halton/work/dist/lib Undefined first referenced symbol in file sdb_engine_get_query_parameters_list symbol-db-engine-core.o sdb_engine_insert_dyn_query_node_by_id symbol-db-engine-queries.o sdb_engine_get_dyn_query_node_by_id symbol-db-engine-queries.o sdb_engine_get_statement_by_query_id symbol-db-engine-core.o sdb_engine_get_tuple_id_by_unique_name symbol-db-engine-core.o
Created attachment 129916 [details] [review] patch for bug #573858, remove inline removing keyword inline will fix this bug. Please review it.
How can we use the inline keyword correctly with suncc? I guess the compiler will likely do the inline optiomation itself but it would good to be able to give that hint anyway.
(In reply to comment #2) > How can we use the inline keyword correctly with suncc? I guess the compiler > will likely do the inline optiomation itself but it would good to be able to > give that hint anyway. I wrote a test case for extern and inline. I have a test case on extern and inline. $cat myfunc.c inline int myfunc () { return 0; } $cat main.c extern inline int myfunc (); int main () { myfunc (); return 0; } $cc -c -o myfunc.o myfunc.c $cc -c -o main.o main.c "main.c", line 6: warning: extern inline function "myfunc" not defined in translation unit $cc -o test-extern-inline main.o myfunc.o Undefined first referenced symbol in file myfunc main.o ld: fatal: symbol referencing errors. No output written to test-extern-inline gcc can compile without any error. If I remove 'inline' or adding 'extern' before inline in myfunc.c, suncc can compile. Not sure it is issue for code or sun cc. I've already ask to Sun compiler team this question, will keep you update.
Update myfunc.c to let myfunc as a GLOB func, this is more accurate with anjuta actual code. $cc -c -o myfunc-cc.o myfunc.c $nm myfunc-cc.o|grep myfunc myfunc-cc.o: [15] | 0| 0|NOTY |GLOB |0 |UNDEF |myfunc [1] | 0| 0|FILE |LOCL |0 |ABS |myfunc.c $ $ $gcc -c -o myfunc-gcc.o myfunc.c $nm myfunc-gcc.o|grep myfunc myfunc-gcc.o: [6] | 0| 13|FUNC |GLOB |0 |1 |myfunc [1] | 0| 0|FILE |LOCL |0 |ABS |myfunc.c gcc and cc differently deal with inline keyword. NOTE without extern or static keyword.
$cat myfunc.c inline int myfunc () { return 0; } int nouse () { return myfunc(); }
As I already wrote on bug #568254, removing the inline keyword is not the right thing to do. Were you able to compile symbol-db without problems on bug #568254?
(In reply to comment #6) > As I already wrote on bug #568254, removing the inline keyword is not the right > thing to do. > Were you able to compile symbol-db without problems on bug #568254? > Hi Massimo, I might miss your word "(you should revert your one)" in comment http://bugzilla.gnome.org/show_bug.cgi?id=568254#c3 for bug #568254. So I think that bug is not resolved, sorry for my mistake. I'm discussing the Sun compiler guys, they point me out the blog http://blogs.sun.com/dew/entry/c99_inline_function My understanding is gcc does different with C99 extern inline, so I think programmer is responsible write codes which are compatible with gcc and C99 standard. Please feel free to tell me if I misunderstand something.
I removed the "inline" keyword for compilers != gcc using #ifdef __GNUC__ #define GNUC_INLINE inline #else #define GNUC_INLINE #endif I left some 'static inline' which I suppose are ok. Can you please try with the last revision to see if everything compiles fine? thanks
build pass on r4830, I think this bug is resolved. thanks a lot