patches/gcc/4.3.2/400-libgcc_eh.a.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jul 17 22:43:07 2011 +0200 (2011-07-17)
changeset 2893 a8a65758664f
permissions -rw-r--r--
cc/gcc: do not use the core pass-2 to build the baremetal compiler

In case we build a baremetal compiler, use the standard passes:
- core_cc is used to build the C library;
- as such, it is meant to run on build, not host;
- the final compiler is meant to run on host;

As the current final compiler step can not build a baremetal compiler,
call the core backend from the final step.

NB: Currently, newlib is built during the start_files pass, so we have
to have a core compiler by then... Once we can build the baremetal
compiler from the final cc step, then we can move the newlib build to
the proper step, and then get rid of the core pass-1 static compiler...

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
yann@2672
     1
Highly inspired by:
yann@2672
     2
  http://landley.net/hg/aboriginal/file/7e0747a665ab/sources/patches/gcc-core-libgcceh.patch
yann@2672
     3
yann@2672
     4
diff -durN gcc-4.3.2.orig//libgcc/Makefile.in gcc-4.3.2/libgcc/Makefile.in
yann@2672
     5
--- gcc-4.3.2.orig//libgcc/Makefile.in	2008-06-17 11:32:34.000000000 +0200
yann@2672
     6
+++ gcc-4.3.2/libgcc/Makefile.in	2011-09-02 12:27:39.296538955 +0200
yann@2672
     7
@@ -705,8 +705,9 @@
yann@2672
     8
 libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT)
yann@2672
     9
 endif
yann@2672
    10
 
yann@2672
    11
+all: libgcc_eh.a
yann@2672
    12
 ifeq ($(enable_shared),yes)
yann@2672
    13
-all: libgcc_eh.a libgcc_s$(SHLIB_EXT)
yann@2672
    14
+all: libgcc_s$(SHLIB_EXT)
yann@2672
    15
 ifneq ($(LIBUNWIND),)
yann@2672
    16
 all: libunwind$(SHLIB_EXT)
yann@2672
    17
 endif
yann@2672
    18
@@ -875,10 +876,6 @@
yann@2672
    19
 install-shared:
yann@2672
    20
 	$(mkinstalldirs) $(DESTDIR)$(inst_libdir)
yann@2672
    21
 
yann@2672
    22
-	$(INSTALL_DATA) libgcc_eh.a $(DESTDIR)$(inst_libdir)/
yann@2672
    23
-	chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a
yann@2672
    24
-	$(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a
yann@2672
    25
-
yann@2672
    26
 	$(subst @multilib_dir@,$(MULTIDIR),$(subst \
yann@2672
    27
 		@shlib_base_name@,libgcc_s,$(subst \
yann@2672
    28
 		@shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL))))
yann@2672
    29
@@ -893,6 +890,10 @@
yann@2672
    30
 	chmod 644 $(DESTDIR)$(inst_libdir)/libgcov.a
yann@2672
    31
 	$(RANLIB) $(DESTDIR)$(inst_libdir)/libgcov.a
yann@2672
    32
 
yann@2672
    33
+	$(INSTALL_DATA) libgcc_eh.a $(DESTDIR)$(inst_libdir)/
yann@2672
    34
+	chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a
yann@2672
    35
+	$(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a
yann@2672
    36
+
yann@2672
    37
 	parts="$(INSTALL_PARTS)";				\
yann@2672
    38
 	for file in $$parts; do					\
yann@2672
    39
 	  rm -f $(DESTDIR)$(inst_libdir)/$$file;		\