Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.bugs.dist > #1261239 > unrolled thread

Bug#1115142: spectrum2: FTBFS: /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libjsoncpp.a(json_reader.cpp.o): relocation R_X86_64_PC32 against symbol `_ZTVN4Json17CharReaderBuilderE' can not be used when making a shared object; recompile with -fPIC

Started bySantiago Vila <sanvila@debian.org>
First post2025-09-13 18:40 +0200
Last post2025-11-11 14:40 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.debian.bugs.dist


Contents

  Bug#1115142: spectrum2: FTBFS: /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libjsoncpp.a(json_reader.cpp.o): relocation R_X86_64_PC32 against symbol `_ZTVN4Json17CharReaderBuilderE' can not be used when making a shared object; recompile with -fPIC Santiago Vila <sanvila@debian.org> - 2025-09-13 18:40 +0200
    Bug#1115142: spectrum2: FTBFS: /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libjsoncpp.a(json_reader.cpp.o): relocation R_X86_64_PC32 against symbol `_ZTVN4Json17CharReaderBuilderE' can not be used when making a shared object; recompile with -fPIC Adrian Bunk <bunk@debian.org> - 2025-11-10 20:10 +0100
    Bug#1115142: spectrum2: FTBFS: /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libjsoncpp.a(json_reader.cpp.o): relocation R_X86_64_PC32 against symbol `_ZTVN4Json17CharReaderBuilderE' can not be used when making a shared object; recompile with -fPIC Adrian Bunk <bunk@debian.org> - 2025-11-11 14:40 +0100

#1261239 — Bug#1115142: spectrum2: FTBFS: /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libjsoncpp.a(json_reader.cpp.o): relocation R_X86_64_PC32 against symbol `_ZTVN4Json17CharReaderBuilderE' can not be used when making a shared object; recompile with -fPIC

FromSantiago Vila <sanvila@debian.org>
Date2025-09-13 18:40 +0200
SubjectBug#1115142: spectrum2: FTBFS: /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libjsoncpp.a(json_reader.cpp.o): relocation R_X86_64_PC32 against symbol `_ZTVN4Json17CharReaderBuilderE' can not be used when making a shared object; recompile with -fPIC
Message-ID<LuBs8-f2Q8-59@gated-at.bofh.it>
Package: src:spectrum2
Version: 2.2.1+dfsg-2
Severity: serious
Tags: ftbfs forky sid

Dear maintainer:

During a rebuild of all packages in unstable, your package failed to build.

Below you will find how the build ends (probably the most relevant part,
but not necessarily). If required, the full build log is available here:

https://people.debian.org/~sanvila/build-logs/202509/

About the archive rebuild: The build was made on virtual machines from AWS,
using sbuild and a reduced chroot with only build-essential packages.

If you could not reproduce the bug please contact me privately, as I
am willing to provide ssh access to a virtual machine where the bug is
fully reproducible.

If this is really a bug in one of the build-depends, please use
reassign and add an affects on src:spectrum2, so that this is still
visible in the BTS web page for this package.

Thanks.

--------------------------------------------------------------------------------
[...]
[ 57%] Building CXX object libtransport/CMakeFiles/transport.dir/__/include/Swiften/TLS/TLSServerContext.cpp.o
cd /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/libtransport && /us [too-long-redacted] wiften/TLS/TLSServerContext.cpp
[ 58%] Building CXX object libtransport/CMakeFiles/transport.dir/__/include/Swiften/TLS/TLSServerContextFactory.cpp.o
cd /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/libtransport && /us [too-long-redacted] TLS/TLSServerContextFactory.cpp
[ 58%] Linking CXX shared library libtransport.so
cd /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/libtransport && /usr/bin/cmake -E cmake_link_script CMakeFiles/transport.dir/link.txt --verbose=1
/usr/bin/c++ -fPIC -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>> [too-long-redacted] v' in read-only section `.text'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libjsoncpp.a(json_reader.cpp.o): relocation R_X86_64_PC32 against symbol `_ZTVN4Json17CharReaderBuilderE' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
StanzaRouter.cpp.o CMakeFiles/transport.dir/__/include/Swift [too-long-redacted] b/x86_64-linux-gnu/libjsoncpp.a
make[3]: *** [libtransport/CMakeFiles/transport.dir/build.make:1111: libtransport/libtransport.so.2.0] Error 1
make[3]: Leaving directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
make[2]: *** [CMakeFiles/Makefile2:583: libtransport/CMakeFiles/transport.dir/all] Error 2
make[2]: Leaving directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
make[1]: *** [Makefile:159: all] Error 2
make[1]: Leaving directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
dh_auto_build: error: cd obj-x86_64-linux-gnu && make -j2 "INSTALL=install --strip-program=true" VERBOSE=1 returned exit code 2
make: *** [debian/rules:31: binary] Error 25
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
--------------------------------------------------------------------------------

[toc] | [next] | [standalone]


#1269748

FromAdrian Bunk <bunk@debian.org>
Date2025-11-10 20:10 +0100
Message-ID<LPFr3-bYQr-11@gated-at.bofh.it>
In reply to#1261239
On Sat, Sep 13, 2025 at 04:29:34PM +0000, Santiago Vila wrote:
> Package: src:spectrum2
> Version: 2.2.1+dfsg-2
> Severity: serious
> Tags: ftbfs forky sid
>...
> --------------------------------------------------------------------------------
> [...]
> [ 57%] Building CXX object libtransport/CMakeFiles/transport.dir/__/include/Swiften/TLS/TLSServerContext.cpp.o
> cd /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/libtransport && /us [too-long-redacted] wiften/TLS/TLSServerContext.cpp
> [ 58%] Building CXX object libtransport/CMakeFiles/transport.dir/__/include/Swiften/TLS/TLSServerContextFactory.cpp.o
> cd /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/libtransport && /us [too-long-redacted] TLS/TLSServerContextFactory.cpp
> [ 58%] Linking CXX shared library libtransport.so
> cd /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/libtransport && /usr/bin/cmake -E cmake_link_script CMakeFiles/transport.dir/link.txt --verbose=1
> /usr/bin/c++ -fPIC -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>> [too-long-redacted] v' in read-only section `.text'
> /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libjsoncpp.a(json_reader.cpp.o): relocation R_X86_64_PC32 against symbol `_ZTVN4Json17CharReaderBuilderE' can not be used when making a shared object; recompile with -fPIC
> /usr/bin/ld: final link failed: bad value
> collect2: error: ld returned 1 exit status
> StanzaRouter.cpp.o CMakeFiles/transport.dir/__/include/Swift [too-long-redacted] b/x86_64-linux-gnu/libjsoncpp.a
> make[3]: *** [libtransport/CMakeFiles/transport.dir/build.make:1111: libtransport/libtransport.so.2.0] Error 1
> make[3]: Leaving directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
> make[2]: *** [CMakeFiles/Makefile2:583: libtransport/CMakeFiles/transport.dir/all] Error 2
> make[2]: Leaving directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
> make[1]: *** [Makefile:159: all] Error 2
> make[1]: Leaving directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
> dh_auto_build: error: cd obj-x86_64-linux-gnu && make -j2 "INSTALL=install --strip-program=true" VERBOSE=1 returned exit code 2
> make: *** [debian/rules:31: binary] Error 25
> dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
> --------------------------------------------------------------------------------

This FTBFS looks triggered by

libjsoncpp (1.9.6-4) unstable; urgency=medium

  * Build static library again.
...
 -- Timo Röhling <roehling@debian.org>  Thu, 04 Sep 2025 17:04:25 +0200

Editing libtransport/CMakeLists.txt to us JsonCpp::JsonCppShared instead 
of JsonCpp::JsonCpp fixes the build, but that shouldn't be necessary.

Timo, can you see what's going wrong here related to 
https://sources.debian.org/src/spectrum2/2.2.1%2Bdfsg-2/cmake_modules/FindJsonCpp.cmake 
?

Thanks
Adrian

BTS: This is with CMake 3.

[toc] | [prev] | [next] | [standalone]


#1269813

FromAdrian Bunk <bunk@debian.org>
Date2025-11-11 14:40 +0100
Message-ID<LPWLf-carR-7@gated-at.bofh.it>
In reply to#1261239
On Tue, Nov 11, 2025 at 08:30:55AM +0100, Timo Röhling wrote:
> Hi Adrian,

Hi Timo,

> * Adrian Bunk <bunk@debian.org> [2025-11-10 21:03]:
> > On Sat, Sep 13, 2025 at 04:29:34PM +0000, Santiago Vila wrote:
> > > /usr/bin/ld:
> > > /usr/lib/x86_64-linux-gnu/libjsoncpp.a(json_reader.cpp.o):
> > > relocation R_X86_64_PC32 against symbol
> > > `_ZTVN4Json17CharReaderBuilderE' can not be used when making a
> > > shared object; recompile with -fPIC
> > 
> > Editing libtransport/CMakeLists.txt to us JsonCpp::JsonCppShared instead
> > of JsonCpp::JsonCpp fixes the build, but that shouldn't be necessary.
> > 
> > Timo, can you see what's going wrong here related to
> > https://sources.debian.org/src/spectrum2/2.2.1%2Bdfsg-2/cmake_modules/FindJsonCpp.cmake
> > ?
> 
> libjsoncpp provides its own JsonCpp::JsonCpp target, and that one prefers
> the static library over the shared one if both are built:
> https://sources.debian.org/src/libjsoncpp/1.9.6-4/jsoncpp-namespaced-targets.cmake
> 
> I think I'm going to change that in libjsoncpp, which will restore the
> previous behavior (when the static library was not built at all) and makes
> more sense in the Debian context anyway.

thanks!

> Cheers
> Timo

cu
Adrian

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.bugs.dist


csiph-web