No subject
Mon Mar 29 23:06:26 UTC 2010
that's why I wanted to reflect that fact in my patch. Am I wrong
on that point? The disagreement is maybe just here.
I assume that you run git-buildpackage on the revision=20
f57b74db488c91754eadbca263c065ff2022ac71, thus the build has failed
with the status message given by Adam in that bug entry.
The relevant code is in the CONVERTOR directory of the VISU module:
$ cd VISU_SRC_5.1.3/src/CONVERTOR
The VISUConvertor can not be built because GetIDMapper symbols do not exi=
st.
You can check the problem in the corresponding module:
=20
$ readelf -s .libs/libVisuConvertor_la-VISU_MergeFilterUtilities.o | =
\=20
grep GetIDMapper
However if you remove the O2 optimizations in the CXXFLAGS of the Makefil=
e
(by first making a backup):
$ cp Makefile Makefile.orig
$ sed -i "s/^CXXFLAGS =3D .*/CXXFLAGS =3D -D_OCC64 -g -D_DEBUG_ -pthr=
ead/" \
Makefile
and then force the module to be built again:
$ rm libVisuConvertor_la-VISU_MergeFilterUtilities.lo
$ make
it will work. Now if you check the exported symbols:
$ readelf -s .libs/libVisuConvertor_la-VISU_MergeFilterUtilities.o | =
\
grep GetIDMapper
759: 0000000000000000 113 FUNC WEAK DEFAULT 395 _ZN4VISU11Get=
IDMapperINS_
769: 0000000000000000 113 FUNC WEAK DEFAULT 411 _ZN4VISU11Get=
IDMapperINS_
879: 0000000000000000 259 FUNC WEAK DEFAULT 569 _ZN4VISU11Get=
IDMapperINS_
880: 0000000000000000 259 FUNC WEAK DEFAULT 571 _ZN4VISU11Get=
IDMapperINS_
you should have 4 entries. At that step, I understood that the upstream
code is valid C++ (but not necessarily robust) and thus I wanted to provi=
de
a patch controlling g++ optimizations while respecting their coding style=
.
That's why you can find the 'if' statements since the beginning. My patch
no-template-function-inline will remove every template function inlining
of GetIDMapper when compiling with O2 optimizations:
$ cd ../../..
$ patch -p1 < no-template-function-inline.patch=20
$ patch -p1 < debian/patches/visu-no-template-inline.patch
$ cd VISU_SRC_5.1.3/src/CONVERTOR
$ mv Makefile.orig Makefile
$ make
$ readelf -s .libs/libVisuConvertor_la-VISU_MergeFilterUtilities.o | =
\
grep GetIDMapper
89: 0000000000000000 113 FUNC WEAK DEFAULT 48 _ZN4VISU11GetI=
DMapperINS_
95: 0000000000000000 54 FUNC WEAK DEFAULT 50 _ZN4VISU11GetI=
DMapperINS_
96: 0000000000000000 54 FUNC WEAK DEFAULT 52 _ZN4VISU11GetI=
DMapperINS_
97: 0000000000000000 113 FUNC WEAK DEFAULT 54 _ZN4VISU11GetI=
DMapperINS_
=20
Finally your solution will only export the needed GetIDMapper symbol:
$ git checkout HEAD VISU_MergeFilterUtilities.hxx
$ cd ../../..
$ patch -p1 < visu-template-export.patch
$ cd VISU_SRC_5.1.3/src/CONVERTOR
$ make=20
$ readelf -s .libs/libVisuConvertor_la-VISU_MergeFilterUtilities.o | =
\
grep GetIDMapper
68: 0000000000000000 113 FUNC WEAK DEFAULT 26 _ZN4VISU11GetI=
DMapperINS_
I agree with you that your solution is valid and robust C++ code so the=20
if statements could be removed no matter if the code is compiled with=20
or without optimizations or even with others compilers. But I think that
such a decision should be made by upstream because we discovered the=20
problem only when working with g++ O2 optimizations. I am open to further
explanations if needed.
Best regards,
Andr=E9
More information about the debian-science-maintainers
mailing list