From d1ccc8a5d01c599641fde9a1e559685504096074 Mon Sep 17 00:00:00 2001 From: ensc Date: Mon, 15 Feb 2010 21:42:40 +0000 Subject: [PATCH] added DSO workarounds --- dfs.cc | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++ dso-fixup | 53 +++++++++++++++++++++++++ xmlrpc-c.spec | 14 ++++++- 3 files changed, 170 insertions(+), 1 deletion(-) create mode 100644 dfs.cc create mode 100755 dso-fixup diff --git a/dfs.cc b/dfs.cc new file mode 100644 index 0000000..4919fb8 --- /dev/null +++ b/dfs.cc @@ -0,0 +1,104 @@ +/* --*- c++ -*-- + * Copyright (C) 2010 Enrico Scholz + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include +#include + +class node { +public: + node(std::string const &name) : name_(name) {} + void add_child(class node *n) + { + children_.push_back(n); + } + + void dfs(std::list &res); + bool visited; + +private: + std::string const name_; + std::list children_; +}; + +void node::dfs(std::list &res) +{ + std::list::iterator i; + + visited = true; + + for (i = children_.begin(); i != children_.end(); ++i) { + if ((*i)->visited) + continue; + + (*i)->dfs(res); + } + + res.push_front(name_); +} + +int main(void) +{ + std::map nodes; + + for (;;) { + std::string name; + class node *cur_node; + + std::cin >> name; + if (!std::cin.good()) + break; + + if (nodes.find(name) == nodes.end()) + nodes[name] = new node(name); + + cur_node = nodes[name]; + + while (std::cin.good()) { + std::cin >> name; + + if (name == "##") + break; + + if (nodes.find(name) == nodes.end()) + nodes[name] = new node(name); + + cur_node->add_child(nodes[name]); + } + } + + typedef std::map::iterator node_iterator; + + for (node_iterator n = nodes.begin(); n != nodes.end(); ++n) { + for (node_iterator m = nodes.begin(); + m != nodes.end(); ++m) + m->second->visited = false; + + std::list res(nodes.size()); + n->second->dfs(res); + + for (std::list::const_iterator i = res.begin(); + i != res.end(); ++i) + std::cout << *i << " "; + + std::cout << std::endl; + } +} diff --git a/dso-fixup b/dso-fixup new file mode 100755 index 0000000..5ed57a4 --- /dev/null +++ b/dso-fixup @@ -0,0 +1,53 @@ +#! /bin/bash +# Copyright (C) 2010 Enrico Scholz +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +## Usage: dso-fixup * + +BR=$1 +LIBDIR=$2 +PATTERN=$3 +shift 3 + +for i; do + echo -n $(basename "$i")' ' + readelf -d $i | sed "\\!(NEEDED).*${PATTERN}!"'s/[^:]\+: \[\(.*\)\]/\1/p;d' | xargs echo -n + echo " ##" +done | ./depsort | while read lib deps; do + link=$BR$LIBDIR/${lib%.so.*}.so + test -L "$link" || { + echo "bad file '$link'" >&2 + exit 1 + } + rm -f $link + + set -- $deps + + { + echo -n "INPUT($LIBDIR/$lib" + d= + if test "$#" -gt 0; then + echo -n " AS_NEEDED(" + for i; do + echo -n "$d$LIBDIR/$i" + d=' ' + done + echo -n ")" + fi + echo ")" + } > "$link" + + chmod 0644 "$link" +done diff --git a/xmlrpc-c.spec b/xmlrpc-c.spec index e4512f5..242d208 100644 --- a/xmlrpc-c.spec +++ b/xmlrpc-c.spec @@ -6,7 +6,7 @@ Summary: A lightweight RPC library based on XML and HTTP Name: xmlrpc-c Version: 1.21.00 -Release: %release_func 1300.%svnrev +Release: %release_func 1301.%svnrev # See COPYING for details. # The Python 1.5.2 license used by a few files is just BSD. License: BSD and MIT @@ -17,6 +17,10 @@ URL: http://xmlrpc-c.sourceforge.net/ # upstream does not tag versions so we must fetch from the branch and # check which version was used for it %{?advanced_branch:Source0: xmlrpc-c-%version.tar.bz2} + +Source100: dfs.cc +Source101: dso-fixup + Patch100: xmlrpc-c-cmake.patch Patch102: xmlrpc-c-printf-size_t.patch Patch105: xmlrpc-c-longlong.patch @@ -129,6 +133,8 @@ cmake .. \ -DENABLE_TOOLS:BOOL=ON make VERBOSE=1 %{?_smp_mflags} +%__cxx $RPM_OPT_FLAGS %SOURCE100 -o depsort + %install rm -rf $RPM_BUILD_ROOT @@ -137,6 +143,8 @@ make install DESTDIR=$RPM_BUILD_ROOT chmod +x $RPM_BUILD_ROOT%_libdir/*.so +%SOURCE101 "$RPM_BUILD_ROOT" "%_libdir" 'libxmlrpc' $RPM_BUILD_ROOT%_libdir/libxmlrpc*.so.[0-9] + %check unset PKG_CONFIG_PATH @@ -223,6 +231,10 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Mon Feb 15 2010 Enrico Scholz - 1.21.00-1301.1851 +- replaced .so symlinks by linker scripts which add all implicit + dependencies in AS_NEEDED() commands (#564607, #565577) + * Thu Jan 14 2010 Enrico Scholz - 1.21.00-1300.1851 - updated to 1.21.00 (rev 1851) - removed curl-trace patch as applied upstream