FS#52198 - [xmlrpc-c] Can not link programs to 1:1.43.03-2

Attached to Project: Community Packages
Opened by Bas Timmer (bepaald) - Sunday, 18 December 2016, 10:02 GMT
Last edited by Doug Newgard (Scimmia) - Sunday, 29 January 2017, 15:05 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Alexander F. Rødseth (xyproto)
Architecture x86_64
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

Since the last package update of xmlrpc-c-1:1.43.03-2 I am getting errors when trying to link to xmlrpc-c. Since the problem was introduced after a package update (not a software update) I am assuming this is not an upstream bug, but please correct me if I am wrong. Downgrading to the previous package version (1:1.43.03-2 => 1:1.43.03-1) solves the issue.

Additional info:

I am running x86_64, so just reporting for that architecture but it is quite possible the problem also occurs on i686.

Steps to reproduce:

The following shows a tiny example program failing to link, then downgrading xmlrpc-c, then successfully linking. Probably best viewed in a monospace font. I've also tested with other g++ flags (changing the std to c++11 or leaving it out), but the results are the same.

[~] $ cat xmlrpc_sample_add_client.cpp
#include <cstdlib>
#include <string>
#include <iostream>
#include <map>

#include <xmlrpc-c/girerr.hpp>
#include <xmlrpc-c/base.hpp>
#include <xmlrpc-c/client_simple.hpp>

int main() {
std::map<std::string, xmlrpc_c::value> structData;
xmlrpc_c::value_struct vs(structData);

// linking works without next line
std::map<std::string, xmlrpc_c::value> const mapData(static_cast<std::map<std::string, xmlrpc_c::value> >(vs));

return 0;
}
[~] $ g++ --std=c++14 -Wall -Wextra -O3 -march=native $(xmlrpc-c-config c++2 client --libs) xmlrpc_sample_add_client.cpp
/tmp/ccvmIYlZ.o: In function `main':
xmlrpc_sample_add_client.cpp:(.text.startup+0x44): undefined reference to `xmlrpc_c::value_struct::operator std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, xmlrpc_c::value, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, xmlrpc_c::value> > >[abi:cxx11]() const'
collect2: error: ld returned 1 exit status
[~] $ sudo pacman -U /var/cache/pacman/pkg/xmlrpc-c-1\:1.43.03-1-x86_64.pkg.tar.xz
[sudo] password for bepaald:
loading packages...
warning: downgrading package xmlrpc-c (1:1.43.03-2 => 1:1.43.03-1)
resolving dependencies...
looking for conflicting packages...

Packages (1) xmlrpc-c-1:1.43.03-1

Total Installed Size: 1,22 MiB
Net Upgrade Size: 0,01 MiB

:: Proceed with installation? [Y/n]
(1/1) checking keys in keyring [#########################################################] 100%
(1/1) checking package integrity [#########################################################] 100%
(1/1) loading package files [#########################################################] 100%
(1/1) checking for file conflicts [#########################################################] 100%
(1/1) checking available disk space [#########################################################] 100%
:: Processing package changes...
(1/1) downgrading xmlrpc-c [#########################################################] 100%
[~] $ g++ --std=c++14 -Wall -Wextra -O3 -march=native $(xmlrpc-c-config c++2 client --libs) xmlrpc_sample_add_client.cpp
[~] $ # no output, linked successfully.
[~] $
This task depends upon

Closed by  Doug Newgard (Scimmia)
Sunday, 29 January 2017, 15:05 GMT
Reason for closing:  Fixed
Additional comments about closing:  xmlrpc-c 1:1.43.06-1
Comment by Bas Timmer (bepaald) - Monday, 19 December 2016, 18:05 GMT
After reading the following https://gcc.gnu.org/onlinedocs/libstdc%2B%2B/manual/using_dual_abi.html and because I noticed the [abi:cxx11] tag in the linker error above, I have tried defining the _GLIBCXX_USE_CXX11_ABI to different values. When setting the macro to 1, the error is as it is above (1 is the default), when setting it to 0, the error changes to:

[~] $ g++ -std=c++14 -Wall -Wextra -O3 -march=native $(xmlrpc-c-config c++2 client --libs) xmlrpc_sample_add_client.cpp
/tmp/cc8LMvU3.o: In function `main':
xmlrpc_sample_add_client.cpp:(.text.startup+0x37): undefined reference to `xmlrpc_c::value_struct::value_struct(std::map<std::string, xmlrpc_c::value, std::less<std::string>, std::allocator<std::pair<std::string const, xmlrpc_c::value> > > const&)'
xmlrpc_sample_add_client.cpp:(.text.startup+0x44): undefined reference to `xmlrpc_c::value_struct::operator std::map<std::string, xmlrpc_c::value, std::less<std::string>, std::allocator<std::pair<std::string const, xmlrpc_c::value> > >() const'
collect2: error: ld returned 1 exit status

So, now there are two errors instead of one, and the second one is identical to the previously mentioned error but without the [abi:cxx11] tag. Again, these results do not change with other -std=c++XX flags.

thanks
Comment by Alexander F. Rødseth (xyproto) - Sunday, 25 December 2016, 16:42 GMT
Hi, thanks for reporting. Will look into it.
Comment by Alexander F. Rødseth (xyproto) - Sunday, 29 January 2017, 00:47 GMT
Please test if the latest xmlrpc-c package, 1.43.06, fixes the issue.
Comment by Bas Timmer (bepaald) - Sunday, 29 January 2017, 10:36 GMT
Hi, it's working for me, thanks for the fix!

Loading...