Index: c/src/lib/libbsp/hppa1.1/simhppa/bsp_specs
===================================================================
--- c/src/lib/libbsp/hppa1.1/simhppa/bsp_specs	(revision fc56b90cd329746caf6c97e11c2ccc9c2ff4cf70)
+++ c/src/lib/libbsp/hppa1.1/simhppa/bsp_specs	(revision a8589107785c5b00040955d03cfbfb75c7b6c658)
@@ -9,8 +9,12 @@
 
 *lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group -lrtemsall -lc -lgcc --end-group}
+%{!qrtems: %(old_lib)} %{qrtems: --start-group \
+%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
+-lc -lgcc --end-group}
 
 *startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: start.o%s}
+%{!qrtems: %(old_startfile)} %{qrtems: \
+%{!qrtems_debug: start.o%s} \
+%{qrtems_debug: start_g.o%s}}
 
 *link:
Index: c/src/lib/libbsp/i386/force386/bsp_specs
===================================================================
--- c/src/lib/libbsp/i386/force386/bsp_specs	(revision fc56b90cd329746caf6c97e11c2ccc9c2ff4cf70)
+++ c/src/lib/libbsp/i386/force386/bsp_specs	(revision a8589107785c5b00040955d03cfbfb75c7b6c658)
@@ -9,8 +9,13 @@
 
 *lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group -lrtemsall -lc -lgcc --end-group %{!qnolinkcmds: -T linkcmds%s}}
+%{!qrtems: %(old_lib)} %{qrtems: --start-group \
+%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
+-lc -lgcc --end-group \
+%{!qnolinkcmds: -T linkcmds%s}}
 
 *startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: start.o%s}
+%{!qrtems: %(old_startfile)} %{qrtems: \
+%{!qrtems_debug: start.o%s} \
+%{qrtems_debug: start_g.o%s}}
 
 *link:
Index: c/src/lib/libbsp/i386/i386ex/bsp_specs
===================================================================
--- c/src/lib/libbsp/i386/i386ex/bsp_specs	(revision fc56b90cd329746caf6c97e11c2ccc9c2ff4cf70)
+++ c/src/lib/libbsp/i386/i386ex/bsp_specs	(revision a8589107785c5b00040955d03cfbfb75c7b6c658)
@@ -9,8 +9,13 @@
 
 *lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group -lrtemsall -lc -lgcc --end-group %{!qnolinkcmds: -T linkcmds%s}}
+%{!qrtems: %(old_lib)} %{qrtems: --start-group \
+%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
+-lc -lgcc --end-group \
+%{!qnolinkcmds: -T linkcmds%s}}
 
 *startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: start.o%s}
+%{!qrtems: %(old_startfile)} %{qrtems: \
+%{!qrtems_debug: start.o%s} \
+%{qrtems_debug: start_g.o%s}}
 
 *link:
Index: c/src/lib/libbsp/i386/pc386/bsp_specs
===================================================================
--- c/src/lib/libbsp/i386/pc386/bsp_specs	(revision fc56b90cd329746caf6c97e11c2ccc9c2ff4cf70)
+++ c/src/lib/libbsp/i386/pc386/bsp_specs	(revision a8589107785c5b00040955d03cfbfb75c7b6c658)
@@ -9,8 +9,13 @@
 
 *lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group -lrtemsall -lc -lgcc --end-group %{!qnolinkcmds: -T linkcmds%s}}
+%{!qrtems: %(old_lib)} %{qrtems: --start-group \
+%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
+-lc -lgcc --end-group \
+%{!qnolinkcmds: -T linkcmds%s}}
 
 *startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: start.o%s}
+%{!qrtems: %(old_startfile)} %{qrtems: \
+%{!qrtems_debug: start.o%s} \
+%{qrtems_debug: start_g.o%s}}
 
 *link:
Index: c/src/lib/libbsp/i960/cvme961/bsp_specs
===================================================================
--- c/src/lib/libbsp/i960/cvme961/bsp_specs	(revision fc56b90cd329746caf6c97e11c2ccc9c2ff4cf70)
+++ c/src/lib/libbsp/i960/cvme961/bsp_specs	(revision a8589107785c5b00040955d03cfbfb75c7b6c658)
@@ -9,8 +9,13 @@
 
 *lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group -lrtemsall -lc -lgcc --end-group %{!qnolinkcmds: -T linkcmds%s}}
+%{!qrtems: %(old_lib)} %{qrtems: --start-group \
+%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
+-lc -lgcc --end-group \
+%{!qnolinkcmds: -T linkcmds%s}}
 
 *startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: start.o%s}
+%{!qrtems: %(old_startfile)} %{qrtems: \
+%{!qrtems_debug: start.o%s} \
+%{qrtems_debug: start_g.o%s}}
 
 *link:
Index: c/src/lib/libbsp/m68k/dmv152/bsp_specs
===================================================================
--- c/src/lib/libbsp/m68k/dmv152/bsp_specs	(revision fc56b90cd329746caf6c97e11c2ccc9c2ff4cf70)
+++ c/src/lib/libbsp/m68k/dmv152/bsp_specs	(revision a8589107785c5b00040955d03cfbfb75c7b6c658)
@@ -9,8 +9,13 @@
 
 *lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group -lrtemsall -lc -lgcc --end-group %{!qnolinkcmds: -T linkcmds%s}}
+%{!qrtems: %(old_lib)} %{qrtems: --start-group \
+%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
+-lc -lgcc --end-group \
+%{!qnolinkcmds: -T linkcmds%s}}
 
 *startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: start.o%s}
+%{!qrtems: %(old_startfile)} %{qrtems: \
+%{!qrtems_debug: start.o%s} \
+%{qrtems_debug: start_g.o%s}}
 
 *link:
Index: c/src/lib/libbsp/m68k/efi332/bsp_specs
===================================================================
--- c/src/lib/libbsp/m68k/efi332/bsp_specs	(revision fc56b90cd329746caf6c97e11c2ccc9c2ff4cf70)
+++ c/src/lib/libbsp/m68k/efi332/bsp_specs	(revision a8589107785c5b00040955d03cfbfb75c7b6c658)
@@ -9,8 +9,13 @@
 
 *lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group -lrtemsall -lc -lgcc --end-group %{!qnolinkcmds: -T linkcmds%s}}
+%{!qrtems: %(old_lib)} %{qrtems: --start-group \
+%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
+-lc -lgcc --end-group \
+%{!qnolinkcmds: -T linkcmds%s}}
 
 *startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: start332.o%s}
+%{!qrtems: %(old_startfile)} %{qrtems: \
+%{!qrtems_debug: start332.o%s} \
+%{qrtems_debug: start332_g.o%s}}
 
 *link:
Index: c/src/lib/libbsp/m68k/efi68k/bsp_specs
===================================================================
--- c/src/lib/libbsp/m68k/efi68k/bsp_specs	(revision fc56b90cd329746caf6c97e11c2ccc9c2ff4cf70)
+++ c/src/lib/libbsp/m68k/efi68k/bsp_specs	(revision a8589107785c5b00040955d03cfbfb75c7b6c658)
@@ -9,8 +9,13 @@
 
 *lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group -lrtemsall -lc -lgcc --end-group %{!qnolinkcmds: -T linkcmds%s}}
+%{!qrtems: %(old_lib)} %{qrtems: --start-group \
+%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
+-lc -lgcc --end-group \
+%{!qnolinkcmds: -T linkcmds%s}}
 
 *startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: start68k.o%s}
+%{!qrtems: %(old_startfile)} %{qrtems: \
+%{!qrtems_debug: start68k.o%s} \
+%{qrtems_debug: start68k_g.o%s}}
 
 *link:
Index: c/src/lib/libbsp/m68k/gen68302/bsp_specs
===================================================================
--- c/src/lib/libbsp/m68k/gen68302/bsp_specs	(revision fc56b90cd329746caf6c97e11c2ccc9c2ff4cf70)
+++ c/src/lib/libbsp/m68k/gen68302/bsp_specs	(revision a8589107785c5b00040955d03cfbfb75c7b6c658)
@@ -9,8 +9,13 @@
 
 *lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group -lrtemsall -lc -lgcc --end-group %{!qnolinkcmds: -T linkcmds%s}}
+%{!qrtems: %(old_lib)} %{qrtems: --start-group \
+%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
+-lc -lgcc --end-group \
+%{!qnolinkcmds: -T linkcmds%s}}
 
 *startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: start302.o%s}
+%{!qrtems: %(old_startfile)} %{qrtems: \
+%{!qrtems_debug: start302.o%s} \
+%{qrtems_debug: start302_g.o%s}}
 
 *link:
Index: c/src/lib/libbsp/m68k/gen68360/bsp_specs
===================================================================
--- c/src/lib/libbsp/m68k/gen68360/bsp_specs	(revision fc56b90cd329746caf6c97e11c2ccc9c2ff4cf70)
+++ c/src/lib/libbsp/m68k/gen68360/bsp_specs	(revision a8589107785c5b00040955d03cfbfb75c7b6c658)
@@ -9,8 +9,13 @@
 
 *lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group -lrtemsall -lc -lgcc --end-group %{!qnolinkcmds: -T linkcmds%s}}
+%{!qrtems: %(old_lib)} %{qrtems: --start-group \
+%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
+-lc -lgcc --end-group \
+%{!qnolinkcmds: -T linkcmds%s}}
 
 *startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: start360.o%s}
+%{!qrtems: %(old_startfile)} %{qrtems: \
+%{!qrtems_debug: start360.o%s} \
+%{qrtems_debug: start360_g.o%s}}
 
 *link:
Index: c/src/lib/libbsp/m68k/idp/bsp_specs
===================================================================
--- c/src/lib/libbsp/m68k/idp/bsp_specs	(revision fc56b90cd329746caf6c97e11c2ccc9c2ff4cf70)
+++ c/src/lib/libbsp/m68k/idp/bsp_specs	(revision a8589107785c5b00040955d03cfbfb75c7b6c658)
@@ -9,8 +9,13 @@
 
 *lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group -lrtemsall -lc -lgcc --end-group %{!qnolinkcmds: -T linkcmds%s}}
+%{!qrtems: %(old_lib)} %{qrtems: --start-group \
+%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
+-lc -lgcc --end-group \
+%{!qnolinkcmds: -T linkcmds%s}}
 
 *startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: start.o%s}
+%{!qrtems: %(old_startfile)} %{qrtems: \
+%{!qrtems_debug: start.o%s} \
+%{qrtems_debug: start_g.o%s}}
 
 *link:
Index: c/src/lib/libbsp/m68k/mvme136/bsp_specs
===================================================================
--- c/src/lib/libbsp/m68k/mvme136/bsp_specs	(revision fc56b90cd329746caf6c97e11c2ccc9c2ff4cf70)
+++ c/src/lib/libbsp/m68k/mvme136/bsp_specs	(revision a8589107785c5b00040955d03cfbfb75c7b6c658)
@@ -9,8 +9,13 @@
 
 *lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group -lrtemsall -lc -lgcc --end-group %{!qnolinkcmds: -T linkcmds%s}}
+%{!qrtems: %(old_lib)} %{qrtems: --start-group \
+%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
+-lc -lgcc --end-group \
+%{!qnolinkcmds: -T linkcmds%s}}
 
 *startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: start.o%s}
+%{!qrtems: %(old_startfile)} %{qrtems: \
+%{!qrtems_debug: start.o%s} \
+%{qrtems_debug: start_g.o%s}}
 
 *link:
Index: c/src/lib/libbsp/m68k/mvme147/bsp_specs
===================================================================
--- c/src/lib/libbsp/m68k/mvme147/bsp_specs	(revision fc56b90cd329746caf6c97e11c2ccc9c2ff4cf70)
+++ c/src/lib/libbsp/m68k/mvme147/bsp_specs	(revision a8589107785c5b00040955d03cfbfb75c7b6c658)
@@ -9,8 +9,13 @@
 
 *lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group -lrtemsall -lc -lgcc --end-group %{!qnolinkcmds: -T linkcmds%s}}
+%{!qrtems: %(old_lib)} %{qrtems: --start-group \
+%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
+-lc -lgcc --end-group \
+%{!qnolinkcmds: -T linkcmds%s}}
 
 *startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: start.o%s}
+%{!qrtems: %(old_startfile)} %{qrtems: \
+%{!qrtems_debug: start.o%s} \
+%{qrtems_debug: start_g.o%s}}
 
 *link:
Index: c/src/lib/libbsp/m68k/mvme147s/bsp_specs
===================================================================
--- c/src/lib/libbsp/m68k/mvme147s/bsp_specs	(revision fc56b90cd329746caf6c97e11c2ccc9c2ff4cf70)
+++ c/src/lib/libbsp/m68k/mvme147s/bsp_specs	(revision a8589107785c5b00040955d03cfbfb75c7b6c658)
@@ -9,8 +9,13 @@
 
 *lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group -lrtemsall -lc -lgcc --end-group %{!qnolinkcmds: -T linkcmds%s}}
+%{!qrtems: %(old_lib)} %{qrtems: --start-group \
+%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
+-lc -lgcc --end-group \
+%{!qnolinkcmds: -T linkcmds%s}}
 
 *startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: start.o%s}
+%{!qrtems: %(old_startfile)} %{qrtems: \
+%{!qrtems_debug: start.o%s} \
+%{qrtems_debug: start_g.o%s}}
 
 *link:
Index: c/src/lib/libbsp/m68k/mvme162/bsp_specs
===================================================================
--- c/src/lib/libbsp/m68k/mvme162/bsp_specs	(revision fc56b90cd329746caf6c97e11c2ccc9c2ff4cf70)
+++ c/src/lib/libbsp/m68k/mvme162/bsp_specs	(revision a8589107785c5b00040955d03cfbfb75c7b6c658)
@@ -8,9 +8,17 @@
 %(old_cpp) %{qrtems: -D__embedded__} -Asystem(embedded)
 
+*link:
+%{!qrtems: %(old_link)} %{qrtems: -dc -dp -N -e start}
+
 *lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group -lrtemsall -lc -lgcc --end-group %{!qnolinkcmds: -T linkcmds%s}}
+%{!qrtems: %(old_lib)} %{qrtems: --start-group \
+%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
+-lc -lgcc --end-group \
+%{!qnolinkcmds: -T linkcmds%s}}
 
 *startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: start.o%s} 
+%{!qrtems: %(old_startfile)} %{qrtems: \
+%{!qrtems_debug: start.o%s} \
+%{qrtems_debug: start_g.o%s}}
 
 *link:
Index: c/src/lib/libbsp/m68k/ods68302/bsp_specs
===================================================================
--- c/src/lib/libbsp/m68k/ods68302/bsp_specs	(revision fc56b90cd329746caf6c97e11c2ccc9c2ff4cf70)
+++ c/src/lib/libbsp/m68k/ods68302/bsp_specs	(revision a8589107785c5b00040955d03cfbfb75c7b6c658)
@@ -9,8 +9,13 @@
 
 *lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group -lrtemsall -lc -lgcc --end-group %{!qnolinkcmds: -T linkcmds%s}}
+%{!qrtems: %(old_lib)} %{qrtems: --start-group \
+%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
+-lc -lgcc --end-group \
+%{!qnolinkcmds: -T linkcmds%s}}
 
 *startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: start302.o%s} 
+%{!qrtems: %(old_startfile)} %{qrtems: \
+%{!qrtems_debug: start302.o%s} \
+%{qrtems_debug: start302_g.o%s}}
 
 *link:
Index: c/src/lib/libbsp/mips/p4000/bsp_specs
===================================================================
--- c/src/lib/libbsp/mips/p4000/bsp_specs	(revision fc56b90cd329746caf6c97e11c2ccc9c2ff4cf70)
+++ c/src/lib/libbsp/mips/p4000/bsp_specs	(revision a8589107785c5b00040955d03cfbfb75c7b6c658)
@@ -9,8 +9,13 @@
 
 *lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group -lrtemsall -lc -lgcc --end-group %{!qnolinkcmds: -T linkcmds%s}}
+%{!qrtems: %(old_lib)} %{qrtems: --start-group \
+%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
+-lc -lgcc --end-group \
+%{!qnolinkcmds: -T linkcmds%s}}
 
 *startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: idt_csu.o%s}
+%{!qrtems: %(old_startfile)} %{qrtems: \
+%{!qrtems_debug: idt_csu.o%s} \
+%{qrtems_debug: idt_csu_g.o%s}}
 
 *link:
Index: c/src/lib/libbsp/mips64orion/p4000/bsp_specs
===================================================================
--- c/src/lib/libbsp/mips64orion/p4000/bsp_specs	(revision fc56b90cd329746caf6c97e11c2ccc9c2ff4cf70)
+++ c/src/lib/libbsp/mips64orion/p4000/bsp_specs	(revision a8589107785c5b00040955d03cfbfb75c7b6c658)
@@ -9,8 +9,13 @@
 
 *lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group -lrtemsall -lc -lgcc --end-group %{!qnolinkcmds: -T linkcmds%s}}
+%{!qrtems: %(old_lib)} %{qrtems: --start-group \
+%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
+-lc -lgcc --end-group \
+%{!qnolinkcmds: -T linkcmds%s}}
 
 *startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: idt_csu.o%s}
+%{!qrtems: %(old_startfile)} %{qrtems: \
+%{!qrtems_debug: idt_csu.o%s} \
+%{qrtems_debug: idt_csu_g.o%s}}
 
 *link:
Index: c/src/lib/libbsp/powerpc/papyrus/bsp_specs
===================================================================
--- c/src/lib/libbsp/powerpc/papyrus/bsp_specs	(revision fc56b90cd329746caf6c97e11c2ccc9c2ff4cf70)
+++ c/src/lib/libbsp/powerpc/papyrus/bsp_specs	(revision a8589107785c5b00040955d03cfbfb75c7b6c658)
@@ -9,8 +9,13 @@
 
 *lib:
-%{!qrtems: %(old_lib)} %{qrtems: ecrti%O%s --start-group -lrtemsall -lc -lgcc --end-group %{!qnolinkcmds: -T linkcmds%s}}
+%{!qrtems: %(old_lib)} %{qrtems: ecrti%O%s --start-group \
+%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
+-lc -lgcc --end-group \
+%{!qnolinkcmds: -T linkcmds%s}}
 
 *startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: }
+%{!qrtems: %(old_startfile)} %{qrtems: \
+%{!qrtems_debug: } \
+%{qrtems_debug: }}
 
 *link:
Index: c/src/lib/libbsp/sparc/erc32/bsp_specs
===================================================================
--- c/src/lib/libbsp/sparc/erc32/bsp_specs	(revision fc56b90cd329746caf6c97e11c2ccc9c2ff4cf70)
+++ c/src/lib/libbsp/sparc/erc32/bsp_specs	(revision a8589107785c5b00040955d03cfbfb75c7b6c658)
@@ -9,8 +9,13 @@
 
 *lib:
-%{!qrtems: %(old_lib)} %{qrtems: --start-group -lrtemsall -lc -lgcc --end-group %{!qnolinkcmds: -T linkcmds%s}}
+%{!qrtems: %(old_lib)} %{qrtems: --start-group \
+%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
+-lc -lgcc --end-group \
+%{!qnolinkcmds: -T linkcmds%s}}
 
 *startfile:
-%{!qrtems: %(old_startfile)} %{qrtems: startsis.o%s}
+%{!qrtems: %(old_startfile)} %{qrtems: \
+%{!qrtems_debug: startsis.o%s} \
+%{qrtems_debug: startsis_g.o%s}}
 
 *link:
Index: c/src/make/compilers/gcc-target-default.cfg
===================================================================
--- c/src/make/compilers/gcc-target-default.cfg	(revision fc56b90cd329746caf6c97e11c2ccc9c2ff4cf70)
+++ c/src/make/compilers/gcc-target-default.cfg	(revision a8589107785c5b00040955d03cfbfb75c7b6c658)
@@ -71,4 +71,8 @@
 # debug flag; typically -g
 CFLAGS_DEBUG_V+=-g -Wno-unused
+
+ifeq ($(RTEMS_USE_GCC272),no)
+CFLAGS_DEBUG_V+=-qrtems_debug
+endif
 
 # when debugging, optimize flag: typically empty
