[Debian-med-packaging] Gentle does not build on two architectures

Christian Seiler christian at iwakd.de
Tue Jan 31 13:55:51 UTC 2017


Hi Andreas,

On 01/31/2017 09:07 AM, Andreas Tille wrote:
> while gentle 1.9+cvs20100605+dfsg1-5 has migrated to testing and #845844
> is marked as done it still affects unstable since it does not build on
> kfreebsd-amd64 and x32[1].  On both architectures it fails to build with
> 
> 
> /usr/bin/ld: SequenceTypeAAstructure.o: relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
> /usr/bin/ld: OnlineTools.o: relocation R_X86_64_32S against `.rodata.str4.4' can not be used when making a shared object; recompile with -fPIC
> /usr/bin/ld: TEliteLaChromLogDialog.o: relocation R_X86_64_32S against `.rodata.str4.4' can not be used when making a shared object; recompile with -fPIC
> /usr/bin/ld: TRestrictionIdentifier.o: relocation R_X86_64_32S against `.rodata.str4.8' can not be used when making a shared object; recompile with -fPIC
> /usr/bin/ld: final link failed: Nonrepresentable section on output
> collect2: error: ld returned 1 exit status

Well, if you look at the build log:

g++ -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"GENtle\" -DVERSION=\"1.5\" -I.   -Wdate-time -D_FORTIFY_SOURCE=2 -I/usr/lib/x86_64-kfreebsd-gnu/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__  -D__DEBIAN__ -O2 -g -Wno-write-strings -DUSE_EXTERNAL_CLUSTALW -c -o SequenceTypeAAstructure.o SequenceTypeAAstructure.cpp

It appears the dpkg-buildflags --get CXXFLAGS aren't passed in properly
to that compile command, because the -specs=/usr/share/dpkg/pie-compile.specs
is missing from that line.

The build log scanner agrees with me:
https://qa.debian.org/bls/packages/g/gentle.html
(Other flags are not passed as well, that's why it complains. The scanner
is linked from the package tracker btw.)

And the only reason they built on the other archs is that the upload
was done before PIE was enabled by default (and just on kfreebsd-amd64
and x32 the builds were attempted later). I suspect that the package
actually FTBFS on all archs that don't have PIE enabled in the compiler
by default now (haven't tried it though).

> Any hint what to do here?

The package's build system is actually fine: very simple autoconf +
automake with no customization that overrides flags.

So what's going on is that you have a broken debian/rules:

CXXFLAGS = "-D__DEBIAN__ -O2 -g -Wno-write-strings -DUSE_EXTERNAL_CLUSTALW"

This is just plain wrong. You should rather do:

export DEB_CXXFLAGS_MAINT_APPEND = -D__DEBIAN__ -O2 -g -Wno-write-strings -DUSE_EXTERNAL_CLUSTALW

dpkg-buildflags will then take care of the rest. See also:
https://wiki.debian.org/HardeningWalkthrough#How_can_I_use_additional_flags.3F

If you do that, you can then also get rid of:

override_dh_auto_configure:
	CXXFLAGS=$(CXXFLAGS) dh_auto_configure

override_dh_auto_build:
	$(MAKE) -k CXXFLAGS=$(CXXFLAGS) 

in your d/rules.

Hope that helps.

Regards,
Christian



More information about the Debian-med-packaging mailing list