summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorJoerg Koenig <Joerg.Koenig@techsat.com>2019-05-30 14:53:28 (GMT)
committerJoerg Koenig <Joerg.Koenig@techsat.com>2019-05-30 14:53:28 (GMT)
commitfb4009e29d14b8ad1b3945225451dc964e248660 (patch)
treedfbfa106f07e305f27f2bc7487cfc6b22e1ef9a8 /Makefile
parentc75756608d1d3fe2158da5b549fd63ba96ec1c36 (diff)
downloadgcc-compiler-suite-fb4009e29d14b8ad1b3945225451dc964e248660.zip
gcc-compiler-suite-fb4009e29d14b8ad1b3945225451dc964e248660.tar.gz
gcc-compiler-suite-fb4009e29d14b8ad1b3945225451dc964e248660.tar.bz2
New version 1.3.0refs/changes/89/7689/1
windows nativ: - using posix thread model - with dwarf2 - added mingw tools Resolves: :jira:<issue> See also: :jira:<issue> Change-Id: I198fe988f0945db58f65be47dbb87cb9d00c2992
Diffstat (limited to 'Makefile')
-rw-r--r--[-rwxr-xr-x]Makefile193
1 files changed, 165 insertions, 28 deletions
diff --git a/Makefile b/Makefile
index a03c56d..afe9e06 100755..100644
--- a/Makefile
+++ b/Makefile
@@ -81,7 +81,7 @@ WINGCC_ROOTNAME = gcc-$(VERSION_GCC)
WINGCC_INST_DIR = $(INST_BASE)/$(WINGCC_ROOTNAME)
WINGCC_SYSROOT = $(INST_BASE)/$(WINGCC_ROOTNAME)
-LANGUAGES = c,c++,fortran,objc
+LANGUAGES = c,c++
SOURCE_PACKAGES = \
$(SOURCE_DIR)/binutils-$(VERSION_BINUTILS).tar.bz2 \
@@ -126,7 +126,7 @@ $(SOURCE_DIR)/gdb-$(VERSION_GDB).tar.gz:
wget -c ftp://sourceware.org/pub/gdb/releases/gdb-$(VERSION_GDB).tar.gz -O \
$(SOURCE_DIR)/gdb-$(VERSION_GDB).tar.gz
$(SOURCE_DIR)/isl-$(VERSION_ISL).tar.bz2:
- wger -c "ftp://gcc.gnu.org/pub/gcc/infrastructure/isl-$(VERSION_ISL).tar.bz2" -O \
+ wget -c "ftp://gcc.gnu.org/pub/gcc/infrastructure/isl-$(VERSION_ISL).tar.bz2" -O \
$(SOURCE_DIR)/isl-$(VERSION_ISL).tar.bz2
download: $(SOURCE_PACKAGES)
@@ -153,15 +153,24 @@ endif
prepare:
mkdir -p $(UNPACK_DIR)
tar -zxf $(SOURCE_DIR)/gcc-$(VERSION_GCC).tar.gz -C $(UNPACK_DIR)/
+ # Patches from https://gcc-mcf.lhmouse.com/ ...
cd $(UNPACK_DIR)/gcc-$(VERSION_GCC) && \
- patch -p1 < $(PATCHES_DIR)/windows-lrealpath-no-force-lowercase-nor-backslash.patch
+ patch -p1 < $(PATCHES_DIR)/0002-Relocate-libintl.patch && \
+ patch -p1 < $(PATCHES_DIR)/0003-Windows-Follow-Posix-dir-exists-semantics-more-close.patch && \
+ patch -p1 < $(PATCHES_DIR)/0004-Windows-Use-not-in-progpath-and-leave-case-as-is.patch && \
+ patch -p1 < $(PATCHES_DIR)/0006-Windows-New-feature-to-allow-overriding.patch && \
+ patch -p1 < $(PATCHES_DIR)/0008-Prettify-linking-no-undefined.patch && \
+ patch -p1 < $(PATCHES_DIR)/0010-Fix-using-large-PCH.patch && \
+ patch -p1 < $(PATCHES_DIR)/0014-clone_function_name_1-Retain-any-stdcall-suffix.patch
tar -zxf $(SOURCE_DIR)/gdb-$(VERSION_GDB).tar.gz -C $(UNPACK_DIR)/
cd $(UNPACK_DIR)/gdb-$(VERSION_GDB) && \
- patch -p1 < $(PATCHES_DIR)/windows-lrealpath-no-force-lowercase-nor-backslash.patch
+ patch -p1 < $(PATCHES_DIR)/0004-Windows-Use-not-in-progpath-and-leave-case-as-is.patch
tar -jxf $(SOURCE_DIR)/binutils-$(VERSION_BINUTILS).tar.bz2 -C $(UNPACK_DIR)/
cd $(UNPACK_DIR)/binutils-$(VERSION_BINUTILS) && \
- patch -p1 < $(PATCHES_DIR)/windows-lrealpath-no-force-lowercase-nor-backslash.patch
+ patch -p1 < $(PATCHES_DIR)/0004-Windows-Use-not-in-progpath-and-leave-case-as-is.patch
tar -jxf $(SOURCE_DIR)/mingw-w64-v$(VERSION_MINGW).tar.bz2 -C $(UNPACK_DIR)/
+ cd $(UNPACK_DIR)/mingw-w64-v$(VERSION_MINGW)/mingw-w64-tools/widl && \
+ patch -p0 < $(PATCHES_DIR)/mingw-tools-widl-realloc.patch
tar -jxf $(SOURCE_DIR)/mpfr-$(VERSION_MPFR).tar.bz2 -C $(UNPACK_DIR)/
tar -jxf $(SOURCE_DIR)/isl-$(VERSION_ISL).tar.bz2 -C $(UNPACK_DIR)/
tar -zxf $(SOURCE_DIR)/mpc-$(VERSION_MPC).tar.gz -C $(UNPACK_DIR)/
@@ -232,6 +241,9 @@ lingcc-gcc:
--with-tune-64=core2 \
--disable-werror \
--disable-symvers \
+ --enable-threads=posix \
+ --disable-sjlj-exceptions \
+ --with-dwarf2 \
--with-arch-directory=lib64 \
--enable-libstdcxx-time=yes \
--enable-libstdcxx-debug \
@@ -285,6 +297,7 @@ xgcc-all:
make xgcc-mingw-pass1
make xgcc-gcc-pass1
make xgcc-mingw-pass2
+ make xgcc-pthread
make xgcc-gcc-pass2
make xgcc-finish
make xgcc-gdb
@@ -331,6 +344,47 @@ xgcc-mingw-pass1:
cd $(XGCC_INST_DIR)/$(XGCC_TARGET64) && mkdir -p lib32
cd $(XGCC_INST_DIR)/$(XGCC_TARGET64) && rm -f lib64 && ln -s lib lib64
+xgcc-pthread: xgcc-pthread-32 xgcc-pthread-64
+
+xgcc-pthread-64:
+ mkdir -p $(BUILD_DIR)/winpthreads-64
+ cd $(BUILD_DIR)/winpthreads-64 && \
+ export PATH=$(XGCC_INST_DIR)/bin:$(PATH) && \
+ LDLAGS="-static-libgcc -static-libstdc++" \
+ CFLAGS="-O2 -pipe" \
+ CXXFLAGS="-O2 -pipe" \
+ $(UNPACK_DIR)/mingw-w64-v$(VERSION_MINGW)/mingw-w64-libraries/winpthreads/configure \
+ --prefix=$(XGCC_INST_DIR)/$(XGCC_TARGET64) \
+ --host=$(XGCC_TARGET64) && \
+ make $(JOBS) clean && \
+ make $(JOBS) && \
+ make $(JOBS) install
+ mv -f $(XGCC_INST_DIR)/$(XGCC_TARGET64)/bin/libwinpthread-1.dll \
+ $(XGCC_INST_DIR)/$(XGCC_TARGET64)/lib
+
+xgcc-pthread-32:
+ rm -Rf $(BUILD_DIR)/winpthreads-32
+ mkdir -p $(BUILD_DIR)/winpthreads-32
+ cd $(BUILD_DIR)/winpthreads-32 && \
+ export PATH=$(XGCC_INST_DIR)/bin:$(PATH) && \
+ LDLAGS="-m32 -static-libgcc -static-libstdc++" \
+ CFLAGS="-m32 -O2 -pipe" \
+ CXXFLAGS="-m32 -O2 -pipe" \
+ CC='x86_64-w64-mingw32-gcc -m32' \
+ CCAS='x86_64-w64-mingw32-gcc -m32' \
+ DLLTOOL='x86_64-w64-mingw32-dlltool -m i386' \
+ RC='x86_64-w64-mingw32-windres -F pe-i386' \
+ $(UNPACK_DIR)/mingw-w64-v$(VERSION_MINGW)/mingw-w64-libraries/winpthreads/configure \
+ --prefix=$(XGCC_INST_DIR)/$(XGCC_TARGET64) \
+ --libdir=$(XGCC_INST_DIR)/$(XGCC_TARGET64)/lib32 \
+ --host=$(XGCC_TARGET64) && \
+ make $(JOBS) clean && \
+ make $(JOBS) && \
+ make $(JOBS) install
+ mv -f $(XGCC_INST_DIR)/$(XGCC_TARGET64)/bin/libwinpthread-1.dll \
+ $(XGCC_INST_DIR)/$(XGCC_TARGET64)/lib32
+
+
xgcc-gcc-pass1:
mkdir -p $(BUILD_DIR)/gcc
cd $(BUILD_DIR)/gcc && \
@@ -355,7 +409,9 @@ xgcc-gcc-pass1:
--enable-static \
--disable-werror \
--with-tune-64=core2 \
- --enable-threads=win32 \
+ --enable-threads=posix \
+ --disable-sjlj-exceptions \
+ --with-dwarf2 \
--enable-multilib \
--enable-64bit \
--enable-clocale=gnu \
@@ -369,6 +425,7 @@ xgcc-mingw-pass2:
LDLAGS="-static-libgcc -static-libstdc++" \
CFLAGS="-O2 -pipe" \
CXXFLAGS="-O2 -pipe" \
+ export PATH=$(XGCC_INST_DIR)/bin:$(PATH); \
$(UNPACK_DIR)/mingw-w64-v$(VERSION_MINGW)/configure \
--prefix=$(XGCC_INST_DIR)/$(XGCC_TARGET64) \
--host=$(XGCC_TARGET64) \
@@ -438,28 +495,37 @@ xgcc-reimp:
xgcc-genpeimg:
rm -Rf $(BUILD_DIR)/genpeimg
+ mkdir -p $(BUILD_DIR)/genpeimg
cd $(BUILD_DIR)/ && \
- tar -zxf $(SOURCE_DIR)/genpeimg.tar.gz
export PATH=$(GCC_BINPATH):$(PATH) && \
- CC=$(GCC) CXX=$(GXX) \
cd $(BUILD_DIR)/genpeimg && \
+ CC=$(GCC) CXX=$(GXX) \
LDLAGS="-static-libgcc" \
CFLAGS="-pipe -Werror=implicit-fallthrough=0" \
- ./configure && \
- make
+ $(UNPACK_DIR)/mingw-w64-v$(VERSION_MINGW)/mingw-w64-tools/genpeimg/configure \
+ --prefix=$(XGCC_INST_DIR) \
+ --target=$(XGCC_TARGET64) \
+ --build=$(ARCH64) \
+ --host=$(ARCH64) && \
+ make && \
+ make install
cp -f $(BUILD_DIR)/genpeimg/genpeimg $(XGCC_INST_DIR)/bin/$(XGCC_TARGET64)-genpeimg
xgcc-gendef:
rm -Rf $(BUILD_DIR)/gendef
- cd $(BUILD_DIR)/ && \
- tar -zxf $(SOURCE_DIR)/gendef.tar.gz
+ mkdir -p $(BUILD_DIR)/gendef
export PATH=$(GCC_BINPATH):$(PATH) && \
CC=$(GCC) CXX=$(GXX) \
cd $(BUILD_DIR)/gendef && \
CFLAGS="-pipe -Werror=implicit-fallthrough=0" \
LDLAGS="-static-libgcc" \
- ./configure && \
- make
+ $(UNPACK_DIR)/mingw-w64-v$(VERSION_MINGW)/mingw-w64-tools/gendef/configure \
+ --prefix=$(XGCC_INST_DIR) \
+ --target=$(XGCC_TARGET64) \
+ --build=$(ARCH64) \
+ --host=$(ARCH64) && \
+ make && \
+ make install
cp -f $(BUILD_DIR)/gendef/gendef $(XGCC_INST_DIR)/bin/$(XGCC_TARGET64)-gendef
xgcc-zlib:
@@ -530,12 +596,12 @@ wingcc-all:
#
make ARCH=x86-mingw64 wingcc-binutils
make ARCH=x86-mingw64 wingcc-mingw
+ make ARCH=x86-mingw64 wingcc-pthread
make ARCH=x86-mingw64 wingcc-gcc
make ARCH=x86-mingw64 wingcc-finish
make ARCH=x86-mingw64 wingcc-zlib
make ARCH=x86-mingw64 wingcc-bzip2
- make ARCH=x86-mingw64 wingcc-gendef
- make ARCH=x86-mingw64 wingcc-genpeimg
+ make ARCH=x86-mingw64 wingcc-mingw-tools
make ARCH=x86-mingw64 wingcc-reimp
make ARCH=x86-mingw64 wingcc-gmake
make ARCH=x86-mingw64 wingcc-gdb
@@ -580,6 +646,40 @@ wingcc-mingw:
make $(JOBS) install
cd $(WINGCC_INST_DIR) && rm -f mingw && ln -s $(XGCC_TARGET64) mingw
+wingcc-pthread: wingcc-pthread-32 wingcc-pthread-64
+
+wingcc-pthread-32:
+ rm -Rf $(BUILD_DIR)/winpthreads-32 && mkdir -p $(BUILD_DIR)/winpthreads-32
+ cd $(BUILD_DIR)/winpthreads-32 && \
+ export PATH=$(XGCC_BINPATH):$(PATH) && \
+ LDLAGS="-m32 -static-libgcc -static-libstdc++" \
+ CFLAGS="-m32 -O2 -pipe" \
+ CXXFLAGS="-m32 -O2 -pipe" \
+ CC='x86_64-w64-mingw32-gcc -m32' \
+ CCAS='x86_64-w64-mingw32-gcc -m32' \
+ DLLTOOL='x86_64-w64-mingw32-dlltool -m i386' \
+ RC='x86_64-w64-mingw32-windres -F pe-i386' \
+ $(UNPACK_DIR)/mingw-w64-v$(VERSION_MINGW)/mingw-w64-libraries/winpthreads/configure \
+ --prefix=$(WINGCC_INST_DIR)/$(XGCC_TARGET64) \
+ --host=$(XGCC_TARGET64) && \
+ make $(JOBS) && \
+ make $(JOBS) install
+ cp -f $(WINGCC_INST_DIR)/$(XGCC_TARGET64)/bin/libwinpthread-1.dll \
+ $(WINGCC_INST_DIR)/$(XGCC_TARGET64)/lib32
+
+wingcc-pthread-64:
+ rm -Rf $(BUILD_DIR)/winpthreads-64 && mkdir -p $(BUILD_DIR)/winpthreads-64
+ cd $(BUILD_DIR)/winpthreads-64 && \
+ export PATH=$(XGCC_BINPATH):$(PATH) && \
+ CC=$(XGCC64) CXX=$(XGPP64) \
+ $(UNPACK_DIR)/mingw-w64-v$(VERSION_MINGW)/mingw-w64-libraries/winpthreads/configure \
+ --prefix=$(WINGCC_INST_DIR)/$(XGCC_TARGET64) \
+ --host=$(XGCC_TARGET64) && \
+ make $(JOBS) && \
+ make $(JOBS) install
+ cp -f $(WINGCC_INST_DIR)/$(XGCC_TARGET64)/bin/libwinpthread-1.dll \
+ $(WINGCC_INST_DIR)/$(XGCC_TARGET64)/lib
+
wingcc-gcc:
rm -Rf $(BUILD_DIR)/gcc && mkdir -p $(BUILD_DIR)/gcc
cd $(BUILD_DIR)/gcc && \
@@ -602,8 +702,10 @@ wingcc-gcc:
--enable-shared \
--with-tune-64=core2 \
--disable-werror \
- --disable-win32-registry \
--disable-symvers \
+ --enable-threads=posix \
+ --disable-sjlj-exceptions \
+ --with-dwarf2 \
--enable-multilib \
--enable-64bit \
--enable-clocale=gnu \
@@ -672,34 +774,69 @@ wingcc-gmake:
make && make install
cp -f $(WINGCC_INST_DIR)/bin/make.exe $(WINGCC_INST_DIR)/bin/$(XGCC_TARGET64)-make.exe
+wingcc-mingw-tools: wingcc-genpeimg wingcc-gendef wingcc-genidl wingcc-genlib wingcc-widl
+
wingcc-genpeimg:
rm -Rf $(BUILD_DIR)/genpeimg
- cd $(BUILD_DIR)/ && \
- tar -zxf $(SOURCE_DIR)/genpeimg.tar.gz
+ mkdir -p $(BUILD_DIR)/genpeimg
cd $(BUILD_DIR)/genpeimg && \
export PATH=$(XGCC_BINPATH):$(PATH) && \
CC=$(XGCC64) CXX=$(XGPP64) genpeimg_CFLAGS="" CFLAGS="-O3 -g -Werror=implicit-fallthrough=0"\
- ./configure \
+ $(UNPACK_DIR)/mingw-w64-v$(VERSION_MINGW)/mingw-w64-tools/genpeimg/configure \
--host=$(XGCC_TARGET64) && \
make
cp -f $(BUILD_DIR)/genpeimg/genpeimg.exe \
- $(WINGCC_INST_DIR)/bin/genpeimg.exe
- cp -f $(BUILD_DIR)/genpeimg/genpeimg.exe \
$(WINGCC_INST_DIR)/bin/$(XGCC_TARGET64)-genpeimg.exe
wingcc-gendef:
rm -Rf $(BUILD_DIR)/gendef
- cd $(BUILD_DIR)/ && \
- tar -zxf $(SOURCE_DIR)/gendef.tar.gz
+ mkdir -p $(BUILD_DIR)/gendef && \
cd $(BUILD_DIR)/gendef && \
export PATH=$(XGCC_BINPATH):$(PATH) && \
CC=$(XGCC64) CXX=$(XGPP64) genpeimg_CFLAGS="" CFLAGS="-O3 -g -Wno-error=cast-function-type -Werror=implicit-fallthrough=0"\
- ./configure \
+ $(UNPACK_DIR)/mingw-w64-v$(VERSION_MINGW)/mingw-w64-tools/gendef/configure \
--host=$(XGCC_TARGET64) && \
make
- cp -f $(BUILD_DIR)/gendef/gendef.exe $(WINGCC_INST_DIR)/bin/gendef.exe
cp -f $(BUILD_DIR)/gendef/gendef.exe $(WINGCC_INST_DIR)/bin/$(XGCC_TARGET64)-gendef.exe
+wingcc-genidl:
+ rm -Rf $(BUILD_DIR)/genidl
+ mkdir -p $(BUILD_DIR)/genidl
+ cd $(BUILD_DIR)/genidl && \
+ export PATH=$(XGCC_BINPATH):$(PATH) && \
+ CC=$(XGCC64) CXX=$(XGPP64) CFLAGS="-O3 -g -Wno-error=cast-function-type -Werror=implicit-fallthrough=0"\
+ $(UNPACK_DIR)/mingw-w64-v$(VERSION_MINGW)/mingw-w64-tools/genidl/configure \
+ --prefix=$(WINGCC_INST_DIR) \
+ --host=$(XGCC_TARGET64) && \
+ make && \
+ make install
+
+wingcc-genlib:
+ rm -Rf $(BUILD_DIR)/genlib
+ mkdir -p $(BUILD_DIR)/genlib
+ cd $(BUILD_DIR)/genlib && \
+ export PATH=$(XGCC_BINPATH):$(PATH) && \
+ CC=$(XGCC64) CXX=$(XGPP64) CFLAGS="-O3 -g -Wno-error=cast-function-type -Werror=implicit-fallthrough=0"\
+ $(UNPACK_DIR)/mingw-w64-v$(VERSION_MINGW)/mingw-w64-tools/genlib/configure \
+ --prefix=$(WINGCC_INST_DIR) \
+ --host=$(XGCC_TARGET64) && \
+ make && \
+ make install
+
+wingcc-widl:
+ cd $(UNPACK_DIR)/mingw-w64-v$(VERSION_MINGW)/mingw-w64-tools/widl && \
+ autoconf
+ rm -Rf $(BUILD_DIR)/widl
+ mkdir -p $(BUILD_DIR)/widl
+ cd $(BUILD_DIR)/widl && \
+ export PATH=$(XGCC_BINPATH):$(PATH) && \
+ ac_cv_func_malloc_0_nonnull=yes CC=$(XGCC64) CXX=$(XGPP64) CFLAGS="-O3 -g -Wno-error=cast-function-type -Werror=implicit-fallthrough=0"\
+ $(UNPACK_DIR)/mingw-w64-v$(VERSION_MINGW)/mingw-w64-tools/widl/configure \
+ --prefix=$(WINGCC_INST_DIR) \
+ --host=$(XGCC_TARGET64) && \
+ make && \
+ make install
+
wingcc-zlib:
mkdir -p $(BUILD_DIR)
cd $(BUILD_DIR) && rm -Rf zlib-$(VERSION_ZLIB)
@@ -768,9 +905,9 @@ wingcc-gdb:
--host=$(XGCC_TARGET64) \
--build=$(ARCH64) && \
make $(JOBS) && make $(JOBS) install
- mv -f $(WINGCC_INST_DIR)/bin/gdb.exe \
+ cp -f $(WINGCC_INST_DIR)/bin/gdb.exe \
$(WINGCC_INST_DIR)/bin/$(XGCC_TARGET64)-gdb.exe
- mv -f $(WINGCC_INST_DIR)/bin/gdbserver.exe \
+ cp -f $(WINGCC_INST_DIR)/bin/gdbserver.exe \
$(WINGCC_INST_DIR)/bin/$(XGCC_TARGET64)-gdbserver.exe
wingcc-pack:
rm -Rf $(WINGCC_INST_DIR)/share