This is the mail archive of the cygwin-apps mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GCC4, new package soon?


On 14/08/2009 08:13, Dave Korn wrote:
Dunno. Which "installed .la files" are you referring to?

Since libtool now treats the GCC libraries (except libgcc) like any other libtoolized library, meaning that, e.g. the full path to libstdc++.la is included in the $dependency_libs of all C++ dependent libtoolized libraries. That means, when you change gcc versions (but not releases of the same version), if you don't fix all the existing .la files, libtool linking will fail because $dependency_libs will point to a nonexistent location for libstdc++.la. (The same goes for libffi, libgfortran, libgomp, etc.)


Of course, we're no different than other Linux distros in this regard. I know that on Gentoo, the gcc postinstall does some sed magic to fix up existing .la files. This should do the trick:

===== CUT HERE =====

libdir=${@:-/usr/lib}

[ ! -d ${libdir} ] && exit 1

find ${libdir} -type f -name '*.la' | xargs -r grep -l '^dependency_libs=.*/usr/lib/gcc/i686-pc-cygwin/4.[3-9].[0-9]/lib[a-z_+]*.la' | xargs -r sed -i -e "/^dependency_libs=/ s|\(pc-cygwin\)/4.[3-9].[0-9]/\(lib[a-z_+]*.la\)|\1/$(/usr/bin/gcc-4 -dumpversion)/\2|g"

===== CUT HERE =====

(This needs some polishing for command line usage, but you get the picture.)

However unlike Gentoo, as a binary distro we need to handle the case where a package built for 4.3.2 isn't rebuilt for a while and is installed *after* a newer GCC. Perhaps this should be a separate script shipped with gcc4 in /usr/sbin which can be called by both gcc4 postinstalls and by the user as necessary?


Yaakov



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]