Attached Files |
-
0001-Update-the-x86_64-w64-mingw32-toolchain.patch (9,096 bytes) 2022-02-16 01:02
From 25059bfb6bcfc0c47aee8f8a30855dc29502e53b Mon Sep 17 00:00:00 2001
From: Cameron Cawley <ccawley2011@gmail.com>
Date: Wed, 16 Feb 2022 00:26:44 +0000
Subject: [PATCH] Update the x86_64-w64-mingw32 toolchain
---
sdk/Makefile | 9 ++++++
.../openssl/Configurations-50-windows.conf.p | 28 +++++++++++++++++--
x86_64-w64-mingw32/Makefile | 23 +++++++++------
.../recipes/patches/gcc4/cp_cfns_gperf.p | 17 +++++++++++
.../recipes/patches/gcc4/cp_cfns_h.p | 17 +++++++++++
.../recipes/patches/gcc4/gcc_texi.p | 20 +++++++++++++
6 files changed, 103 insertions(+), 11 deletions(-)
create mode 100644 x86_64-w64-mingw32/recipes/patches/gcc4/cp_cfns_gperf.p
create mode 100644 x86_64-w64-mingw32/recipes/patches/gcc4/cp_cfns_h.p
create mode 100644 x86_64-w64-mingw32/recipes/patches/gcc4/gcc_texi.p
diff --git a/sdk/Makefile b/sdk/Makefile
index 6870546..b33a87f 100644
--- a/sdk/Makefile
+++ b/sdk/Makefile
@@ -12,6 +12,7 @@
# m5475-atari-mint
# ppc-amigaos
# i686-w64-mingw32
+# x86_64-w64-mingw32
# m68k-unknown-amigaos
ifeq ($(GCCSDK_INSTALL_ENV),)
@@ -139,6 +140,14 @@ ifeq ($(TARGET),i686-w64-mingw32)
EXTRAARGS_OPENSSL := no-asm enable-capieng
endif
+ifeq ($(TARGET),x86_64-w64-mingw32)
+ SDK_ITEMS := $(addprefix $(BUILDSTEPS)/, libiconv.d libgnurx.d $(COMMON_SDK_ITEMS) libjpeg.d libwebp.d)
+ EXTRAARGS_LIBCARES := --disable-shared
+ EXTRAARGS_LIBCURL := --enable-nonblocking --enable-ares --disable-ldap --without-random
+ LIBCURL_ENV := CFLAGS="-DCARES_STATICLIB" LIBS="-lgdi32 -lcrypt32"
+ EXTRAARGS_OPENSSL := no-asm enable-capieng
+endif
+
ifeq ($(TARGET),m68k-unknown-amigaos)
SDK_ITEMS := $(addprefix $(BUILDSTEPS)/, roadshow.d libiconv.d libtre.d libpbl.d $(COMMON_SDK_ITEMS) libjpeg.d)
EXTRAARGS_LIBCARES := --disable-shared --without-random
diff --git a/sdk/recipes/patches/openssl/Configurations-50-windows.conf.p b/sdk/recipes/patches/openssl/Configurations-50-windows.conf.p
index c492c01..9078348 100644
--- a/sdk/recipes/patches/openssl/Configurations-50-windows.conf.p
+++ b/sdk/recipes/patches/openssl/Configurations-50-windows.conf.p
@@ -1,6 +1,6 @@
---- /dev/null 2017-10-10 15:19:45.611896396 +0100
-+++ Configurations/50-windows.conf 2017-10-17 15:42:25.304921197 +0100
-@@ -0,0 +1,25 @@
+--- /dev/null 2022-02-14 15:37:52.105293873 +0000
++++ Configurations/50-windows.conf 2022-02-14 21:08:53.051895233 +0000
+@@ -0,0 +1,47 @@
+%targets = (
+
+ "i686-w64-mingw32" => {
@@ -25,4 +25,26 @@
+ multilib => "",
+ apps_aux_src => add("win32_init.c"),
+ },
++
++ "x86_64-w64-mingw32" => {
++ inherit_from => [ "BASE_unix", asm("x86_64_asm") ],
++ cc => "gcc",
++ cflags => combine(picker(default => "-DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE -m64 -Wall",
++ debug => "-g -O0",
++ release => "-O3"),
++ threads("-D_MT")),
++ sys_id => "MINGW64",
++ ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
++ bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
++ thread_scheme => "winthreads",
++ perlasm_scheme => "mingw64",
++ dso_scheme => "win32",
++ shared_target => "mingw-shared",
++ shared_cflag => add("-D_WINDLL"),
++ shared_ldflag => "-static-libgcc",
++ shared_rcflag => "--target=pe-x86-64",
++ shared_extension => ".dll",
++ multilib => "64",
++ apps_aux_src => add("win32_init.c"),
++ },
+);
diff --git a/x86_64-w64-mingw32/Makefile b/x86_64-w64-mingw32/Makefile
index 240411b..c3b174d 100644
--- a/x86_64-w64-mingw32/Makefile
+++ b/x86_64-w64-mingw32/Makefile
@@ -1,6 +1,6 @@
-#!/bin/make
+#!/usr/bin/make
-# mingw toolchain
+# Build cross toolchain for x86_64 processor with a win32 (mingw) ABI
UPSTREAM_GCC_VERSION := 4.8.4
UPSTREAM_GCC_TARBALL := gcc-$(UPSTREAM_GCC_VERSION).tar.bz2
@@ -10,9 +10,9 @@ UPSTREAM_BINUTILS_VERSION := 2.25
UPSTREAM_BINUTILS_TARBALL := binutils-$(UPSTREAM_BINUTILS_VERSION).tar.bz2
UPSTREAM_BINUTILS_URI := http://ftpmirror.gnu.org/binutils/$(UPSTREAM_BINUTILS_TARBALL)
-UPSTREAM_GMP_VERSION := 4.3.2
+UPSTREAM_GMP_VERSION := 5.0.5
UPSTREAM_GMP_TARBALL := gmp-$(UPSTREAM_GMP_VERSION).tar.bz2
-UPSTREAM_GMP_URI := http://ftp.gnu.org/gnu/gmp/$(UPSTREAM_GMP_TARBALL)
+UPSTREAM_GMP_URI := https://gmplib.org/download/gmp-$(UPSTREAM_GMP_VERSION)/$(UPSTREAM_GMP_TARBALL)
# Would use 3.0.0, but that dislikes in-tree gmp sources
UPSTREAM_MPFR_VERSION := 2.4.2
@@ -62,7 +62,7 @@ $(BUILDSTEPS)/gcc-core.d: $(BUILDSTEPS)/srcdir-step3.d $(BUILDSTEPS)/binutils.d
--prefix=$(PREFIX) --target=$(TARGET_NAME) \
--enable-languages=c,c++ --with-system-zlib --disable-multilib \
--enable-shared --enable-fully-dynamic-string
- cd $(BUILDDIR)/gcc && PATH="$(PREFIX)/bin:$(PATH)" make all-gcc -j 4
+ cd $(BUILDDIR)/gcc && PATH="$(PREFIX)/bin:$(PATH)" make all-gcc
cd $(BUILDDIR)/gcc && PATH="$(PREFIX)/bin:$(PATH)" make install-gcc
touch $@
@@ -104,6 +104,7 @@ $(BUILDSTEPS)/mingw-srcdir.d: $(SOURCESDIR)/$(UPSTREAM_MINGW_TARBALL)
###
$(BUILDSTEPS)/srcdir-step3.d: $(BUILDSTEPS)/srcdir-step2.d
+ for p in `ls $(RECIPES)/patches/gcc4/*.p` ; do patch -d $(GCC_SRCDIR) -p0 <$$p ; done
touch $@
$(BUILDSTEPS)/srcdir-step2.d: $(BUILDSTEPS)/srcdir-step1.d $(SOURCESDIR)/$(UPSTREAM_GMP_TARBALL) $(SOURCESDIR)/$(UPSTREAM_MPFR_TARBALL) $(SOURCESDIR)/$(UPSTREAM_MPC_TARBALL)
@@ -143,22 +144,28 @@ $(BUILDSTEPS)/binutils-srcdir.d: $(SOURCESDIR)/$(UPSTREAM_BINUTILS_TARBALL)
###
$(SOURCESDIR)/$(UPSTREAM_GCC_TARBALL):
- wget -q -O $@ $(UPSTREAM_GCC_URI)
+ wget -q -O $@ $(UPSTREAM_GCC_URI)
+ touch $@
$(SOURCESDIR)/$(UPSTREAM_GMP_TARBALL):
wget -q -O $@ $(UPSTREAM_GMP_URI)
+ touch $@
$(SOURCESDIR)/$(UPSTREAM_MPFR_TARBALL):
wget -q -O $@ $(UPSTREAM_MPFR_URI)
+ touch $@
$(SOURCESDIR)/$(UPSTREAM_MPC_TARBALL):
wget -q -O $@ $(UPSTREAM_MPC_URI)
+ touch $@
$(SOURCESDIR)/$(UPSTREAM_BINUTILS_TARBALL):
wget -q -O $@ $(UPSTREAM_BINUTILS_URI)
+ touch $@
$(SOURCESDIR)/$(UPSTREAM_MINGW_TARBALL):
wget -q -O $@ $(UPSTREAM_MINGW_URI)
+ touch $@
###
# Rule to create buildsteps dir
@@ -169,7 +176,7 @@ $(BUILDSTEPS)/buildsteps.d: $(SOURCESDIR) $(SRCDIR)
touch $@
$(SOURCESDIR):
- mkdir -p $(SOURCESDIR)
+ mkdir -p $@
$(SRCDIR):
- mkdir -p $(SRCDIR)
+ mkdir -p $@
diff --git a/x86_64-w64-mingw32/recipes/patches/gcc4/cp_cfns_gperf.p b/x86_64-w64-mingw32/recipes/patches/gcc4/cp_cfns_gperf.p
new file mode 100644
index 0000000..f0598e5
--- /dev/null
+++ b/x86_64-w64-mingw32/recipes/patches/gcc4/cp_cfns_gperf.p
@@ -0,0 +1,17 @@
+--- gcc/cp/cfns.gperf.orig 2017-09-15 16:17:49.249145794 +0100
++++ gcc/cp/cfns.gperf 2017-09-15 16:18:26.468005263 +0100
+@@ -16,14 +16,6 @@
+ You should have received a copy of the GNU General Public License
+ along with GCC; see the file COPYING3. If not see
+ <http://www.gnu.org/licenses/>. */
+-#ifdef __GNUC__
+-__inline
+-#endif
+-static unsigned int hash (const char *, unsigned int);
+-#ifdef __GNUC__
+-__inline
+-#endif
+-const char * libc_name_p (const char *, unsigned int);
+ %}
+ %%
+ # The standard C library functions, for feeding to gperf; the result is used
diff --git a/x86_64-w64-mingw32/recipes/patches/gcc4/cp_cfns_h.p b/x86_64-w64-mingw32/recipes/patches/gcc4/cp_cfns_h.p
new file mode 100644
index 0000000..8f89f8a
--- /dev/null
+++ b/x86_64-w64-mingw32/recipes/patches/gcc4/cp_cfns_h.p
@@ -0,0 +1,17 @@
+--- gcc/cp/cfns.h.orig 2017-09-15 16:50:55.872127506 +0100
++++ gcc/cp/cfns.h 2017-09-15 16:51:18.147443810 +0100
+@@ -47,14 +47,6 @@
+ You should have received a copy of the GNU General Public License
+ along with GCC; see the file COPYING3. If not see
+ <http://www.gnu.org/licenses/>. */
+-#ifdef __GNUC__
+-__inline
+-#endif
+-static unsigned int hash (const char *, unsigned int);
+-#ifdef __GNUC__
+-__inline
+-#endif
+-const char * libc_name_p (const char *, unsigned int);
+ /* maximum key range = 391, duplicates = 0 */
+
+ #ifdef __GNUC__
diff --git a/x86_64-w64-mingw32/recipes/patches/gcc4/gcc_texi.p b/x86_64-w64-mingw32/recipes/patches/gcc4/gcc_texi.p
new file mode 100644
index 0000000..056edfa
--- /dev/null
+++ b/x86_64-w64-mingw32/recipes/patches/gcc4/gcc_texi.p
@@ -0,0 +1,20 @@
+--- gcc/doc/gcc.texi.orig 2017-09-15 17:46:47.157490325 +0100
++++ gcc/doc/gcc.texi 2017-09-15 17:47:58.714929743 +0100
+@@ -85,9 +85,15 @@
+ @item GNU Press
+ @tab Website: www.gnupress.org
+ @item a division of the
+-@tab General: @tex press@@gnu.org @end tex
++@tab General:
++@tex
++press@@gnu.org
++@end tex
+ @item Free Software Foundation
+-@tab Orders: @tex sales@@gnu.org @end tex
++@tab Orders:
++@tex
++sales@@gnu.org
++@end tex
+ @item 51 Franklin Street, Fifth Floor
+ @tab Tel 617-542-5942
+ @item Boston, MA 02110-1301 USA
--
2.30.2
-
0001-Recognize-x86_64-w64-mingw32-as-a-valid-host.patch (728 bytes) 2022-02-16 01:02
From f5eed51a85cb6e8658677e51b62e559d0434c1ff Mon Sep 17 00:00:00 2001
From: Cameron Cawley <ccawley2011@gmail.com>
Date: Wed, 16 Feb 2022 00:29:38 +0000
Subject: [PATCH] Recognize x86_64-w64-mingw32 as a valid host
---
makefiles/Makefile.tools | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/makefiles/Makefile.tools b/makefiles/Makefile.tools
index f312394..53a5ea4 100644
--- a/makefiles/Makefile.tools
+++ b/makefiles/Makefile.tools
@@ -186,7 +186,7 @@ else
PREFIX ?= $(GCCSDK_INSTALL_ENV)
endif
- ifeq ($(HOST),i686-w64-mingw32)
+ ifeq ($(findstring mingw32,$(HOST)),mingw32)
# Cross compiling for Windows -- assumes mingw toolchain
GENHTML ?= echo
LCOV ?= echo
--
2.30.2
-
0001-Fix-build-and-warnings-with-64-bit-Windows.patch (8,226 bytes) 2022-02-16 01:03
From 58f6a5807b026abebbaa0fbacf22d606c3884070 Mon Sep 17 00:00:00 2001
From: Cameron Cawley <ccawley2011@gmail.com>
Date: Wed, 16 Feb 2022 00:56:23 +0000
Subject: [PATCH] Fix build and warnings with 64-bit Windows
---
content/fetchers/about/chart.c | 1 +
content/handlers/html/interaction.c | 2 ++
content/llcache.c | 2 +-
frontends/windows/Makefile.tools | 9 +++++++--
frontends/windows/about.c | 2 +-
frontends/windows/download.c | 5 +++--
frontends/windows/font.c | 4 ++--
frontends/windows/prefs.c | 27 +++++++++++++++------------
frontends/windows/windbg.h | 2 +-
tools/jenkins-build.sh | 13 +++++++++++++
10 files changed, 46 insertions(+), 21 deletions(-)
diff --git a/content/fetchers/about/chart.c b/content/fetchers/about/chart.c
index 1565c54d8..f67598a84 100644
--- a/content/fetchers/about/chart.c
+++ b/content/fetchers/about/chart.c
@@ -34,6 +34,7 @@
#include <stdio.h>
#include "netsurf/inttypes.h"
+#include "utils/config.h"
#include "utils/utils.h"
#include "utils/errors.h"
#include "utils/nsurl.h"
diff --git a/content/handlers/html/interaction.c b/content/handlers/html/interaction.c
index 026ef1ee7..cef09fcda 100644
--- a/content/handlers/html/interaction.c
+++ b/content/handlers/html/interaction.c
@@ -1499,6 +1499,8 @@ html_mouse_action(struct content *c,
default:
/* Unknown content related drag type */
assert(0 && "Unknown content related drag type");
+ res = NSERROR_BAD_PARAMETER;
+ break;
}
if (res != NSERROR_OK) {
diff --git a/content/llcache.c b/content/llcache.c
index 81e08383c..a64900a77 100644
--- a/content/llcache.c
+++ b/content/llcache.c
@@ -2966,7 +2966,7 @@ static void llcache_persist(void *p)
total_bandwidth = (total_written * 1000) / total_elapsed;
NSLOG(llcache, DEBUG,
- "Wrote %"PRIssizet" bytes in %lums bw:%lu %s",
+ "Wrote %"PRIssizet" bytes in %lums bw:%"PRIsizet" %s",
written, elapsed, (written * 1000) / elapsed,
nsurl_access(lst[idx]->url) );
diff --git a/frontends/windows/Makefile.tools b/frontends/windows/Makefile.tools
index 24f0f7fbd..38e856eb0 100644
--- a/frontends/windows/Makefile.tools
+++ b/frontends/windows/Makefile.tools
@@ -5,8 +5,13 @@
ifneq ($(HOST),windows)
# Set Mingw defaults
- GCCSDK_INSTALL_ENV ?= /opt/netsurf/i686-w64-mingw32/env
- GCCSDK_INSTALL_CROSSBIN ?= /opt/netsurf/i686-w64-mingw32/cross/bin
+ ifeq ($(findstring -w64-mingw32,$(HOST)),-w64-mingw32)
+ GCCSDK_INSTALL_ENV ?= /opt/netsurf/$(HOST)/env
+ GCCSDK_INSTALL_CROSSBIN ?= /opt/netsurf/$(HOST)/cross/bin
+ else
+ GCCSDK_INSTALL_ENV ?= /opt/netsurf/i686-w64-mingw32/env
+ GCCSDK_INSTALL_CROSSBIN ?= /opt/netsurf/i686-w64-mingw32/cross/bin
+ endif
CC := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*gcc)
WINDRES := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*windres)
diff --git a/frontends/windows/about.c b/frontends/windows/about.c
index 325587d8a..730751f34 100644
--- a/frontends/windows/about.c
+++ b/frontends/windows/about.c
@@ -94,7 +94,7 @@ static BOOL destroy_about_dialog(HWND hwnd)
}
-static BOOL CALLBACK
+static INT_PTR CALLBACK
nsws_about_event_callback(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
diff --git a/frontends/windows/download.c b/frontends/windows/download.c
index f0163cef7..86ab51bea 100644
--- a/frontends/windows/download.c
+++ b/frontends/windows/download.c
@@ -37,6 +37,7 @@
#include "utils/string.h"
#include "content/fetch.h"
#include "netsurf/download.h"
+#include "netsurf/inttypes.h"
#include "desktop/download.h"
#include "windows/download.h"
@@ -155,7 +156,7 @@ static void nsws_download_clear_data(struct gui_download_window *w)
}
-static BOOL CALLBACK
+static INT_PTR CALLBACK
nsws_download_event_callback(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
switch(msg) {
@@ -314,7 +315,7 @@ gui_download_window_data(struct gui_download_window *w, const char *data,
struct timeval val;
res = fwrite((void *)data, 1, size, w->file);
if (res != size)
- NSLOG(netsurf, INFO, "file write error %d of %d", size - res,
+ NSLOG(netsurf, INFO, "file write error %"PRIsizet" of %d", size - res,
size);
w->downloaded += res;
w->progress = (unsigned int)(((long long)(w->downloaded) * 10000)
diff --git a/frontends/windows/font.c b/frontends/windows/font.c
index 3e81a80a1..da2fe9735 100644
--- a/frontends/windows/font.c
+++ b/frontends/windows/font.c
@@ -335,8 +335,8 @@ win32_font_split(const plot_font_style_t *style,
res = win32_font_width(style, string, *offset, actual_x);
NSLOG(netsurf, DEEPDEBUG,
- "ret %d Split %u chars at %ipx: Split at char %i (%ipx) - %.*s",
- res, length, x, *offset, *actual_x, *offset, string);
+ "ret %d Split %"PRIsizet" chars at %ipx: Split at char %"PRIsizet" (%ipx) - %.*s",
+ res, length, x, *offset, *actual_x, (int)*offset, string);
return res;
}
diff --git a/frontends/windows/prefs.c b/frontends/windows/prefs.c
index 37f558477..cd196a1ab 100644
--- a/frontends/windows/prefs.c
+++ b/frontends/windows/prefs.c
@@ -145,10 +145,11 @@ static void change_spinner(HWND sub, double change, double minval, double maxval
* \param lParam The message l parameter
* \return result appropriate for message
*/
-static BOOL CALLBACK options_appearance_dialog_handler(HWND hwnd,
- UINT msg,
- WPARAM wparam,
- LPARAM lParam)
+static INT_PTR CALLBACK
+options_appearance_dialog_handler(HWND hwnd,
+ UINT msg,
+ WPARAM wparam,
+ LPARAM lParam)
{
int len;
char *temp, number[6];
@@ -427,10 +428,11 @@ static BOOL CALLBACK options_appearance_dialog_handler(HWND hwnd,
* \param lParam The message l parameter
* \return result appropriate for message
*/
-static BOOL CALLBACK options_connections_dialog_handler(HWND hwnd,
- UINT msg,
- WPARAM wparam,
- LPARAM lParam)
+static INT_PTR CALLBACK
+options_connections_dialog_handler(HWND hwnd,
+ UINT msg,
+ WPARAM wparam,
+ LPARAM lParam)
{
int len;
char *temp, number[6];
@@ -598,10 +600,11 @@ static BOOL CALLBACK options_connections_dialog_handler(HWND hwnd,
* \param lParam The message l parameter
* \return result appropriate for message
*/
-static BOOL CALLBACK options_general_dialog_handler(HWND hwnd,
- UINT msg,
- WPARAM wparam,
- LPARAM lParam)
+static INT_PTR CALLBACK
+options_general_dialog_handler(HWND hwnd,
+ UINT msg,
+ WPARAM wparam,
+ LPARAM lParam)
{
HWND sub;
diff --git a/frontends/windows/windbg.h b/frontends/windows/windbg.h
index f09cea9e6..8ad3ee24a 100644
--- a/frontends/windows/windbg.h
+++ b/frontends/windows/windbg.h
@@ -35,7 +35,7 @@ void win_perror(const char *lpszFunction);
((m) != WM_NCHITTEST) && \
((m) != WM_ENTERIDLE)) \
NSLOG(netsurf, DEBUG, \
- "%s, hwnd %p, w 0x%x, l 0x%Ix", \
+ "%s, hwnd %p, w 0x%Ix, l 0x%Ix", \
msg_num_to_name(m), h, w, l)
#endif
diff --git a/tools/jenkins-build.sh b/tools/jenkins-build.sh
index d31b233b4..b8eaf357a 100755
--- a/tools/jenkins-build.sh
+++ b/tools/jenkins-build.sh
@@ -95,6 +95,9 @@ case ${TARGET} in
"i686-w64-mingw32")
;;
+ "x86_64-w64-mingw32")
+ ;;
+
*)
echo "Target \"${TARGET}\" cannot be built on \"${HOST})\""
exit 1
@@ -306,6 +309,11 @@ case ${TARGET} in
export GCCSDK_INSTALL_CROSSBIN=/opt/netsurf/${HOST}/cross/bin
;;
+ "x86_64-w64-mingw32")
+ export GCCSDK_INSTALL_ENV=/opt/netsurf/${HOST}/env
+ export GCCSDK_INSTALL_CROSSBIN=/opt/netsurf/${HOST}/cross/bin
+ ;;
+
"ppc-amigaos")
export GCCSDK_INSTALL_ENV=/opt/netsurf/${HOST}/env
export GCCSDK_INSTALL_CROSSBIN=/opt/netsurf/${HOST}/cross/bin
@@ -365,6 +373,11 @@ case ${TARGET} in
export GCCSDK_INSTALL_CROSSBIN=/opt/netsurf/${HOST}/cross/bin
;;
+ "x86_64-w64-mingw32")
+ export GCCSDK_INSTALL_ENV=/opt/netsurf/${HOST}/env
+ export GCCSDK_INSTALL_CROSSBIN=/opt/netsurf/${HOST}/cross/bin
+ ;;
+
"ppc-amigaos")
export GCCSDK_INSTALL_ENV=/opt/netsurf/${HOST}/env
export GCCSDK_INSTALL_CROSSBIN=/opt/netsurf/${HOST}/cross/bin
--
2.30.2
|
---|