From d49ca4bfd71301caef1b52eb7b58544235be52b3 Mon Sep 17 00:00:00 2001 From: Christopher Friedt Date: Fri, 29 Apr 2016 13:46:00 -0400 Subject: [PATCH] reduced required changes for building on mac to solely creating fake empty static libraries with touch (because Apples ar errors out when trying to create an empty static library) --- Makefile | 21 +--- .../gcc-4.2.1/0013-macosx-has-pthreads.diff | 115 ------------------ ...-x-ar.patch => 00-broken-mac-os-x-ar.diff} | 5 +- 3 files changed, 3 insertions(+), 138 deletions(-) delete mode 100644 patches/gcc-4.2.1/0013-macosx-has-pthreads.diff rename patches/musl/{00-broken-mac-os-x-ar.patch => 00-broken-mac-os-x-ar.diff} (73%) diff --git a/Makefile b/Makefile index a3f137d..5a47cfd 100644 --- a/Makefile +++ b/Makefile @@ -92,19 +92,10 @@ binutils-$(BINUTILS_VER)/.mcm_extracted: $(SOURCES)/binutils-$(BINUTILS_VER).tar binutils-$(BINUTILS_VER)/.mcm_configured: binutils-$(BINUTILS_VER)/.mcm_extracted test -e binutils-$(BINUTILS_VER)/config.status || ( cd binutils-$(BINUTILS_VER) && ./configure $(BINUTILS_CONFIG) ) -ifeq ($(shell uname),Darwin) - echo '#define HAVE_STDLIB_H 1' >> binutils-$(BINUTILS_VER)/libiberty/config.h - echo '#define HAVE_LIMITS_H 1' >> binutils-$(BINUTILS_VER)/libiberty/config.h - echo '#define HAVE_STRING_H 1' >> binutils-$(BINUTILS_VER)/libiberty/config.h - echo '#define HAVE_SYS_TYPES_H 1' >> binutils-$(BINUTILS_VER)/libiberty/config.h - echo '#define HAVE_SYS_STAT_H 1' >> binutils-$(BINUTILS_VER)/libiberty/config.h - echo '#define HAVE_UNISTD_H 1' >> binutils-$(BINUTILS_VER)/libiberty/config.h - echo '#define HAVE_FCNTL_H 1' >> binutils-$(BINUTILS_VER)/libiberty/config.h -endif touch $@ binutils-$(BINUTILS_VER)/.mcm_built: binutils-$(BINUTILS_VER)/.mcm_configured - $(MAKE) -C binutils-$(BINUTILS_VER) + cd binutils-$(BINUTILS_VER) && $(MAKE) touch $@ binutils-$(BINUTILS_VER)/.mcm_installed: binutils-$(BINUTILS_VER)/.mcm_built @@ -118,16 +109,6 @@ gcc-$(GCC_VER)/.mcm_extracted: $(SOURCES)/gcc-$(GCC_VER).tar.bz2 $(SOURCES)/conf tar jxvf $< cat patches/gcc-$(GCC_VER)/* | ( cd gcc-$(GCC_VER) && patch -p1 ) cp $(SOURCES)/config.sub gcc-$(GCC_VER) -ifeq ($(shell uname),Darwin) - echo '#define HAVE_STDLIB_H 1' >> gcc-$(GCC_VER)/libiberty/config.in - echo '#define HAVE_LIMITS_H 1' >> gcc-$(GCC_VER)/libiberty/config.in - echo '#define HAVE_STRING_H 1' >> gcc-$(GCC_VER)/libiberty/config.in - echo '#define HAVE_SYS_TYPES_H 1' >> gcc-$(GCC_VER)/libiberty/config.in - echo '#define HAVE_SYS_STAT_H 1' >> gcc-$(GCC_VER)/libiberty/config.inø - echo '#define HAVE_UNISTD_H 1' >> gcc-$(GCC_VER)/libiberty/config.in - echo '#define HAVE_FCNTL_H 1' >> gcc-$(GCC_VER)/gcc/auto-host.h - echo '#define HAVE_SYS_PARAM_H 1' >> gcc-$(GCC_VER)/gcc/auto-host.h -endif touch $@ gcc-$(GCC_VER)/build0/.mcm_configured: gcc-$(GCC_VER)/.mcm_extracted | binutils-$(BINUTILS_VER)/.mcm_installed diff --git a/patches/gcc-4.2.1/0013-macosx-has-pthreads.diff b/patches/gcc-4.2.1/0013-macosx-has-pthreads.diff deleted file mode 100644 index f70192c..0000000 --- a/patches/gcc-4.2.1/0013-macosx-has-pthreads.diff +++ /dev/null @@ -1,115 +0,0 @@ -diff --git a/libgomp/configure b/libgomp/configure -index af4254c..eee4673 100755 ---- a/libgomp/configure -+++ b/libgomp/configure -@@ -8462,110 +8462,6 @@ fi - # ----------------- done all checks, emit header ------------- - ac_config_commands="$ac_config_commands gstdint.h" - -- -- -- --# Check to see if -pthread or -lpthread is needed. Prefer the former. --# In case the pthread.h system header is not found, this test will fail. --XPCFLAGS="" --CFLAGS="$CFLAGS -pthread" --cat >conftest.$ac_ext <<_ACEOF --/* confdefs.h. */ --_ACEOF --cat confdefs.h >>conftest.$ac_ext --cat >>conftest.$ac_ext <<_ACEOF --/* end confdefs.h. */ --#include -- void *g(void *d) { return NULL; } --int --main () --{ --pthread_t t; pthread_create(&t,NULL,g,NULL); -- ; -- return 0; --} --_ACEOF --rm -f conftest.$ac_objext conftest$ac_exeext --if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -- (eval $ac_link) 2>conftest.er1 -- ac_status=$? -- grep -v '^ *+' conftest.er1 >conftest.err -- rm -f conftest.er1 -- cat conftest.err >&5 -- echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -- (eval $ac_try) 2>&5 -- ac_status=$? -- echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); }; } && -- { ac_try='test -s conftest$ac_exeext' -- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -- (eval $ac_try) 2>&5 -- ac_status=$? -- echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); }; }; then -- XPCFLAGS=" -Wc,-pthread" --else -- echo "$as_me: failed program was:" >&5 --sed 's/^/| /' conftest.$ac_ext >&5 -- --CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS" -- cat >conftest.$ac_ext <<_ACEOF --/* confdefs.h. */ --_ACEOF --cat confdefs.h >>conftest.$ac_ext --cat >>conftest.$ac_ext <<_ACEOF --/* end confdefs.h. */ --#include -- void *g(void *d) { return NULL; } --int --main () --{ --pthread_t t; pthread_create(&t,NULL,g,NULL); -- ; -- return 0; --} --_ACEOF --rm -f conftest.$ac_objext conftest$ac_exeext --if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -- (eval $ac_link) 2>conftest.er1 -- ac_status=$? -- grep -v '^ *+' conftest.er1 >conftest.err -- rm -f conftest.er1 -- cat conftest.err >&5 -- echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -- (eval $ac_try) 2>&5 -- ac_status=$? -- echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); }; } && -- { ac_try='test -s conftest$ac_exeext' -- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -- (eval $ac_try) 2>&5 -- ac_status=$? -- echo "$as_me:$LINENO: \$? = $ac_status" >&5 -- (exit $ac_status); }; }; then -- : --else -- echo "$as_me: failed program was:" >&5 --sed 's/^/| /' conftest.$ac_ext >&5 -- --{ { echo "$as_me:$LINENO: error: Pthreads are required to build libgomp" >&5 --echo "$as_me: error: Pthreads are required to build libgomp" >&2;} -- { (exit 1); exit 1; }; } --fi --rm -f conftest.err conftest.$ac_objext \ -- conftest$ac_exeext conftest.$ac_ext --fi --rm -f conftest.err conftest.$ac_objext \ -- conftest$ac_exeext conftest.$ac_ext -- - # Check for functions needed. - - diff --git a/patches/musl/00-broken-mac-os-x-ar.patch b/patches/musl/00-broken-mac-os-x-ar.diff similarity index 73% rename from patches/musl/00-broken-mac-os-x-ar.patch rename to patches/musl/00-broken-mac-os-x-ar.diff index ce27316..f2d08f0 100644 --- a/patches/musl/00-broken-mac-os-x-ar.patch +++ b/patches/musl/00-broken-mac-os-x-ar.diff @@ -2,13 +2,12 @@ diff --git a/Makefile b/Makefile index ec54880..b048cbd 100644 --- a/Makefile +++ b/Makefile -@@ -170,7 +170,12 @@ lib/libc.a: $(AOBJS) +@@ -170,7 +170,11 @@ lib/libc.a: $(AOBJS) $(EMPTY_LIBS): rm -f $@ +ifeq ($(shell uname),Darwin) -+ touch .empty.o -+ $(AR) rc $@ .empty.o ++ touch $@ +else $(AR) rc $@ +endif