Okay, here's a patch against 4.8.1-4 that seems to work to split out the debug symbols. I'm not sure why you want this, though: it doesn't seem terribly important to be able to install a debug version of libstdc++ that from a different gcc-X.Y, and it makes the packaging just that much messier ...
Unfortunately, it doesn't allow installing libstdc++6-dbg and libstdc++6-4.8-dbg at the same time, since I don't know what version to add to the relevant Conflicts. (It might also need some replaces?) I really recommend taking the other approach instead.
diff -u gcc-4.8-4.8.1/debian/control.m4 gcc-4.8-4.8.1/debian/control.m4 --- gcc-4.8-4.8.1/debian/control.m4 +++ gcc-4.8-4.8.1/debian/control.m4 @@ -3348,6 +3348,21 @@ This package contains files for TARGET architecture, for use in cross-compile environment. ')`'dnl + +Package: libstdc++CXX_SO-dbg`'LS +Architecture: ifdef(`TARGET',`CROSS_ARCH',`any') +Section: debug +Priority: extra +Depends: BASEDEP, libdep(stdc++CXX_SO,), libdbgdep(gcc`'GCC_SO-dbg,,>=,${libgcc:Version}), ${shlibs:Depends}, ${misc:Depends} +ifdef(`MULTIARCH', `Multi-Arch: same +')BUILT_USING`'dnl +Description: GNU Standard C++ Library v3 (debug symbols)`'ifdef(`TARGET)',` (TARGET)', `') + This package contains debug symbols for the libstdc++ shared library. +ifdef(`TARGET', `dnl + . + This package contains files for TARGET architecture, for use in cross-compile + environment. +')`'dnl ')`'dnl libcxx ifenabled(`lib32cxx',` @@ -3368,6 +3383,20 @@ This package contains files for TARGET architecture, for use in cross-compile environment. ')`'dnl + +Package: lib32stdc++CXX_SO-dbg`'LS +Architecture: ifdef(`TARGET',`CROSS_ARCH',`biarch32_archs') +Section: debug +Priority: extra +Depends: BASEDEP, libdep(stdc++CXX_SO,32), libdbgdep(gcc`'GCC_SO-dbg,32,>=,${libgcc:Version}), ${shlibs:Depends}, ${misc:Depends} +BUILT_USING`'dnl +Description: GNU Standard C++ Library v3 (32-bit debug symbols)`'ifdef(`TARGET)',` (TARGET)', `') + This package contains debug symbols for the libstdc++ shared library. +ifdef(`TARGET', `dnl + . + This package contains files for TARGET architecture, for use in cross-compile + environment. +')`'dnl ')`'dnl lib32cxx ifenabled(`lib64cxx',` @@ -3391,6 +3420,20 @@ This package contains files for TARGET architecture, for use in cross-compile environment. ')`'dnl + +Package: lib64stdc++CXX_SO-dbg`'LS +Architecture: ifdef(`TARGET',`CROSS_ARCH',`biarch64_archs') +Section: debug +Priority: extra +Depends: BASEDEP, libdep(stdc++CXX_SO,64), libdbgdep(gcc`'GCC_SO-dbg,64,>=,${libgcc:Version}), ${shlibs:Depends}, ${misc:Depends} +BUILT_USING`'dnl +Description: GNU Standard C++ Library v3 (64-bit debug symbols)`'ifdef(`TARGET)',` (TARGET)', `') + This package contains debug symbols for the libstdc++ shared library. +ifdef(`TARGET', `dnl + . + This package contains files for TARGET architecture, for use in cross-compile + environment. +')`'dnl ')`'dnl lib64cxx ifenabled(`libn32cxx',` @@ -3414,6 +3457,20 @@ This package contains files for TARGET architecture, for use in cross-compile environment. ')`'dnl + +Package: libn32stdc++CXX_SO-dbg`'LS +Architecture: ifdef(`TARGET',`CROSS_ARCH',`biarchn32_archs') +Section: debug +Priority: extra +Depends: BASEDEP, libdep(stdc++CXX_SO,n32), libdbgdep(gcc`'GCC_SO-dbg,n32,>=,${libgcc:Version}), ${shlibs:Depends}, ${misc:Depends} +BUILT_USING`'dnl +Description: GNU Standard C++ Library v3 (n32 debug symbols)`'ifdef(`TARGET)',` (TARGET)', `') + This package contains debug symbols for the libstdc++ shared library. +ifdef(`TARGET', `dnl + . + This package contains files for TARGET architecture, for use in cross-compile + environment. +')`'dnl ')`'dnl libn32cxx ifenabled(`libx32cxx',` @@ -3437,6 +3494,20 @@ This package contains files for TARGET architecture, for use in cross-compile environment. ')`'dnl + +Package: libx32stdc++CXX_SO-dbg`'LS +Architecture: ifdef(`TARGET',`CROSS_ARCH',`biarchx32_archs') +Section: debug +Priority: extra +Depends: BASEDEP, libdep(stdc++CXX_SO,x32), libdbgdep(gcc`'GCC_SO-dbg,x32,>=,${libgcc:Version}), ${shlibs:Depends}, ${misc:Depends} +BUILT_USING`'dnl +Description: GNU Standard C++ Library v3 (x32 debug symbols)`'ifdef(`TARGET)',` (TARGET)', `') + This package contains debug symbols for the libstdc++ shared library. +ifdef(`TARGET', `dnl + . + This package contains files for TARGET architecture, for use in cross-compile + environment. +')`'dnl ')`'dnl libx32cxx ifenabled(`libhfcxx',` @@ -3461,6 +3532,20 @@ This package contains files for TARGET architecture, for use in cross-compile environment. ')`'dnl + +Package: libhfstdc++CXX_SO-dbg`'LS +Architecture: ifdef(`TARGET',`CROSS_ARCH',`biarchhf_archs') +Section: debug +Priority: extra +Depends: BASEDEP, libdep(stdc++CXX_SO,hf), libdbgdep(gcc`'GCC_SO-dbg,hf,>=,${libgcc:Version}), ${shlibs:Depends}, ${misc:Depends} +BUILT_USING`'dnl +Description: GNU Standard C++ Library v3 (hard float debug symbols)`'ifdef(`TARGET)',` (TARGET)', `') + This package contains debug symbols for the libstdc++ shared library. +ifdef(`TARGET', `dnl + . + This package contains files for TARGET architecture, for use in cross-compile + environment. +')`'dnl ')`'dnl libhfcxx ifenabled(`libsfcxx',` @@ -3483,6 +3568,20 @@ ifdef(`TARGET', `dnl . This package contains files for TARGET architecture, for use in cross-compile + environment. +')`'dnl + +Package: libsfstdc++CXX_SO-dbg`'LS +Architecture: ifdef(`TARGET',`CROSS_ARCH',`biarchsf_archs') +Section: debug +Priority: extra +Depends: BASEDEP, libdep(stdc++CXX_SO,sf), libdbgdep(gcc`'GCC_SO-dbg,sf,>=,${libgcc:Version}), ${shlibs:Depends}, ${misc:Depends} +BUILT_USING`'dnl +Description: GNU Standard C++ Library v3 (soft float debug symbols)`'ifdef(`TARGET)',` (TARGET)', `') + This package contains debug symbols for the libstdc++ shared library. +ifdef(`TARGET', `dnl + . + This package contains files for TARGET architecture, for use in cross-compile environment. ')`'dnl ')`'dnl libsfcxx diff -u gcc-4.8-4.8.1/debian/rules.d/binary-libstdcxx.mk gcc-4.8-4.8.1/debian/rules.d/binary-libstdcxx.mk --- gcc-4.8-4.8.1/debian/rules.d/binary-libstdcxx.mk +++ gcc-4.8-4.8.1/debian/rules.d/binary-libstdcxx.mk @@ -75,6 +75,7 @@ p_libsf = libsfstdc++$(CXX_SONAME)$(cross_lib_arch) p_dev = libstdc++$(libstdc_ext)-dev$(cross_lib_arch) p_pic = libstdc++$(libstdc_ext)-pic$(cross_lib_arch) +p_dbgsym= libstdc++$(CXX_SONAME)-dbg$(cross_lib_arch) p_dbg = libstdc++$(CXX_SONAME)$(libstdc_ext)-dbg$(cross_lib_arch) p_dbg64 = lib64stdc++$(CXX_SONAME)$(libstdc_ext)-dbg$(cross_lib_arch) p_dbg32 = lib32stdc++$(CXX_SONAME)$(libstdc_ext)-dbg$(cross_lib_arch) @@ -93,6 +94,7 @@ d_libsf = debian/$(p_libsf) d_dev = debian/$(p_dev) d_pic = debian/$(p_pic) +d_dbgsym= debian/$(p_dbgsym) d_dbg = debian/$(p_dbg) d_dbg64 = debian/$(p_dbg64) d_dbg32 = debian/$(p_dbg32) @@ -126,9 +128,11 @@ files_dbg = \ $(usr_lib)/debug/libstdc++.{a,so*} +dirs_dbgsym = $(usr_lib) +files_dbgsym = ifneq ($(DEB_CROSS),yes) - dirs_dbg += $(PF)/share/gcc-$(BASE_VERSION)/python - files_dbg += $(PF)/share/gcc-$(BASE_VERSION)/python/libstdcxx + dirs_dbgsym += $(PF)/share/gcc-$(BASE_VERSION)/python + files_dbgsym += $(PF)/share/gcc-$(BASE_VERSION)/python/libstdcxx endif dirs_pic = \ @@ -192,7 +196,7 @@ debian/dh_doclink -p$(p_l) $(p_base) debian/dh_rmemptydirs -p$(p_l) - dh_strip -p$(p_l) --dbg-package=$(1)-$(BASE_VERSION)-dbg$(cross_lib_arch) + dh_strip -p$(p_l) --dbg-package=$(1)-dbg$(cross_lib_arch) dh_compress -p$(p_l) dh_fixperms -p$(p_l) @@ -211,7 +215,7 @@ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp) endef -define __do_libstdcxx_dbg +define __do_libstdcxx_dbgsym dh_testdir dh_testroot mv $(install_stamp) $(install_stamp)-tmp @@ -235,6 +239,34 @@ rm -f $(d_d)/$(usr_lib$(2))/libstdc++.so.*[0-9] ) + $(ignshld)DIRNAME=$(subst n,,$(2)) $(cross_shlibdeps) dh_shlibdeps -p$(p_d) \ + $(call shlibdirs_to_search,$(subst $(pkg_ver),,$(subst stdc++$(CXX_SONAME),gcc$(GCC_SONAME),$(p_l))),$(2)) + $(call cross_mangle_substvars,$(p_d)) + + debian/dh_doclink -p$(p_d) $(p_base) + debian/dh_rmemptydirs -p$(p_d) + + dh_compress -p$(p_d) + dh_fixperms -p$(p_d) + $(cross_gencontrol) dh_gencontrol -p$(p_d) -- -v$(DEB_VERSION) $(common_substvars) + $(call cross_mangle_control,$(p_d)) + + dh_installdeb -p$(p_d) + dh_md5sums -p$(p_d) + dh_builddeb -p$(p_d) + + trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp) +endef + +define __do_libstdcxx_dbg + dh_testdir + dh_testroot + mv $(install_stamp) $(install_stamp)-tmp + + rm -rf $(d_d) + dh_installdirs -p$(p_d) \ + $(usr_lib$(2)) + $(if $(filter yes,$(with_debug)), mv $(d)/$(usr_lib$(2))/debug $(d_d)/$(usr_lib$(2))/.; rm -f $(d_d)/$(usr_lib$(2))/debug/libstdc++_pic.a @@ -292,7 +324,10 @@ endef do_libstdcxx = $(call __do_libstdcxx,lib$(1)stdc++$(CXX_SONAME),$(1)) -do_libstdcxx_dbg = $(call __do_libstdcxx_dbg,lib$(1)stdc++$(CXX_SONAME)$(libstdc_ext),$(1)) +define do_libstdcxx_dbg + $(call __do_libstdcxx_dbgsym,lib$(1)stdc++$(CXX_SONAME),$(1)) + $(call __do_libstdcxx_dbg,lib$(1)stdc++$(CXX_SONAME)$(libstdc_ext),$(1)) +endef do_libstdcxx_dev = $(call __do_libstdcxx_dev,lib$(1)stdc++-$(BASE_VERSION)-dev,$(1)) # ---------------------------------------------------------------------- @@ -369,6 +404,7 @@ rm -rf $(d_dev) $(d_pic) dh_installdirs -p$(p_dev) $(dirs_dev) dh_installdirs -p$(p_pic) $(dirs_pic) + dh_installdirs -p$(p_dbgsym) $(dirs_dbgsym) dh_installdirs -p$(p_dbg) $(dirs_dbg) : # - correct libstdc++-v3 file locations @@ -390,6 +426,7 @@ DH_COMPAT=2 dh_movefiles -p$(p_dev) $(files_dev) DH_COMPAT=2 dh_movefiles -p$(p_pic) $(files_pic) + DH_COMPAT=2 dh_movefiles -p$(p_dbgsym) $(files_dbgsym) ifeq ($(with_debug),yes) DH_COMPAT=2 dh_movefiles -p$(p_dbg) $(files_dbg) endif @@ -402,6 +439,7 @@ debian/dh_doclink -p$(p_dev) $(p_base) debian/dh_doclink -p$(p_pic) $(p_base) debian/dh_doclink -p$(p_dbg) $(p_base) + debian/dh_doclink -p$(p_dbgsym) $(p_base) cp -p $(srcdir)/libstdc++-v3/ChangeLog \ $(d_dev)/$(docdir)/$(p_base)/C++/changelog.libstdc++ ifeq ($(with_check),yes) @@ -417,43 +455,44 @@ $(d_pic)/$(gcc_lib_dir)/libstdc++_pic.map cp -p $(d)/$(usr_lib)/libstdc++.so.*.py \ - $(d_dbg)/$(PF)/lib/debug/$(usr_lib)/ + $(d_dbgsym)/$(PF)/lib/debug/$(usr_lib)/ ifeq ($(with_libcxx),yes) cp -a $(d)/$(usr_lib)/libstdc++.so.*[0-9] \ - $(d_dbg)/$(usr_lib)/ - dh_strip -p$(p_dbg) --keep-debug - rm -f $(d_dbg)/$(usr_lib)/libstdc++.so.*[0-9] + $(d_dbgsym)/$(usr_lib)/ + dh_strip -p$(p_dbgsym) --keep-debug + rm -f $(d_dbgsym)/$(usr_lib)/libstdc++.so.*[0-9] endif - dh_strip -p$(p_dev) --dbg-package=$(p_dbg) + dh_strip -p$(p_dev) --dbg-package=$(p_dbgsym) ifneq ($(with_common_libs),yes) : # remove the debug symbols for libstdc++ built by a newer version of GCC - rm -rf $(d_dbg)/usr/lib/debug/$(PF) + rm -rf $(d_dbgsym)/usr/lib/debug/$(PF) endif dh_strip -p$(p_pic) ifeq ($(with_cxxdev),yes) debian/dh_rmemptydirs -p$(p_dev) debian/dh_rmemptydirs -p$(p_pic) + debian/dh_rmemptydirs -p$(p_dbgsym) debian/dh_rmemptydirs -p$(p_dbg) endif - dh_compress -p$(p_dev) -p$(p_pic) -p$(p_dbg) -X.txt - dh_fixperms -p$(p_dev) -p$(p_pic) -p$(p_dbg) + dh_compress -p$(p_dev) -p$(p_pic) -p$(p_dbgsym) -p$(p_dbg) -X.txt + dh_fixperms -p$(p_dev) -p$(p_pic) -p$(p_dbgsym) -p$(p_dbg) # XXX: what about biarchn32? #ifeq ($(biarch64),yes) # $(ignshld)DIRNAME=$(subst n,,$(2)) $(cross_shlibdeps) dh_shlibdeps -p$(p_dev) -p$(p_pic) -p$(p_dbg) -Xlib64 #else # $(ignshld)DIRNAME=$(subst n,,$(2)) $(cross_shlibdeps) dh_shlibdeps -p$(p_dev) -p$(p_pic) -p$(p_dbg) -Xlib32/debug #endif - $(ignshld)DIRNAME=$(subst n,,$(2)) $(cross_shlibdeps) dh_shlibdeps -p$(p_dev) -p$(p_pic) -p$(p_dbg) + $(ignshld)DIRNAME=$(subst n,,$(2)) $(cross_shlibdeps) dh_shlibdeps -p$(p_dev) -p$(p_pic) -p$(p_dbgsym) $(p_dbg) $(call cross_mangle_substvars,$(p_dbg)) - $(cross_gencontrol) dh_gencontrol -p$(p_dev) -p$(p_pic) -p$(p_dbg) \ + $(cross_gencontrol) dh_gencontrol -p$(p_dev) -p$(p_pic) -p$(p_dbgsym) -p$(p_dbg) \ -- -v$(DEB_VERSION) $(common_substvars) - dh_installdeb -p$(p_dev) -p$(p_pic) -p$(p_dbg) - dh_md5sums -p$(p_dev) -p$(p_pic) -p$(p_dbg) - dh_builddeb -p$(p_dev) -p$(p_pic) -p$(p_dbg) + dh_installdeb -p$(p_dev) -p$(p_pic) -p$(p_dbgsym) -p$(p_dbg) + dh_md5sums -p$(p_dev) -p$(p_pic) -p$(p_dbgsym) -p$(p_dbg) + dh_builddeb -p$(p_dev) -p$(p_pic) -p$(p_dbgsym) -p$(p_dbg) trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
-- Hi! I'm a .signature virus! Copy me into your ~/.signature to help me spread!