Skip to content

Commit

Permalink
lang/gprolog: update to 1.5.0
Browse files Browse the repository at this point in the history
Port changes:

- the version 1.5.0 now recognizes clang for amd64 so
  the patch files/patch-EnginePl_machine.h reduced but
  it is still needed for i386 build;
- this version correctly defines NO_MACHINE_REG_FOR_REG_BANK
  and adds -fcommon for clang, so CFLAGS reduced too;
- the patch files/patch-Ma2Asm_x86__64__any.c rebuilt for new code,
  it is still needed as build fails with an error without the patch:
Fatal Error: Segmentation Violation (bad address: 0x100ec814853)
  • Loading branch information
Eugene Grosbein authored and Eugene Grosbein committed Jul 10, 2021
1 parent 697a4b6 commit 941d1da
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 63 deletions.
4 changes: 2 additions & 2 deletions lang/gprolog/Makefile
@@ -1,7 +1,7 @@
# Created by: Douglas Anestad <yotta@dougdidit.com>

PORTNAME= gprolog
PORTVERSION= 1.4.5
PORTVERSION= 1.5.0
CATEGORIES= lang
MASTER_SITES= http://www.gprolog.org/

Expand All @@ -16,7 +16,7 @@ BUILD_DEPENDS= as:devel/binutils

USES= gmake
CFLAGS+= -DUSE_LOCKS=1 -DUSE_RECURSIVE_LOCKS=1 -DUSE_SPIN_LOCKS=0 \
-DMMAP_CLEARS=0 -DNO_MACHINE_REG_FOR_REG_BANK -fcommon
-DMMAP_CLEARS=0

PLIST_SUB= GPROLOG_VER=${PORTVERSION}
GNU_CONFIGURE= yes
Expand Down
6 changes: 3 additions & 3 deletions lang/gprolog/distinfo
@@ -1,3 +1,3 @@
TIMESTAMP = 1606049432
SHA256 (gprolog-1.4.5.tar.gz) = ce5335d1607f0b01d5567252211ae2b19e6a5e52b62978717880524748afb9a2
SIZE (gprolog-1.4.5.tar.gz) = 3585704
TIMESTAMP = 1625944809
SHA256 (gprolog-1.5.0.tar.gz) = 670642b43c0faa27ebd68961efb17ebe707688f91b6809566ddd606139512c01
SIZE (gprolog-1.5.0.tar.gz) = 3813899
9 changes: 0 additions & 9 deletions lang/gprolog/files/patch-EnginePl_machine.h
Expand Up @@ -9,12 +9,3 @@

#ifdef NO_USE_EBP
# define M_USED_REGS {"ebx", 0}
@@ -137,7 +137,7 @@ void M_Check_Magic_Words(void); /* not c
# define M_USED_REGS {"15", "20", 0}
/* on M_x86_64_darwin Lion r12-r15 do not work (why ?) */
-#elif defined(M_x86_64) && !defined(_MSC_VER) && !defined(M_x86_64_darwin)
+#elif defined(M_x86_64) && !defined(_MSC_VER) && !defined(M_x86_64_darwin) && !defined(__clang__)

# define M_USED_REGS {"r12", "r13", "r14", "r15", 0}
70 changes: 25 additions & 45 deletions lang/gprolog/files/patch-Ma2Asm_x86__64__any.c
@@ -1,57 +1,37 @@
--- Ma2Asm/x86_64_any.c.orig 2018-10-23 15:17:17 UTC
+++ Ma2Asm/x86_64_any.c
@@ -112,6 +112,9 @@
* Global Variables *
*---------------------------------*/

+int can_produce_pic_code = 1; /* overwritte var of ma2asm.c */
+extern int pic_code;
+
static double dbl_tbl[MAX_DOUBLES_IN_PRED];
static int nb_dbl = 0;
static int dbl_lc_no = 0;
@@ -149,7 +152,6 @@ static const char *fpr_arg[MAX_FPR_ARGS]
#endif
/* variables for ma_parser.c / ma2asm.c */

-int can_produce_pic_code = 1;
char *comment_prefix = "#";
#ifdef M_x86_64_darwin
char *local_symb_prefix = "L";
@@ -210,10 +212,8 @@ Asm_Start(void)
--- Ma2Asm/x86_64_any.c.orig 2021-07-07 17:13:02.000000000 +0700
+++ Ma2Asm/x86_64_any.c 2021-07-11 03:18:18.347365000 +0700
@@ -232,8 +232,8 @@ Asm_Start(void)
strcpy(asm_reg_cp, Off_Reg_Bank(MAP_OFFSET_CP));
#endif

-#if defined(M_x86_64_darwin) || defined(M_x86_64_bsd)
- pic_code = 1; /* NB: on darwin and BSD everything is PIC code */
-#elif defined(M_x86_64_linux) && __GNUC__ >= 6 /* gcc >= 6 needs PIC for linux */
- pic_code = 1;
+#ifdef M_x86_64_darwin
+ pic_code = 1; /* NB: on darwin everything is PIC code */
-#if defined(M_darwin) || defined(M_bsd)
- pic_code = TRUE; /* NB: on darwin and BSD everything is PIC code */
+#if defined(M_darwin)
+ pic_code = TRUE; /* NB: on darwin everything is PIC code */
#elif defined(M_linux) && __GNUC__ >= 6 /* gcc >= 6 needs PIC for linux */
pic_code = FALSE;
#elif defined(_WIN32)
pic_code = 0; /* NB: on MinGW nothing is needed for PIC code */
#endif
@@ -1199,9 +1199,9 @@ Dico_Long(char *name, int global, VType
size_bytes = value * 8;
#ifdef M_x86_64_darwin
if (!global)
- Label_Printf(".zerofill __DATA,__bss," UN "%s,%" PL_FMT_d ",4", name, size_bytes);
+ Label_Printf(".zerofill __DATA,__bss," UN "%s,%" PL_FMT_d ",3", name, size_bytes);
@@ -1242,9 +1242,9 @@ Dico_Long(LongInf *l)
size_bytes = l->value * 8;
#ifdef M_darwin
if (!l->global)
- Label_Printf(".zerofill __DATA,__bss," UN "%s,%" PL_FMT_d ",4", l->name, size_bytes);
+ Label_Printf(".zerofill __DATA,__bss," UN "%s,%" PL_FMT_d ",3", l->name, size_bytes);
else
- Inst_Printf(".comm", UN "%s,%" PL_FMT_d ",4", name, size_bytes);
+ Inst_Printf(".comm", UN "%s,%" PL_FMT_d ",3", name, size_bytes);
- Inst_Printf(".comm", UN "%s,%" PL_FMT_d ",4", l->name, size_bytes);
+ Inst_Printf(".comm", UN "%s,%" PL_FMT_d ",3", l->name, size_bytes);
#else
#if defined(M_x86_64_linux) || defined(M_x86_64_sco) || \
defined(M_x86_64_solaris) || defined(M_x86_64_bsd)
@@ -1226,11 +1226,6 @@ Dico_Long(char *name, int global, VType
#if defined(M_linux) || defined(M_sco) || defined(M_solaris) || defined(M_bsd)
if (!l->global)
@@ -1268,11 +1268,6 @@ Dico_Long(LongInf *l)
case INITIAL_VALUE:
if (global)
Inst_Printf(".globl", UN "%s", name);
-#ifdef M_x86_64_darwin
if (l->global)
Inst_Printf(".globl", UN "%s", l->name);
-#ifdef M_darwin
- Inst_Printf(".align", "3");
-#else
- Inst_Printf(".align", "8");
-#endif
#if !(defined(M_x86_64_darwin) || defined(_WIN32))
Inst_Printf(".size", UN "%s,8", name);
#if !(defined(M_darwin) || defined(_WIN32))
Inst_Printf(".size", UN "%s,8", l->name);
#endif
12 changes: 8 additions & 4 deletions lang/gprolog/pkg-plist
Expand Up @@ -29,17 +29,19 @@ gprolog-%%GPROLOG_VER%%/lib/libbips_pl.a
gprolog-%%GPROLOG_VER%%/lib/libengine_pl.a
gprolog-%%GPROLOG_VER%%/lib/liblinedit.a
gprolog-%%GPROLOG_VER%%/lib/top_level.o
gprolog-%%GPROLOG_VER%%/lib/top_level_main.o
%%PORTDOCS%%%%DOCSDIR%%/compil-scheme.eps
%%PORTDOCS%%%%DOCSDIR%%/compil-scheme.pdf
%%PORTDOCS%%%%DOCSDIR%%/contents_motif.gif
%%PORTDOCS%%%%DOCSDIR%%/compil-scheme.png
%%PORTDOCS%%%%DOCSDIR%%/debug-box.eps
%%PORTDOCS%%%%DOCSDIR%%/debug-box.pdf
%%PORTDOCS%%%%DOCSDIR%%/debug-box.png
%%PORTDOCS%%%%DOCSDIR%%/gprolog.chm
%%PORTDOCS%%%%DOCSDIR%%/gprolog.dvi
%%PORTDOCS%%%%DOCSDIR%%/gprolog.html
%%PORTDOCS%%%%DOCSDIR%%/gprolog.pdf
%%PORTDOCS%%%%DOCSDIR%%/gprolog.ps
%%PORTDOCS%%%%DOCSDIR%%/html_node/contents_motif.gif
%%PORTDOCS%%%%DOCSDIR%%/html_node/contents_motif.svg
%%PORTDOCS%%%%DOCSDIR%%/html_node/gprolog-idx.html
%%PORTDOCS%%%%DOCSDIR%%/html_node/gprolog.css
%%PORTDOCS%%%%DOCSDIR%%/html_node/gprolog001.html
Expand Down Expand Up @@ -116,16 +118,18 @@ gprolog-%%GPROLOG_VER%%/lib/top_level.o
%%PORTDOCS%%%%DOCSDIR%%/html_node/gprolog072.html
%%PORTDOCS%%%%DOCSDIR%%/html_node/gprolog073.html
%%PORTDOCS%%%%DOCSDIR%%/html_node/index.html
%%PORTDOCS%%%%DOCSDIR%%/html_node/next_motif.gif
%%PORTDOCS%%%%DOCSDIR%%/html_node/previous_motif.gif
%%PORTDOCS%%%%DOCSDIR%%/html_node/next_motif.svg
%%PORTDOCS%%%%DOCSDIR%%/html_node/previous_motif.svg
%%PORTDOCS%%%%DOCSDIR%%/logo.eps
%%PORTDOCS%%%%DOCSDIR%%/logo.pdf
%%PORTDOCS%%%%DOCSDIR%%/logo.png
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ExamplesC/Makefile
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ExamplesC/README
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ExamplesC/examp.pl
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ExamplesC/examp_c.c
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ExamplesC/new_main.pl
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ExamplesC/new_main_c.c
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ExamplesFD/BUILD_HOUSE.pl
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ExamplesFD/Makefile
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ExamplesFD/alpha.pl
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/ExamplesFD/array.pl
Expand Down

0 comments on commit 941d1da

Please sign in to comment.