Linking problem (discarded symbols)

I have tried to find some information about this topic in the forum but could not so here goes…

My colleague has pulled down a fresh copy of ROOT from the CVS (version 5.15/06) and we are trying to compile it on an ubuntu 6.06 LTS server. While following the standard build procedure for some reason the linker complains about the symbol _ZN4ROOT6Cintex9ConverterIhE6toCintEP8G__valuePv being referenced in .rodata section, but having been defined in discarded section.
Has anyone come across this problem and can help us?
Thanks in advance.

GCC version:
gcc (GCC) 4.0.3 (Ubuntu 4.0.3-1ubuntu5)

Platform details:
Linux ms1 2.6.15-28-amd64-server #1 SMP Thu Feb 1 16:32:07 UTC 2007
x86_64 GNU/Linux

A partial dump of the compilation and link follows:


bin/rmkdepend -R -fcintex/src/CINTClassBuilder.d -Y -w 1000 – -pipe
-Wall -m64 -fPIC -Iinclude -pthread -D__cplusplus –
cintex/src/CINTClassBuilder.cxx
g++ -O3 -march=opteron -pipe -Wall -m64 -fPIC -Iinclude -pthread -o
cintex/src/CINTClassBuilder.o -c cintex/src/CINTClassBuilder.cxx
bin/rmkdepend -R -fcintex/src/CINTEnumBuilder.d -Y -w 1000 – -pipe
-Wall -m64 -fPIC -Iinclude -pthread -D__cplusplus –
cintex/src/CINTEnumBuilder.cxx
g++ -O3 -march=opteron -pipe -Wall -m64 -fPIC -Iinclude -pthread -o
cintex/src/CINTEnumBuilder.o -c cintex/src/CINTEnumBuilder.cxx
bin/rmkdepend -R -fcintex/src/Cintex.d -Y -w 1000 – -pipe -Wall -m64
-fPIC -Iinclude -pthread -D__cplusplus – cintex/src/Cintex.cxx
g++ -O3 -march=opteron -pipe -Wall -m64 -fPIC -Iinclude -pthread -o
cintex/src/Cintex.o -c cintex/src/Cintex.cxx
bin/rmkdepend -R -fcintex/src/CINTFunctional.d -Y -w 1000 – -pipe
-Wall -m64 -fPIC -Iinclude -pthread -D__cplusplus –
cintex/src/CINTFunctional.cxx
g++ -O3 -march=opteron -pipe -Wall -m64 -fPIC -Iinclude -pthread -o
cintex/src/CINTFunctional.o -c cintex/src/CINTFunctional.cxx
bin/rmkdepend -R -fcintex/src/CINTFunctionBuilder.d -Y -w 1000 –
-pipe -Wall -m64 -fPIC -Iinclude -pthread -D__cplusplus –
cintex/src/CINTFunctionBuilder.cxx
g++ -O3 -march=opteron -pipe -Wall -m64 -fPIC -Iinclude -pthread -o
cintex/src/CINTFunctionBuilder.o -c cintex/src/CINTFunctionBuilder.cxx
bin/rmkdepend -R -fcintex/src/CINTScopeBuilder.d -Y -w 1000 – -pipe
-Wall -m64 -fPIC -Iinclude -pthread -D__cplusplus –
cintex/src/CINTScopeBuilder.cxx
g++ -O3 -march=opteron -pipe -Wall -m64 -fPIC -Iinclude -pthread -o
cintex/src/CINTScopeBuilder.o -c cintex/src/CINTScopeBuilder.cxx
bin/rmkdepend -R -fcintex/src/CINTTypedefBuilder.d -Y -w 1000 – -pipe
-Wall -m64 -fPIC -Iinclude -pthread -D__cplusplus –
cintex/src/CINTTypedefBuilder.cxx
g++ -O3 -march=opteron -pipe -Wall -m64 -fPIC -Iinclude -pthread -o
cintex/src/CINTTypedefBuilder.o -c cintex/src/CINTTypedefBuilder.cxx
bin/rmkdepend -R -fcintex/src/CINTUtils.d -Y -w 1000 – -pipe -Wall
-m64 -fPIC -Iinclude -pthread -D__cplusplus – cintex/src/CINTUtils.cxx
g++ -O3 -march=opteron -pipe -Wall -m64 -fPIC -Iinclude -pthread -o
cintex/src/CINTUtils.o -c cintex/src/CINTUtils.cxx
bin/rmkdepend -R -fcintex/src/CINTVariableBuilder.d -Y -w 1000 –
-pipe -Wall -m64 -fPIC -Iinclude -pthread -D__cplusplus –
cintex/src/CINTVariableBuilder.cxx
g++ -O3 -march=opteron -pipe -Wall -m64 -fPIC -Iinclude -pthread -o
cintex/src/CINTVariableBuilder.o -c cintex/src/CINTVariableBuilder.cxx
bin/rmkdepend -R -fcintex/src/ROOTClassEnhancer.d -Y -w 1000 – -pipe
-Wall -m64 -fPIC -Iinclude -pthread -D__cplusplus –
cintex/src/ROOTClassEnhancer.cxx
g++ -O3 -march=opteron -pipe -Wall -m64 -fPIC -Iinclude -pthread -o
cintex/src/ROOTClassEnhancer.o -c cintex/src/ROOTClassEnhancer.cxx
cp cintex/python/PyCintex.py lib/PyCintex.py
g++ -shared -Wl,-soname,libCintex.so -m64 -O3 -march=opteron -o
lib/libCintex.so cintex/src/CINTClassBuilder.o
cintex/src/CINTEnumBuilder.o cintex/src/Cintex.o
cintex/src/CINTFunctional.o cintex/src/CINTFunctionBuilder.o
cintex/src/CINTScopeBuilder.o cintex/src/CINTTypedefBuilder.o
cintex/src/CINTUtils.o cintex/src/CINTVariableBuilder.o
cintex/src/ROOTClassEnhancer.o
.gnu.linkonce.t._ZN4ROOT6Cintex9ConverterIcE6toCintEP8G__valuePv' referenced in section.rodata’ of cintex/src/CINTUtils.o: defined in
discarded section
.gnu.linkonce.t._ZN4ROOT6Cintex9ConverterIcE6toCintEP8G__valuePv' of cintex/src/CINTUtils.o.gnu.linkonce.t._ZN4ROOT6Cintex9ConverterIhE6toCintEP8G__valuePv’
referenced in section .rodata' of cintex/src/CINTUtils.o: defined in discarded section.gnu.linkonce.t._ZN4ROOT6Cintex9ConverterIhE6toCintEP8G__valuePv’ of
cintex/src/CINTUtils.o
.gnu.linkonce.t._ZN4ROOT6Cintex9ConverterIsE6toCintEP8G__valuePv' referenced in section.rodata’ of cintex/src/CINTUtils.o: defined in
discarded section
.gnu.linkonce.t._ZN4ROOT6Cintex9ConverterIsE6toCintEP8G__valuePv' of cintex/src/CINTUtils.o.gnu.linkonce.t._ZN4ROOT6Cintex9ConverterItE6toCintEP8G__valuePv’
referenced in section .rodata' of cintex/src/CINTUtils.o: defined in discarded section.gnu.linkonce.t._ZN4ROOT6Cintex9ConverterItE6toCintEP8G__valuePv’ of
cintex/src/CINTUtils.o
.gnu.linkonce.t._ZN4ROOT6Cintex9ConverterIjE6toCintEP8G__valuePv' referenced in section.rodata’ of cintex/src/CINTUtils.o: defined in
discarded section
.gnu.linkonce.t._ZN4ROOT6Cintex9ConverterIjE6toCintEP8G__valuePv' of cintex/src/CINTUtils.o.gnu.linkonce.t._ZN4ROOT6Cintex9ConverterIlE6toCintEP8G__valuePv’
referenced in section .rodata' of cintex/src/CINTUtils.o: defined in discarded section.gnu.linkonce.t._ZN4ROOT6Cintex9ConverterIlE6toCintEP8G__valuePv’ of
cintex/src/CINTUtils.o
.gnu.linkonce.t._ZN4ROOT6Cintex9ConverterImE6toCintEP8G__valuePv' referenced in section.rodata’ of cintex/src/CINTUtils.o: defined in
discarded section
.gnu.linkonce.t._ZN4ROOT6Cintex9ConverterImE6toCintEP8G__valuePv' of cintex/src/CINTUtils.o.gnu.linkonce.t._ZN4ROOT6Cintex9ConverterIiE6toCintEP8G__valuePv’
referenced in section .rodata' of cintex/src/CINTUtils.o: defined in discarded section.gnu.linkonce.t._ZN4ROOT6Cintex9ConverterIiE6toCintEP8G__valuePv’ of
cintex/src/CINTUtils.o
collect2: ld returned 1 exit status
make: *** [lib/libCintex.so] Error 1
rm utils/src/rootcint_tmp.cxx utils/src/RStl_tmp.cxx

Just in case you did a simple cvs update, I suggest to
rm cintex/src/.d cintex/src/.o

Rene

Probably off topic or maybe not:

sometime ago I had the same problem. I had have to use old gcc 3.3.x and I couldn’t compile ROOT 5.11 and 5.14, since liker was giving to me something like:

And in my case those messages were referencing also to CINT library.

Well, I will not discuss here all possible fixes, I would like to refer you to a gcc compiler bug #16625 and to the patch which helped me and which is attached to comment #0.
It could be also fixed programmatically - it worked for me in my code (I also had one “bad” switch-case, which could’n be eaten by gcc 3.3.6), but there are too much things to change in CINT code, I therefore choose a patch for the compiler :slight_smile:

P.S. BTW, patch is for 3.4.x branch of gcc, but I checked the code which it patches and it hasn’t been changed through releases. This is, probably, why patch worked for my gcc 3.3.x.

P.P.S. There is a very nice simple example in comment #27, which could tell whether your compiler has this bug or not.

P.P.P.S. I also think that it could be a linker problem, so you may want to check your binutils…

[quote=“brun”]Just in case you did a simple cvs update, I suggest to
rm cintex/src/.d cintex/src/.o

Rene[/quote]

No, unfortunatelly we used a complete new checkout …

Hi,
did you manage to work around this by using a different compiler version, or by using a work-around as suggested by anar?
Axel.