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 349589 - compilation fails
compilation fails
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Plugins
git master
Other All
: High major
: 2.4
Assigned To: Raphaël Quinet
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2006-08-01 21:04 UTC by Alexandre Prokoudine
Modified: 2006-08-04 22:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
do not declare a symbol called link - apply patch in plug-ins/imagemap/ (972 bytes, patch)
2006-08-04 13:03 UTC, Raphaël Quinet
none Details | Review

Description Alexandre Prokoudine 2006-08-01 21:04:25 UTC
Please describe the problem:
imap_ncsa_parse.o: In function `ncsa_error':/home/avp/soft/build/graphics/gimp/gimp-2006-08-01/plug-ins/imagemap/imap_ncsa.y:170: undefined reference to `ncsa_in'
:/home/avp/soft/build/graphics/gimp/gimp-2006-08-01/plug-ins/imagemap/imap_ncsa.y:170: undefined reference to `ncsa_restart'
imap_ncsa_parse.o: In function `ncsa_parse':/usr/share/bison/bison.simple:573: undefined reference to `ncsa_lex'
imap_ncsa_parse.o: In function `load_ncsa':/home/avp/soft/build/graphics/gimp/gimp-2006-08-01/plug-ins/imagemap/imap_ncsa.y:178: undefined reference to `ncsa_in'
:/home/avp/soft/build/graphics/gimp/gimp-2006-08-01/plug-ins/imagemap/imap_ncsa.y:181: undefined reference to `ncsa_in'

I'm using flex_2.5.31, bison 2.1-0.2 and byacc 20050813-1 on Ubuntu Dapper.



Steps to reproduce:


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Raphaël Quinet 2006-08-02 11:10:45 UTC
I don't know what could be wrong.  I have flex 2.5.33 and bison 2.3 on Debian testing and it works fine for me.  It looks like a parsing error occured, because the first error in your trace looks like it could not parse "FILE *" (from stdio) and the second one looks like it could not find the function prototype that is declared at the top of the file.  It may be a problem with your bison installation, although I am not sure.
Comment 2 Alexandre Prokoudine 2006-08-04 06:43:50 UTC
Raphaël, the thing is that GIMP 2.3.10 compiles in the same system just fine. So something went wrong after this release.
Comment 3 Michael Natterer 2006-08-04 10:38:34 UTC
I don't see anything that has changed in the files in question. Maybe
you did an ubuntu update in the meantime? Does the 2.3.10 tarball
still compile or did you compile it before?
Comment 4 Alexandre Prokoudine 2006-08-04 10:53:12 UTC
Michael, I compiled 2.3.10 this morning right before posting Comment #2.
Comment 5 Michael Natterer 2006-08-04 11:42:00 UTC
Well there is definitely something fishy here. I touched the *.l and
*.y files in plug-ins/imagemap/ to force the regeneration of the
C sources. The result is the following:

flex  -Pncsa_ -i -t imap_ncsa.l > imap_ncsa_lex.c
bison -y  -d -p ncsa_ imap_ncsa.y
conflicts: 1 shift/reduce
mv -f y.tab.h imap_ncsa_parse.h
if gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I/local/head/include/gtk-2.0 -I/local/head/lib/gtk-2.0/include -I/local/head/include/atk-1.0 -I/local/head/include/cairo -I/local/head/include/pango-1.0 -I/local/head/include/glib-2.0 -I/local/head/lib/glib-2.0/include   -I/local/head/include  -I/local/head/include -DGIMP_DISABLE_DEPRECATED -DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DPANGO_DISABLE_DEPRECATED -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE  -g -O2 -Wall -MT imap_ncsa_lex.o -MD -MP -MF ".deps/imap_ncsa_lex.Tpo" -c -o imap_ncsa_lex.o imap_ncsa_lex.c; \
        then mv -f ".deps/imap_ncsa_lex.Tpo" ".deps/imap_ncsa_lex.Po"; else rm -f ".deps/imap_ncsa_lex.Tpo"; exit 1; fi
In file included from <stdout>:553:
/usr/include/unistd.h:728: error: expected identifier or ‘(’ before numeric constant
make[1]: *** [imap_ncsa_lex.o] Error 1
make[1]: Leaving directory `/local/head/src/gnome/gimp/plug-ins/imagemap'
make: *** [all-recursive] Error 1


That can't be right ;) Setting milestone to 2.4 and raising priority.
Comment 6 Michael Natterer 2006-08-04 11:48:10 UTC
Maurits, can you look at this please?
Comment 7 Raphaël Quinet 2006-08-04 13:03:38 UTC
Created attachment 70198 [details] [review]
do not declare a symbol called link - apply patch in plug-ins/imagemap/

The problem seems to be caused by the imap_ncsa.l declaring a symbol called "link".
This is a bad idea because this #define conflicts with the prototype of the system call link(), which is declared in <unistd.h>.  It looks like recent versions of flex (2.5.x, with x > 5?) are now including <unistd.h> before the symbol declarations and this causes the build to fail.  The attached patch attempts to replace the "link" symbol by "imap_link" and should hopefully solve this problem.

Alexandre, please test this patch and tell me if you can now build the plug-in successfully.
Comment 8 Raphaël Quinet 2006-08-04 13:11:56 UTC
Sorry, wrong explanation: recent versions of flex are now including <unistd.h> after (not before) the symbol declarations.  Anyway, please report if this patch solves the problem or not.
Comment 9 Alexandre Prokoudine 2006-08-04 21:53:46 UTC
Raphaël, your patch solves the issue. Thanx a lot :)
Comment 10 Raphaël Quinet 2006-08-04 22:13:13 UTC
2006-08-05  Raphaël Quinet  <raphael@gimp.org>

	* plug-ins/imagemap/imap_ncsa.l: Do not declare a symbol "link"
	because this conflicts with the system call declared in
	<unistd.h>.  Renamed that symbol "imap_link".  Fixes bug #349589.

	* plug-ins/imagemap/imap_ncsa_lex.c: Updated by hand in order to
	avoid large changes introduced by more recent versions of flex.