After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 573858 - link fail on Solaris for plugin symbol-db
link fail on Solaris for plugin symbol-db
Status: RESOLVED FIXED
Product: anjuta
Classification: Applications
Component: plugins: symbol-db
SVN TRUNK
Other opensolaris
: Normal normal
: ---
Assigned To: Massimo Cora'
Anjuta maintainers
Depends on:
Blocks:
 
 
Reported: 2009-03-03 04:13 UTC by Halton Huo
Modified: 2009-03-05 01:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch for bug #573858, remove inline (1.77 KB, patch)
2009-03-03 04:20 UTC, Halton Huo
rejected Details | Review

Description Halton Huo 2009-03-03 04:13:29 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
Comment 1 Halton Huo 2009-03-03 04:20:07 UTC
Created attachment 129916 [details] [review]
patch for  bug #573858, remove inline

removing keyword inline will fix this bug. Please review it.
Comment 2 Johannes Schmid 2009-03-03 08:19:57 UTC
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.
Comment 3 Halton Huo 2009-03-03 09:20:06 UTC
(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.

Comment 4 Halton Huo 2009-03-03 09:49:21 UTC
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.
Comment 5 Halton Huo 2009-03-03 09:50:44 UTC
$cat myfunc.c 
inline int myfunc ()
{ return 0; }

int nouse ()
{
        return myfunc();
}
Comment 6 Massimo Cora' 2009-03-03 20:07:50 UTC
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?

Comment 7 Halton Huo 2009-03-04 02:32:04 UTC
(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.
Comment 8 Massimo Cora' 2009-03-04 22:44:47 UTC
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
Comment 9 Halton Huo 2009-03-05 01:57:35 UTC
build pass on r4830, I think this bug is resolved. thanks a lot