git: 0de5507c162d - main - lang/fpc: Fix build issue on lazarus i386 and amd64

From: Jose Alonso Cardenas Marquez <acm_at_FreeBSD.org>
Date: Thu, 03 Feb 2022 05:07:25 UTC
The branch main has been updated by acm:

URL: https://cgit.FreeBSD.org/ports/commit/?id=0de5507c162d2a04212efa2770a1a9ed56626030

commit 0de5507c162d2a04212efa2770a1a9ed56626030
Author:     Jose Alonso Cardenas Marquez <acm@FreeBSD.org>
AuthorDate: 2022-02-03 04:49:16 +0000
Commit:     Jose Alonso Cardenas Marquez <acm@FreeBSD.org>
CommitDate: 2022-02-03 05:07:13 +0000

    lang/fpc: Fix build issue on lazarus i386 and amd64
    
    - Bump PORTREVISION
    - Disable some default OPTIONS
    Obtained from:  https://forum.lazarus.freepascal.org/index.php/topic,57752.msg429737.html#msg429737
---
 databases/fpc-mysql/Makefile                  |  1 -
 databases/fpc-postgres/Makefile               |  1 -
 databases/fpc-sqlite/Makefile                 |  1 -
 games/hedgewars/Makefile                      |  2 +-
 lang/fpc/Makefile                             |  2 +-
 lang/fpc/files/patch-compiler-x86_aoptx86.pas | 72 +++++++++++++++++++++++++++
 lang/nbc/Makefile                             |  2 +-
 net/fpc-ldap/Makefile                         |  2 +-
 science/checkmol/Makefile                     |  2 +-
 science/checkmol/pkg-descr                    |  2 +-
 science/mol2ps/Makefile                       |  2 +-
 science/mol2ps/pkg-descr                      |  2 +-
 12 files changed, 80 insertions(+), 11 deletions(-)

diff --git a/databases/fpc-mysql/Makefile b/databases/fpc-mysql/Makefile
index 0d7289cf2d56..3bf401f20996 100644
--- a/databases/fpc-mysql/Makefile
+++ b/databases/fpc-mysql/Makefile
@@ -13,7 +13,6 @@ EXTRACTUNITDIR=	${WRKUNITDIR}
 
 OPTIONS_DEFINE=	MYSQL
 MYSQL_DESC=	Install MySQL client
-OPTIONS_DEFAULT=	MYSQL
 
 MYSQL_USES=	mysql
 
diff --git a/databases/fpc-postgres/Makefile b/databases/fpc-postgres/Makefile
index 3bd71d124b1a..3c9652ffedeb 100644
--- a/databases/fpc-postgres/Makefile
+++ b/databases/fpc-postgres/Makefile
@@ -13,7 +13,6 @@ EXTRACTUNITDIR=	${WRKUNITDIR}
 
 OPTIONS_DEFINE=	PGSQL
 PGSQL_DESC=	Install PostgreSQL client
-OPTIONS_DEFAULT=	PGSQL
 
 PGSQL_USES=	pgsql
 
diff --git a/databases/fpc-sqlite/Makefile b/databases/fpc-sqlite/Makefile
index a5aba95c0beb..eacfa3a049b1 100644
--- a/databases/fpc-sqlite/Makefile
+++ b/databases/fpc-sqlite/Makefile
@@ -10,7 +10,6 @@ WRKUNITDIR=	${FPCSRCDIR}/packages/${PKGNAMESUFFIX:S/-//}
 EXTRACTUNITDIR=	${WRKUNITDIR}
 
 OPTIONS_DEFINE=	SQLITE
-OPTIONS_DEFAULT=	SQLITE
 
 SQLITE_USES=	sqlite
 
diff --git a/games/hedgewars/Makefile b/games/hedgewars/Makefile
index 7f94682f8dda..b30a4292b87f 100644
--- a/games/hedgewars/Makefile
+++ b/games/hedgewars/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	hedgewars
 PORTVERSION=	1.0.0
-PORTREVISION=	6
+PORTREVISION=	7
 CATEGORIES=	games
 MASTER_SITES=	http://www.hedgewars.org/download/releases/ \
 		http://mirror.amdmi3.ru/distfiles/
diff --git a/lang/fpc/Makefile b/lang/fpc/Makefile
index ca156b85ee75..b64e3d709aa0 100644
--- a/lang/fpc/Makefile
+++ b/lang/fpc/Makefile
@@ -2,7 +2,7 @@
 
 PORTNAME=	fpc
 PORTVERSION=	3.2.2
-PORTREVISION?=	0
+PORTREVISION?=	1
 CATEGORIES?=	lang
 MASTER_SITES=	ftp://ftp.freepascal.org/pub/fpc/dist/${PORTVERSION}/source/:source \
 		ftp://planetmirror.com/pub/fpc/dist/${PORTVERSION}/source/:source \
diff --git a/lang/fpc/files/patch-compiler-x86_aoptx86.pas b/lang/fpc/files/patch-compiler-x86_aoptx86.pas
new file mode 100644
index 000000000000..d07688bb55ed
--- /dev/null
+++ b/lang/fpc/files/patch-compiler-x86_aoptx86.pas
@@ -0,0 +1,72 @@
+--- compiler/x86/aoptx86.pas	2022-01-25 22:18:01.236523000 -0500
++++ compiler/x86/aoptx86.pas	2022-01-25 22:34:15.492397000 -0500
+@@ -2761,6 +2761,7 @@
+                       if (l<=4) and (l>0) then
+                         begin
+                           condition:=inverse_cond(taicpu(p).condition);
++                          UpdateUsedRegs(tai(p.next));
+                           GetNextInstruction(p,hp1);
+                           repeat
+                             if not Assigned(hp1) then
+@@ -2768,7 +2769,7 @@
+ 
+                             taicpu(hp1).opcode:=A_CMOVcc;
+                             taicpu(hp1).condition:=condition;
+-                            UpdateUsedRegs(hp1);
++                            UpdateUsedRegs(tai(hp1.next));
+                             GetNextInstruction(hp1,hp1);
+                           until not(CanBeCMOV(hp1));
+ 
+@@ -2815,6 +2816,7 @@
+                           asml.Remove(p);
+                           p.Free;
+ 
++                          UpdateUsedRegs(tai(hp2.next));
+                           GetNextInstruction(hp2, p); { Instruction after the label }
+ 
+                           { Remove the label if this is its final reference }
+@@ -2878,6 +2880,7 @@
+                              FindLabel(tasmlabel(taicpu(hp2).oper[0]^.ref^.symbol),hp1) then
+                              begin
+                                 condition:=inverse_cond(taicpu(p).condition);
++                                UpdateUsedRegs(tai(p.next));
+                                 GetNextInstruction(p,hp1);
+                                 repeat
+                                   taicpu(hp1).opcode:=A_CMOVcc;
+@@ -2888,19 +2891,23 @@
+                                   not(CanBeCMOV(hp1));
+ 
+                                 condition:=inverse_cond(condition);
++                                if GetLastInstruction(hpmov2,hp1) then
++                                  UpdateUsedRegs(tai(hp1.next));
++
+                                 hp1 := hpmov2;
+                                 { hp1 is now at <several movs 2> }
+                                 while Assigned(hp1) and CanBeCMOV(hp1) do
+                                   begin
+                                     taicpu(hp1).opcode:=A_CMOVcc;
+                                     taicpu(hp1).condition:=condition;
+-                                    UpdateUsedRegs(hp1);
++                                    UpdateUsedRegs(tai(hp1.next));
+                                     GetNextInstruction(hp1,hp1);
+                                   end;
+ 
+                                 hp1 := p;
+ 
+                                 { Get first instruction after label }
++                                UpdateUsedRegs(tai(hp3.next));
+                                 GetNextInstruction(hp3, p);
+ 
+                                 if assigned(p) and (hp3.typ = ait_align) then
+@@ -2955,10 +2962,7 @@
+                                   end;
+ 
+                                 if Assigned(p) then
+-                                  begin
+-                                    UpdateUsedRegs(p);
+-                                    result:=true;
+-                                  end;
++                                  result:=true;
+                                 exit;
+                              end;
+                          end;
diff --git a/lang/nbc/Makefile b/lang/nbc/Makefile
index d1da83e2dd53..b539144e5ab7 100644
--- a/lang/nbc/Makefile
+++ b/lang/nbc/Makefile
@@ -2,7 +2,7 @@
 
 PORTNAME=		nbc
 PORTVERSION=		1.2.1.r4
-PORTREVISION=		19
+PORTREVISION=		20
 CATEGORIES=		lang
 MASTER_SITES=		SF/bricxcc/NBC_NXC/NBC%20release%20${PORTVERSION:S/.r/%20r/}
 DISTNAME=		${PORTNAME}-${PORTVERSION}.src
diff --git a/net/fpc-ldap/Makefile b/net/fpc-ldap/Makefile
index 68e6ddb9cf0c..60fac8f72b58 100644
--- a/net/fpc-ldap/Makefile
+++ b/net/fpc-ldap/Makefile
@@ -1,6 +1,6 @@
 # Created by: Christopher Key <cjk32@cam.ac.uk>
 
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	net lang
 PKGNAMESUFFIX=	-ldap
 
diff --git a/science/checkmol/Makefile b/science/checkmol/Makefile
index 85665a6de3dd..54d0c5405657 100644
--- a/science/checkmol/Makefile
+++ b/science/checkmol/Makefile
@@ -2,7 +2,7 @@
 
 PORTNAME=	checkmol
 PORTVERSION=	0.5
-PORTREVISION=	11
+PORTREVISION=	12
 CATEGORIES=	science
 MASTER_SITES=	https://homepage.univie.ac.at/norbert.haider/download/chemistry/checkmol/
 DISTFILES=	${PORTNAME}
diff --git a/science/checkmol/pkg-descr b/science/checkmol/pkg-descr
index 8a25fdab05b4..748ea1fb84cb 100644
--- a/science/checkmol/pkg-descr
+++ b/science/checkmol/pkg-descr
@@ -24,4 +24,4 @@ chemical databases.
 
 The port installs both checkmol and matchmol.
 
-WWW: http://merian.pch.univie.ac.at/~nhaider/cheminf/cmmm.html
+WWW: https://homepage.univie.ac.at/norbert.haider/cheminf/cmmm.html
diff --git a/science/mol2ps/Makefile b/science/mol2ps/Makefile
index 31d63016560a..69a6b0606281 100644
--- a/science/mol2ps/Makefile
+++ b/science/mol2ps/Makefile
@@ -2,7 +2,7 @@
 
 PORTNAME=	mol2ps
 PORTVERSION=	0.4b
-PORTREVISION=	9
+PORTREVISION=	10
 CATEGORIES=	science
 MASTER_SITES=	https://homepage.univie.ac.at/norbert.haider/download/chemistry/mol2ps/
 DISTNAME=	${PORTNAME}
diff --git a/science/mol2ps/pkg-descr b/science/mol2ps/pkg-descr
index 518ed9152c63..2c036e8dc3ef 100644
--- a/science/mol2ps/pkg-descr
+++ b/science/mol2ps/pkg-descr
@@ -4,4 +4,4 @@ Postscript output for 2D display. The Postscript file can then be used
 e.g. for creating a bitmap file, using a Postscript interpreter like
 Ghostscript.
 
-WWW: http://merian.pch.univie.ac.at/~nhaider/cheminf/mol2ps.html
+WWW: https://homepage.univie.ac.at/norbert.haider/cheminf/mol2ps.html