This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [patch] g++ testsuite for shared only builds


Andrew Pinski wrote:
Hello,

if I build a gcc without static library support I run into several failures like this:

Setting LD_LIBRARY_PATH to .:/mnt/slice1/gcc-svn/objdir/gcc:.:/mnt/slice1/gcc-svn/objdir/gcc:
./eb73.exe: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.4' not found (required by ./eb73.exe)
./eb73.exe: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.6' not found (required by ./eb73.exe)
FAIL: g++.old-deja/g++.robertl/eb73.C execution test


The testsuite picks the libstdc++ from my installed gcc-3.4 instead of the fresh built from gcc-4.x.

So I added the following piece to lib/g++.exp.
I know, not complete, especially for other targets having a different shared library extension.
Tested on ppc-linux (32-bit only).


Is the approach ok? If yes, shall I add the other checks as well?


Note this fixes  part of PR 16230.  Looks like all the *.exp have
the same issue.  I know that the objc testsuite has the same issue.

ok, then it would be probably useful to have something in target-libpath.exp for example to detect the shared library extension and then do the check for these libraries only once with the corresponding shared lib extension?


Like this:

in target-libpath.exp:

proc get_shlib_ext { } {

	if [istarget *-*-darwin*] {
	  set shlib_ext "dylib"
	}
  return $shlib_ext
}

in the g++.exp for example:

if [file exists "${gccpath}/libstdc++-v3/src/.libs/libstdc++.${shlib_ext}"] {
append flags " -L${gccpath}/libstdc++-v3/src/.libs "
append ld_library_path ":${gccpath}/libstdc++-v3/src/.libs"
}


Andreas


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