Here's a starting point for an update for pcc to 1.1.0. It builds with
-fno-common and depends on the attached new port of pcc-libs.

On amd64, it compiles a working hello world successfully (with -fPIC)
and produces a usable cat binary with 

  cd /usr/src/bin/cat && make CC=pcc DEBUG=-fpic STATIC=

I would probably still go with 1.0.0 and -fcommon as in my previous
mail, but if anyone is interested in finishing this up, I think it's
not too far off track.

Index: Makefile
===================================================================
RCS file: /cvs/ports/lang/pcc/Makefile,v
retrieving revision 1.21
diff -u -p -r1.21 Makefile
--- Makefile    31 Aug 2020 22:20:49 -0000      1.21
+++ Makefile    4 Feb 2021 17:12:07 -0000
@@ -2,9 +2,8 @@
 
 COMMENT =      portable C compiler
 
-PCCVER =       1.0.0
+PCCVER =       1.1.0
 DISTNAME =     pcc-${PCCVER}
-REVISION =     17
 EXTRACT_SUFX = .tgz
 
 CATEGORIES =   lang
@@ -18,6 +17,8 @@ ONLY_FOR_ARCHS = i386 amd64
 PERMIT_PACKAGE =       Yes
 
 WANTLIB += c
+
+RUN_DEPENDS =  devel/pcc-libs
 
 MASTER_SITES = http://pcc.ludd.ltu.se/ftp/pub/pcc-releases/ \
                ftp://pcc.ludd.ltu.se/pub/pcc-releases/
Index: distinfo
===================================================================
RCS file: /cvs/ports/lang/pcc/distinfo,v
retrieving revision 1.2
diff -u -p -r1.2 distinfo
--- distinfo    18 Jan 2015 03:14:19 -0000      1.2
+++ distinfo    4 Feb 2021 16:57:49 -0000
@@ -1,2 +1,2 @@
-SHA256 (pcc-1.0.0.tgz) = WALbukbW6j+brapVuQRKBBa7QQAgwkpcKoouqvQRVss=
-SIZE (pcc-1.0.0.tgz) = 652308
+SHA256 (pcc-1.1.0.tgz) = 2eP+2Ex2fc3e+2sfhU1dqJIfP2XYvQKZd0NBL0FHTWQ=
+SIZE (pcc-1.1.0.tgz) = 848427
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/lang/pcc/pkg/PLIST,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 PLIST
--- pkg/PLIST   19 Apr 2012 14:47:17 -0000      1.1.1.1
+++ pkg/PLIST   4 Feb 2021 17:11:08 -0000
@@ -1,12 +1,9 @@
 @comment $OpenBSD: PLIST,v 1.1.1.1 2012/04/19 14:47:17 okan Exp $
 @bin bin/pcc
-lib/pcc/
-lib/pcc/${CONFIG}/
-lib/pcc/${CONFIG}/${PCCVER}.RELEASE/
-lib/pcc/${CONFIG}/${PCCVER}.RELEASE/include/
-lib/pcc/${CONFIG}/${PCCVER}.RELEASE/lib/
+@bin bin/pcpp
 @bin libexec/ccom
 @bin libexec/cpp
+@bin libexec/cxxcom
 @man man/man1/ccom.1
 @man man/man1/cpp.1
 @man man/man1/pcc.1
Index: patches/patch-cc_cc_cc_c
===================================================================
RCS file: patches/patch-cc_cc_cc_c
diff -N patches/patch-cc_cc_cc_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-cc_cc_cc_c    4 Feb 2021 17:12:13 -0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+
+Index: cc/cc/cc.c
+--- cc/cc/cc.c.orig
++++ cc/cc/cc.c
+@@ -206,7 +206,7 @@ char *cppmdadd[] = CPPMDADD;
+ #define PCCLIBDIR     NULL
+ #endif
+ #ifndef DEFLIBDIRS    /* default library search paths */
+-#ifdef MULTIARCH_PATH
++#ifndef MULTIARCH_PATH
+ #define DEFLIBDIRS    { "/usr/lib/", 0 }
+ #else
+ #define DEFLIBDIRS    { "/usr/lib/", "/usr/lib/" MULTIARCH_PATH "/", 0 }
Index: patches/patch-cc_ccom_scan_l
===================================================================
RCS file: patches/patch-cc_ccom_scan_l
diff -N patches/patch-cc_ccom_scan_l
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-cc_ccom_scan_l        4 Feb 2021 17:12:13 -0000
@@ -0,0 +1,15 @@
+$OpenBSD$
+
+Index: cc/ccom/scan.l
+--- cc/ccom/scan.l.orig
++++ cc/ccom/scan.l
+@@ -236,7 +236,8 @@ L?\"(\\.|[^\\"])*\"        { yylval.strp = yytext; return 
C_S
+ 
+ %%
+ 
+-int lineno, issyshdr;
++extern int lineno;
++int issyshdr;
+ char *ftitle = "<stdin>";
+ 
+ int
Index: patches/patch-cc_cxxcom_scan_l
===================================================================
RCS file: patches/patch-cc_cxxcom_scan_l
diff -N patches/patch-cc_cxxcom_scan_l
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-cc_cxxcom_scan_l      4 Feb 2021 17:12:13 -0000
@@ -0,0 +1,15 @@
+$OpenBSD$
+
+Index: cc/cxxcom/scan.l
+--- cc/cxxcom/scan.l.orig
++++ cc/cxxcom/scan.l
+@@ -220,7 +220,8 @@ L?\"(\\.|[^\\"])*\"        { yylval.strp = yytext; return 
C_S
+ 
+ %%
+ 
+-int lineno, issyshdr;
++extern int lineno;
++int issyshdr;
+ char *ftitle = "<stdin>";
+ 
+ static int

Attachment: pcc-libs-1.1.0.tgz
Description: application/tar-gz

Reply via email to