From owner-freebsd-current Sat Jan 29 20:59:28 2000 Delivered-To: freebsd-current@freebsd.org Received: from FreeBSD.org (ppp17-besancon.isdnet.net [195.154.11.224]) by hub.freebsd.org (Postfix) with ESMTP id A44D615431 for ; Sat, 29 Jan 2000 20:59:20 -0800 (PST) (envelope-from jmz@FreeBSD.org) Received: (from jmz@localhost) by qix.jmz.org (8.9.3/8.9.3) id GAA10115; Sun, 30 Jan 2000 06:00:03 +0100 (MET) (envelope-from jmz@FreeBSD.org) Date: Sun, 30 Jan 2000 06:00:03 +0100 (MET) Message-Id: <200001300500.GAA10115@qix.jmz.org> From: Jean-Marc Zucconi To: louie@TransSys.COM Cc: current@FreeBSD.org In-reply-to: <200001290007.TAA05379@whizzo.transsys.com> (louie@TransSys.COM) Subject: Re: new C++ compiler changes References: <200001290007.TAA05379@whizzo.transsys.com> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >>>>> Louis A Mamakos writes: > I just put a new -current on my test machine, and watched a bunch of stuff > fall over and die due to the new C++ implementation. > Is it possible to bump the revision of libstdc++ (and perhaps others) so > that existing programs can continue to function? I fear I will be > tracking down occasional broken C++ programs for days now. The solution I adopted is to keep the old libstdc++.so.3 and rename it libstdc++.so.1. Then you just have to modify your executable so that it looks for libstdc++.so.1 instead of libstdc++.so.3 (script below :-)) Jean-Marc #!/usr/bin/perl if (!$ARGV[0] || $ARGV[0] eq "-h") { print STDERR "usage: $0 file...\n"; exit 1; } foreach (@ARGV) { if (! -f $_) { print STDERR "$_: not found\n"; } else { ($s) = `file $_`; if ($s !~ /: ELF.*dynamically linked/) { print STDERR "$_: bad format\n$s"; } else { @h = `objdump -h $_`; $done = 0; foreach $s (@h) { if ($s =~ /dynstr/) { &edit ($_, $s); $done = 1; } } if (!$done) { print STDERR "$_: no .dynstr section\n"; } } } } sub edit { $f = shift; $_ = shift; split; $len = hex ($_[2]); $skip = hex ($_[5]); if (!open (F, $f)) { print STDERR "$f: $!\n"; return; } $n = sysread (F, $a, $skip); if ($n != $skip) { print STDERR "$f: short read\n"; return; } $n = sysread (F, $_, $len); if ($n != $len) { print STDERR "$f: short read\n"; return; } if (! /libstdc\+\+.so.3/) { print STDERR "$f: libstdc++.so.3 not used\n"; return; } s/libstdc\+\+.so.3/libstdc++.so.1/; if (!open (G, ">$f.1")) { print STDERR "can't create $f.1\n"; close F; return; } syswrite (G, $a, $skip); syswrite (G, $_, $len); while ($n != 0) { $n = sysread (F, $_, 100000); if ($n < 0) { print STDERR "$f: read error\n"; close F; close G; return; } if ($n != 0) { $w = syswrite (G, $_, $n); if ($n < $w) { print STDERR "$f.1: write error\n"; close F; close G; return; } } } close F; close G; system ("mv $f $f.backup && mv $f.1 $f"); } -- Jean-Marc Zucconi PGP Key: finger jmz@FreeBSD.ORG To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message