From 6cc118c05df96664ae6a5764bdc903e9ef5b4cd7 Mon Sep 17 00:00:00 2001 From: zrj Date: Sun, 2 Jul 2017 13:33:49 +0300 Subject: [PATCH] libstdcxx5: Fix profiled library creation. It was embedding archives within archives. Do not do it. For now created library is still partially profiled, some expansion to INTERNALLIB (like new INTERNALLIBPROF) handling will be needed. This is a partial fix to have c++ -pg working. While there, throw in ranlib for good measure. Reported-by: tuxillo --- gnu/lib/gcc50/libstdcxx/product/Makefile | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/gnu/lib/gcc50/libstdcxx/product/Makefile b/gnu/lib/gcc50/libstdcxx/product/Makefile index bffe636180..96013a8360 100644 --- a/gnu/lib/gcc50/libstdcxx/product/Makefile +++ b/gnu/lib/gcc50/libstdcxx/product/Makefile @@ -47,6 +47,14 @@ libstdc++.a: ${SRCS:.cc=.o} script.ar rm -f ${.TARGET} ${AR} -M < script.ar mv libstdcxx.a ${.TARGET} + ${RANLIB} ${.TARGET} + +libstdc++_p.a: ${SRCS:.cc=.po} script_p.ar + @${ECHO} building profiled ${LIB} library via script + rm -f ${.TARGET} + ${AR} -M < script_p.ar + mv libstdcxx_p.a ${.TARGET} + ${RANLIB} ${.TARGET} ${PROBLEMSXX}: ${PROBLEMS} cp ${SRCDIR}/src/c++11/${.TARGET:S|xx|++|} ${.TARGET} @@ -65,11 +73,23 @@ script.ar: @echo "SAVE" >> ${.TARGET} @echo "END" >> ${.TARGET} +# XXX for now no profiled CONVARCS libs +script_p.ar: + @echo "CREATE libstdcxx_p.a" > ${.TARGET} +.for arc in ${CONVARCS} + @echo "ADDLIB ${arc}" >> ${.TARGET} +.endfor +.for obj in ${SRCS:.cc=.po} + @echo "ADDMOD ${obj}" >> ${.TARGET} +.endfor + @echo "SAVE" >> ${.TARGET} + @echo "END" >> ${.TARGET} + libstdcxx.map: ${PREDIR}/gnu.ver ${PREDIR}/float128.ver cat ${.ALLSRC} | grep -E -v '^[ ]*#(#| |$)' | \ ${CC} -E -P -include ${.CURDIR}/../headers/config.h - > ${.TARGET} -GENFILES= gstdint.h script.ar ${PROBLEMSXX} libstdcxx.map +GENFILES= gstdint.h script.ar script_p.ar ${PROBLEMSXX} libstdcxx.map CLEANFILES= ${GENFILES} beforedepend: ${GENFILES} -- 2.11.4.GIT