GNOME Bugzilla – Bug 136872
Build fails when compiling with the option -fdata-sections for gcc
Last modified: 2004-12-22 21:47:04 UTC
Distribution: Debian testing/unstable Package: gcalctool Severity: minor Version: GNOME2.5.91 unspecified Gnome-Distributor: GARNOME Synopsis: Build fails when compiling with the option -fdata-sections for gcc Bugzilla-Product: gcalctool Bugzilla-Component: general Bugzilla-Version: unspecified Description: gcalctool 4.3.48 does not build successfully on gcc 3.3.3 (Debian GNU/Linux testing/i686) when compiling with the option -fdata-sections. Using this option causes a linker error due to multiply defined symbols. Steps to reproduce the problem: 1. Run the configure script with the argument `CFLAGS=-fdata-sections'. 2. Run make. Actual Results: The compilation fails with the following output: gcc -fdata-sections -Wall -o gcalctool calctool.o display.o dsfuns.o get.o functions.o graphics.o mp.o gtk.o -Wl,--export-dynamic -pthread -Wl,--export-dynamic -pthread -Wl,--export-dynamic -L/opt/garnome/lib -L/usr/X11R6/lib -ldl -ldl -lm -lm -ldl -ldl -ldl /opt/garnome/lib/libgnomeui-2.so -lm -ldl /opt/garnome/lib/libgnome-keyring.so /usr/lib/libjpeg.so -lSM -lICE -lSM -lICE /opt/garnome/lib/libbonoboui-2.so /opt/garnome/lib/libXcursor.so /opt/garnome/lib/libXrender.so -lm -ldl -lSM -lICE -lm /opt/garnome/lib/libgnomecanvas-2.so -lm -ldl /opt/garnome/lib/libgnome-2.so -ldl /opt/garnome/lib/libesd.so /opt/garnome/lib/libaudiofile.so -lm /opt/garnome/lib/libart_lgpl_2.so -lm /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 -ldl /opt/garnome/lib/libgdk_pixbuf-2.0.so -ldl -lm /opt/garnome/lib/libpangoxft-1.0.so /opt/garnome/lib/libpangox-1.0.so /opt/garnome/lib/libpango-1.0.so -ldl -lm -ldl -lm -ldl /opt/garnome/lib/libgnomevfs-2.so /opt/garnome/lib/libbonobo-2.so /opt/garnome/lib/libxml2.so -lz -lm -lssl -lcrypto -ldl -lrt /opt/garnome/lib/libbonobo-activation.so /opt/garnome/lib/libORBitCosNaming-2.so -lm -ldl -ldl -lm -ldl -ldl /opt/garnome/lib/libgconf-2.so -lm -ldl /opt/garnome/lib/libORBit-2.so -ldl /usr/lib/libpopt.so /opt/garnome/lib/libgobject-2.0.so /opt/garnome/lib/libgthread-2.0.so -lpthread -lm /opt/garnome/lib/libgmodule-2.0.so -ldl -ldl /opt/garnome/lib/libglib-2.0.so -lSM -lICE -lX11 -Wl,--rpath -Wl,/opt/garnome/lib -Wl,--rpath -Wl,/opt/garnome/lib display.o(.bss.CalcVars+0x0): multiple definition of `CalcVars' calctool.o(.bss.CalcVars+0x0): first defined here get.o(.bss.CalcVars+0x0): multiple definition of `CalcVars' calctool.o(.bss.CalcVars+0x0): first defined here functions.o(.bss.CalcVars+0x0): multiple definition of `CalcVars' calctool.o(.bss.CalcVars+0x0): first defined here graphics.o(.bss.CalcVars+0x0): multiple definition of `CalcVars' calctool.o(.bss.CalcVars+0x0): first defined here mp.o(.bss.CalcVars+0x0): multiple definition of `CalcVars' calctool.o(.bss.CalcVars+0x0): first defined here gtk.o(.bss.CalcVars+0x0): multiple definition of `CalcVars' calctool.o(.bss.CalcVars+0x0): first defined here collect2: ld returned 1 exit status make[2]: *** [gcalctool] Error 1 make[2]: Leaving directory `/tmp/gcalctool-4.3.48/gcalctool' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/tmp/gcalctool-4.3.48' make: *** [all-recursive-am] Error 2 Additional Information: `CalcVars' is defined in the header file `gcalctool/calctool.h'. Changing this definition to an extern declaration and moving the actual definition out of the header allows the build to complete successfully after first running `make clean' in the `gcalctool' subdirectory. ------- Bug moved to this database by unknown@bugzilla.gnome.org 2004-03-11 05:29 ------- The original reporter (heikki.tauriainen@hut.fi) of this bug does not have an account here. Reassigning to the exporter, unknown@bugzilla.gnome.org. Reassigning to the default owner of the component, rich.burridge@sun.com.
Fair enough. I'll look at adjusting this in the GNOME 2.7/8 timeframe.
Created attachment 26035 [details] Fix for the problem.
Changes checked into CVS HEAD. Bumped the gcalctool version number in configure.in to 4.0.0 (yes the first fix for the GNOME 2.7/2.8 series.