added DSO workarounds

This commit is contained in:
ensc 2010-02-15 21:42:40 +00:00
parent 0b94a9f14d
commit d1ccc8a5d0
3 changed files with 170 additions and 1 deletions

104
dfs.cc Normal file
View File

@ -0,0 +1,104 @@
/* --*- c++ -*--
* Copyright (C) 2010 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <string>
#include <list>
#include <map>
#include <iostream>
class node {
public:
node(std::string const &name) : name_(name) {}
void add_child(class node *n)
{
children_.push_back(n);
}
void dfs(std::list<std::string> &res);
bool visited;
private:
std::string const name_;
std::list<class node *> children_;
};
void node::dfs(std::list<std::string> &res)
{
std::list<class node *>::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<std::string, class node *> 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<std::string, class node *>::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<std::string> res(nodes.size());
n->second->dfs(res);
for (std::list<std::string>::const_iterator i = res.begin();
i != res.end(); ++i)
std::cout << *i << " ";
std::cout << std::endl;
}
}

53
dso-fixup Executable file
View File

@ -0,0 +1,53 @@
#! /bin/bash
# Copyright (C) 2010 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
#
# 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 <http://www.gnu.org/licenses/>.
## Usage: dso-fixup <build-root> <libdir> <pattern> <libs>*
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

View File

@ -6,7 +6,7 @@
Summary: A lightweight RPC library based on XML and HTTP Summary: A lightweight RPC library based on XML and HTTP
Name: xmlrpc-c Name: xmlrpc-c
Version: 1.21.00 Version: 1.21.00
Release: %release_func 1300.%svnrev Release: %release_func 1301.%svnrev
# See COPYING for details. # See COPYING for details.
# The Python 1.5.2 license used by a few files is just BSD. # The Python 1.5.2 license used by a few files is just BSD.
License: BSD and MIT 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 # upstream does not tag versions so we must fetch from the branch and
# check which version was used for it # check which version was used for it
%{?advanced_branch:Source0: xmlrpc-c-%version.tar.bz2} %{?advanced_branch:Source0: xmlrpc-c-%version.tar.bz2}
Source100: dfs.cc
Source101: dso-fixup
Patch100: xmlrpc-c-cmake.patch Patch100: xmlrpc-c-cmake.patch
Patch102: xmlrpc-c-printf-size_t.patch Patch102: xmlrpc-c-printf-size_t.patch
Patch105: xmlrpc-c-longlong.patch Patch105: xmlrpc-c-longlong.patch
@ -129,6 +133,8 @@ cmake .. \
-DENABLE_TOOLS:BOOL=ON -DENABLE_TOOLS:BOOL=ON
make VERBOSE=1 %{?_smp_mflags} make VERBOSE=1 %{?_smp_mflags}
%__cxx $RPM_OPT_FLAGS %SOURCE100 -o depsort
%install %install
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
@ -137,6 +143,8 @@ make install DESTDIR=$RPM_BUILD_ROOT
chmod +x $RPM_BUILD_ROOT%_libdir/*.so chmod +x $RPM_BUILD_ROOT%_libdir/*.so
%SOURCE101 "$RPM_BUILD_ROOT" "%_libdir" 'libxmlrpc' $RPM_BUILD_ROOT%_libdir/libxmlrpc*.so.[0-9]
%check %check
unset PKG_CONFIG_PATH unset PKG_CONFIG_PATH
@ -223,6 +231,10 @@ rm -rf $RPM_BUILD_ROOT
%changelog %changelog
* Mon Feb 15 2010 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 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 <enrico.scholz@informatik.tu-chemnitz.de> - 1.21.00-1300.1851 * Thu Jan 14 2010 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 1.21.00-1300.1851
- updated to 1.21.00 (rev 1851) - updated to 1.21.00 (rev 1851)
- removed curl-trace patch as applied upstream - removed curl-trace patch as applied upstream