GNOME Bugzilla – Bug 153726
[PATCH] Fix build with -fno-common
Last modified: 2004-12-22 21:47:04 UTC
Building gcalctool 5.5.5 fails when using the -fno-common option for gcc (3.3.4) because of multiple definitions of objects (not permitted according to a strict interpretation of the C standard). This also breaks compilation with some optimization switches (-fdata-sections, similar to bug 136872). The exact error message is as follows: gcc -fno-common -Wall -o gcalctool calctool.o display.o dsfuns.o get.o functions.o graphics.o mp.o mpmath.o parser.o gtk.o ce_parser.o lr_parser.o syntax_translation.o -Wl,--export-dynamic -Wl,--export-dynamic -pthread -Wl,--export-dynamic -pthread -L/opt/garnome/lib -L/usr/X11R6/lib /opt/garnome/lib/libgnomeui-2.so /opt/garnome/lib/libgnome-keyring.so /usr/lib/libjpeg.so /opt/garnome/lib/libbonoboui-2.so -lSM -lICE -lX11 /opt/garnome/lib/libgnomecanvas-2.so /opt/garnome/lib/libgnome-2.so /opt/garnome/lib/libesd.so /opt/garnome/lib/libaudiofile.so /opt/garnome/lib/libart_lgpl_2.so /opt/garnome/lib/libpangoft2-1.0.so /opt/garnome/lib/libgtk-x11-2.0.so /opt/garnome/lib/libgdk-x11-2.0.so /opt/garnome/lib/libatk-1.0.so /opt/garnome/lib/libgdk_pixbuf-2.0.so /opt/garnome/lib/libpangoxft-1.0.so /opt/garnome/lib/libpangox-1.0.so /opt/garnome/lib/libpango-1.0.so /opt/garnome/lib/libgnomevfs-2.so /opt/garnome/lib/libbonobo-2.so /opt/garnome/lib/libxml2.so -lz -lssl -lcrypto /opt/garnome/lib/libhowl.so -lresolv -lrt /opt/garnome/lib/libbonobo-activation.so /opt/garnome/lib/libORBitCosNaming-2.so /opt/garnome/lib/libgconf-2.so /opt/garnome/lib/libORBit-2.so /usr/lib/libpopt.so /opt/garnome/lib/libgobject-2.0.so -lm /opt/garnome/lib/libgmodule-2.0.so -ldl /opt/garnome/lib/libgthread-2.0.so -lpthread /opt/garnome/lib/libglib-2.0.so libparser.a -Wl,--rpath -Wl,/opt/garnome/lib -Wl,--rpath -Wl,/opt/garnome/lib libparser.a(ce_parser.tab.o)(.bss+0x0): multiple definition of `parser_state' parser.o(.bss+0x0): first defined here collect2: ld returned 1 exit status make[2]: *** [gcalctool] Error 1 make[2]: Leaving directory `/tmp/gcalctool-5.5.5/gcalctool' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/tmp/gcalctool-5.5.5' make: *** [all] Error 2 It looks like there is an `extern' specifier missing in the declaration of `parser_state' in `gcalctool/ce_parser.y'.
Created attachment 31934 [details] [review] Add an extern specifier to the declaration of `parser_state' in `gcalctool/ce_parser.y'
Fix checked into CVS. I've bumped the version number in configure.in to 5.5.6, but haven't created a new tarbal yet (want to fix a few more things first). Thanks!