Work around build failure on i386 caused by internal compiler error

On i386, cc1plus hits an internal error when building gfx/wr/swgl/src/gl.cc
with -O2 or -O1. This change adjusts the build script to force -O0.
This commit is contained in:
manu 2021-08-25 11:50:43 +00:00
parent 47077ec1cc
commit e8dcdfe6ad
3 changed files with 34 additions and 2 deletions

View file

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.490 2021/08/24 16:36:01 ryoon Exp $
# $NetBSD: Makefile,v 1.491 2021/08/25 11:50:43 manu Exp $
FIREFOX_VER= ${MOZ_BRANCH}${MOZ_BRANCH_MINOR}
MOZ_BRANCH= 91.0
@ -6,6 +6,7 @@ MOZ_BRANCH_MINOR= .2
DISTNAME= firefox-${FIREFOX_VER}.source
PKGNAME= ${DISTNAME:S/.source//:S/b/beta/:S/esr//}
PKGREVISION= 1
CATEGORIES= www
MASTER_SITES+= ${MASTER_SITE_MOZILLA:=firefox/releases/${FIREFOX_VER}/source/}
EXTRACT_SUFX= .tar.xz

View file

@ -1,4 +1,4 @@
$NetBSD: distinfo,v 1.443 2021/08/24 16:36:01 ryoon Exp $
$NetBSD: distinfo,v 1.444 2021/08/25 11:50:43 manu Exp $
SHA1 (firefox-91.0.2.source.tar.xz) = 953eb52799ae1da9ea63e154e1b3194c10bca8ce
RMD160 (firefox-91.0.2.source.tar.xz) = 22b066a0f891aca3c9512501b01e556a6b5414e5
@ -19,6 +19,7 @@ SHA1 (patch-gfx_angle_checkout_src_compiler_translator_InfoSink.h) = 2f73c76c488
SHA1 (patch-gfx_cairo_cairo_src_cairo-type1-subset.c) = 89a9d934ef76706c552c0b81e6cbc0f45b1ffd2c
SHA1 (patch-gfx_skia_skia_src_core_SkCpu.cpp) = 36218819254f3681b9c717d652ea78c9f20d49ad
SHA1 (patch-gfx_thebes_gfxPlatform.cpp) = f6f8996f0818a1b890698c7cc5054d49cb1e8924
SHA1 (patch-gfx_wr_swgl_build.rs) = 6b9d7528f07a89638f83dc2527f658c6b10f152b
SHA1 (patch-ipc_chromium_src_base_message__pump__libevent.cc) = 4a6606da590cfb8d855bde58b9c6f90e98d0870c
SHA1 (patch-ipc_chromium_src_base_platform__thread__posix.cc) = 35d20981d33ccdb1d8ffb8039e48798777f11658
SHA1 (patch-ipc_glue_GeckoChildProcessHost.cpp) = 260c29bacd8bf265951b7a412f850bf2b292c836

View file

@ -0,0 +1,30 @@
$NetBSD: patch-gfx_wr_swgl_build.rs,v 1.1 2021/08/25 11:50:43 manu Exp $
Work around an internal compiler error on i386 when optimization is enabled:
cargo:warning=In file included from src/gl.cc:2637:0:
cargo:warning=src/rasterize.h: In function 'void draw_quad_spans(int, Point2D*, uint32_t, glsl::Interpolants*, Texture&, Texture&, const ClipRect&) [with P = unsigned char]':
cargo:warning=src/rasterize.h:782:20: internal compiler error: in convert_move, at expr.c:231
cargo:warning= static inline void draw_quad_spans(int nump, Point2D p[4], uint32_t z,
cargo:warning= ^~~~~~~~~~~~~~~
--- gfx/wr/swgl/build.rs.orig 2021-08-24 17:33:31.320811394 +0200
+++ gfx/wr/swgl/build.rs 2021-08-25 03:00:14.918972216 +0200
@@ -195,8 +195,16 @@
.flag("-mrecip=none");
}
}
+ // Work around a compiler bug
+ let target_triple = std::env::var("TARGET").expect("The TARGET environment variab
+le must be set");
+ let target_name = target_triple.split('-').next().unwrap();
+ if ["i386", "i586", "i686"].contains(&target_name) {
+ build.flag("-O0");
+ }
+
build.file("src/gl.cc")
.define("_GLIBCXX_USE_CXX11_ABI", Some("0"))
.include(shader_dir)
.include("src")