Thursday, 29 October 2015

Re: [gccsdk] cross-compiling using gcc5 on the host 1

--- Makefile 2015-10-28 10:05:44.839970500 +0000
+++ Makefile.fixed 2015-10-28 10:07:54.000000000 +0000
@@ -220,6 +220,7 @@
-rm -rf $(BUILDDIR) $(BUILDSTEPSDIR) $(SRCDIR) $(GCCSDK_CROSS_PREFIX) $(GCCSDK_RISCOS_PREFIX)
-svn revert -R $(SRCORIGDIR)/gcc-trunk
-svn status $(SRCORIGDIR)/gcc-trunk | grep -E "^?" | cut -b 9- | xargs rm -rf
+ cd $(SRCORIGDIR)/gcc-trunk && find -regex ".*\.\(c\|C\|h\)" -not -path '^\.' -type f -exec sed -i 's/__FUNCTION__/__func__/g' {} \;
for i in . riscos/asasm riscos/asasm/decaof/ riscos/asasm/elftoolchain/ ; do svn status --no-ignore $$i | grep "^I " | cut -b 9- | grep -v -E "^(gccsdk-params|srcdir\.orig|release-area)$$" | xargs rm -rf ; done

# Return to a state for doing a full fresh cross build (using the current binutils/gcc sources).
@@ -242,6 +243,7 @@
-svn revert -R $(SRCORIGDIR)/gcc-trunk
-svn status $(SRCORIGDIR)/gcc-trunk | grep -E "^?" | cut -b 9- | xargs rm -rf
cd $(SRCORIGDIR)/gcc-trunk && ./contrib/gcc_update
+ cd $(SRCORIGDIR)/gcc-trunk && find -regex ".*\.\(c\|C\|h\)" -not -path '^\.' -type f -exec sed -i 's/__FUNCTION__/__func__/g' {} \;
else
@echo "Makefile target updategcc is only supported when GCC sources are fetched from the GCC source control system."
endif
@@ -542,6 +544,7 @@
-rm -rf $(SRCDIR)/gcc
-svn revert -R $(SRCORIGDIR)/gcc-trunk
-svn status $(SRCORIGDIR)/gcc-trunk | grep -E "^?" | cut -b 9- | xargs rm -rf
+ cd $(SRCORIGDIR)/gcc-trunk && find -regex ".*\.\(c\|C\|h\)" -not -path '^\.' -type f -exec sed -i 's/__FUNCTION__/__func__/g' {} \;
ln -s $(SRCORIGDIR)/gcc-trunk $(SRCDIR)/gcc
else
src-gcc-copied: $(SRCORIGDIR)/gcc-$(GCC_VERSION).tar.bz2
@@ -686,6 +689,7 @@
-mkdir -p $(SRCORIGDIR)
cd $(SRCORIGDIR) && svn co svn://gcc.gnu.org/svn/gcc/$(GCC_SCM_PATH) gcc-trunk
cd $(SRCORIGDIR)/gcc-trunk && ./contrib/gcc_update
+ cd $(SRCORIGDIR)/gcc-trunk && find -regex ".*\.\(c\|C\|h\)" -not -path '^\.' -type f -exec sed -i 's/__FUNCTION__/__func__/g' {} \;
else
# Download gcc source:
$(SRCORIGDIR)/gcc-$(GCC_VERSION).tar.bz2:

<snip>
I have done this with a patch to the gcc4/Makefile. This is a sledgehammer as the gcc build tree appears to use the old format in many places.

Yes, a real sledgehammer indeed as...

[...]
+    cd $(SRCORIGDIR)/gcc-trunk && find -regex ".*\.\(c\|C\|h\)"  -type f  -exec sed -i 's/__FUNCTION__/__func__/g' {} \;

...this recursively goes into your gcc-trunk/.svn database. :-(

replacing the patch lines with

+  cd $(SRCORIGDIR)/gcc-trunk && find -regex ".*\.\(c\|C\|h\)" -not -path '^\.'  -type f  -exec sed -i 's/__FUNCTION__/__func__/g' {} \;

keeps out of the svn area.

modified patcher for Makefile enclosed

Jon

--
Stop press! Just announced -

Most Trusted Broadband Provider in the 2014 Moneywise Customer Services Awards

For full details of see https://www.utilitywarehouse.co.uk/reviews?exref=095761

Intrigued? Call me

John Ballance C.Eng MIET - jwb@macpcrepair.co.uk - 07976 295923

No comments:

Post a Comment