[v3, libgomp, build] Fix Solaris symbol versioning (PR libstdc++/52188)

Rainer Orth ro@CeBiTec.Uni-Bielefeld.DE
Wed Feb 15 17:35:00 GMT 2012


Prompted by the suggestions in the PR what to do about the new exports
of 

_ZNSt19istreambuf_iteratorIcSt11char_traitsIcEEppEv
_ZNSt19istreambuf_iteratorIwSt11char_traitsIwEEppEv

at GLIBCXX_3.4.5 on Solaris, I've followed the preprocess *.ver files
route Jakub suggested to just omit those two on Solaris.

I considered several different preprocessors, but ultimately settled for
cpp/gcc -E:

* m4 is currently a developer-only requirement, and feels clumsy.

* Likewise for perl, which so far is only required for symbol versioning
  support on Solaris, but would now be required for every platform.

* Both options suffer from the requirement to provide at set of defines
  per target while some (like the current
  HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT) are already defined for
  cpp.  One should probably provide the components of the target triplet
  later, if need be.

Using cpp works fine after filtering out *.ver file comments that are
not cpp directives.  At the same time, it allowed to remove the hacky
#ifdef handling in make_sunver.pl or via sed.  The latter was handled by
the ENABLE_SYMVERS_SOL2 conditional so far, which can now go.

Since libgomp uses the same hack to handle
HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT, I applied the same solution
there, too.  There are two caveats:

* The preprocessed libgomp.map has to be called something else
  (libgomp.ver), otherwise make complains about a circular dependency
  between $(top_srcdir)/libgomp.map and libgomp.map.

* I need to remove the libtool-only -Wc, option from $(COMPILE),
  otherwise gcc -E complains.

Bootstrapped without regressions on {sparc-sun,i386-pc}-solaris2.{8, 9,
10, 11} with as/ld, gas/ld, gas/gld and x86_64-unknown-linux-gnu.  With
updates libstdc++ baselines, there are now errors and the undesired
symbols are gone, while on Linux/x86_64 there are no differences in the
readelf output from libstdc++-v3/scripts/extract_symvers.in without and
with the patch.

Ok for mainline?

	Rainer


2012-02-12  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	contrib:
	PR libstdc++/52188
	* make_sunver.pl: Remove #ifdef handling.

	libgomp:
	PR libstdc++/52188
	* acinclude.m4 (LIBGOMP_ENABLE_SYMVERS): Remove	symvers_renaming.
	Remove ENABLE_SYMVERS_SOL2.
	* configure: Regenerate.
	* Makefile.am [LIBGOMP_BUILD_VERSIONED_SHLIB] (comma): New variable.
	(PREPROCESS): New variable.
	(libgomp.ver): New target.
	[LIBGOMP_BUILD_VERSIONED_SHLIB &&
	LIBGOMP_BUILD_VERSIONED_SHLIB_GNU]: Remove
	LIBGOMP_BUILD_VERSIONED_SHLIB_SOL2 handling.
	Use libgomp.ver.
	[LIBGOMP_BUILD_VERSIONED_SHLIB_SUN]: Use libgomp.ver, libgomp.ver-sun.
	* Makefile.in: Regenerate.

	libstdc++-v3:
	PR libstdc++/52188
	* acinclude.m4 (GLIBCXX_ENABLE_SYMVERS): Remove symvers_renaming.
	Remove ENABLE_SYMVERS_SOL2.
	* configure: Regenerate.
	* src/Makefile.am [ENABLE_SYMVERS] (libstdc++-symbols.ver):
	Postprocess mapfile.
	[ENABLE_SYMVERS_GNU]: Remove ENABLE_SYMVERS_SOL2 handling.
	* src/Makefile.in: Regenerate.

	* config/abi/pre/gnu.ver (GLIBCXX_3.4.5) [!__sun__ && !__svr4__]:
	Don't export
	_ZNSt19istreambuf_iteratorI[cw]St11char_traitsI[cw]EEppEv.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: sol2-libstdc++-symver47.patch
Type: text/x-patch
Size: 7727 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20120215/48629847/attachment.bin>
-------------- next part --------------

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


More information about the Libstdc++ mailing list