summaryrefslogtreecommitdiff
path: root/dev-lang/pcc
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2025-02-25 19:25:33 +0000
committerV3n3RiX <venerix@koprulu.sector>2025-02-25 19:25:33 +0000
commit67dbd3ba144944fbf4b466be1b5fa0569b774e6f (patch)
tree721c7f9085992578da57f71ea0c5becb6827cdb4 /dev-lang/pcc
parentd4653056cc74d97f24bef0d56b4ebe11c53c8b76 (diff)
gentoo auto-resync : 25:02:2025 - 19:25:33
Diffstat (limited to 'dev-lang/pcc')
-rw-r--r--dev-lang/pcc/Manifest2
-rw-r--r--dev-lang/pcc/files/pcc-1.1.0-C23.patch293
-rw-r--r--dev-lang/pcc/pcc-1.1.0-r2.ebuild39
3 files changed, 334 insertions, 0 deletions
diff --git a/dev-lang/pcc/Manifest b/dev-lang/pcc/Manifest
index ee188bf0cf82..eddd2bc2583e 100644
--- a/dev-lang/pcc/Manifest
+++ b/dev-lang/pcc/Manifest
@@ -1,4 +1,6 @@
+AUX pcc-1.1.0-C23.patch 5875 BLAKE2B 13baf8ac90cde3f949890ae44568fac1a7f2b3fa30ffe21bf444fd2e6d9a06e669de93953cc51cd487516a41fca4dea6c3e43241ee99e6532687169ea3deff0e SHA512 d955cebd3a57a85334344cbbe81e329cce66fb2e7b8bda6709a71d1ad69760b1df808a82a517416f761f69a0b5da41cc729188da360fbce260a755d0ebf4b47c
AUX pcc-1.1.0-multiarch.patch 305 BLAKE2B c3162dab579e1b2b268b7de55e5a2dbc70723b41635cfb8543483e1ccc1f3bdf3a9e0d9ba1d7afb036dcaabf4f44c372cbaafb7081404ebed65b726c3b3b1da6 SHA512 5ade01d09929a05fe6dfccf573f3b0742f61bd135f37ebacf2834c44b8bdbbafbb69f0ea1ebf467da4811f756ecd4a7f6753c362d2667c12888d211ae47737f1
DIST pcc-1.1.0.tgz 848427 BLAKE2B f94dd3eb3f96145e3fd2d5d89ca5a3a12c55614924c1bd2ccc219b03b4804bb34904b7041efb6237e06982b3282578d996510ffc9adc916e212f6f7d1bcb5a35 SHA512 5bd2b59fbb323016d215023ce77793ae66766e8e8192b44bf0707ee444658022e1645669c13eea8c81bc55c161eea3b0271d6b3098b8a7d51ce67eb86c7527b4
EBUILD pcc-1.1.0-r1.ebuild 644 BLAKE2B 705887fc5d54daf96f655b0df9ca560412574e6507d3a43f00d136bbf2be7de0135e1252ff938ea041d09b5cc9c297ccae222f529106e0ecc46b51a4be52c75d SHA512 367db32a2dbc84746fa930e55299e393aa9701e269d3e3d149e2dd85329e72bc8a3b2117af4261f8a78fcb7361977deb76a7e3c77bbd15f5881756dc32b276e8
+EBUILD pcc-1.1.0-r2.ebuild 665 BLAKE2B 181e6ab807bb9b0385c8137c6e6c1bdbf23d4ccf27d606f9c56612971d9f6d3baa48a82445f8bb68eca9721830667a0d98f8d9f2d4cea125999a9c1c5970de18 SHA512 e005ef63874c92feb742db7471512cd8860c19564ad37dc79079a6276e99fdcc09cc340824ebce094ca463359b8a29bcac7d56e7a46810bf0eaadea144bcacd0
MISC metadata.xml 248 BLAKE2B 2ac829e1663815f752e218e9ee474448a3d973c075939d578699f57790581498adfe9bad180a79fcc6ea0afc339f57d25cbcc0fdd430f82d192c23c03d15e465 SHA512 55c2e2e06f91e13fd73b9545c51d4169a47f040ead41eb1368479940b026def820de67137312b64a6203f80b57a421c8895ed690386a79086fa0ba6c3557aa47
diff --git a/dev-lang/pcc/files/pcc-1.1.0-C23.patch b/dev-lang/pcc/files/pcc-1.1.0-C23.patch
new file mode 100644
index 000000000000..2c02b58d1037
--- /dev/null
+++ b/dev-lang/pcc/files/pcc-1.1.0-C23.patch
@@ -0,0 +1,293 @@
+Change reserved names to True/False (not actually booleans at all)
+Add includes for libbsd functions
+And enable system extensions, to counteract disabling them and then using them
+https://bugs.gentoo.org/871267
+https://bugs.gentoo.org/932230
+https://bugs.gentoo.org/944894
+--- a/configure.ac
++++ b/configure.ac
+@@ -3,8 +3,9 @@
+
+ AC_PREREQ(2.59)
+ AC_INIT([pcc], [1.1.0], [pcc@lists.ludd.ltu.se])
+ AC_CONFIG_HEADER([config.h])
++AC_USE_SYSTEM_EXTENSIONS
+
+ AC_CANONICAL_TARGET
+
+ abi=unknown
+--- a/cc/ccom/pass1.h
++++ b/cc/ccom/pass1.h
+@@ -37,8 +37,9 @@
+
+ #include <sys/types.h>
+ #include <stdarg.h>
+ #include <string.h>
++#include <bsd/string.h>
+ #ifdef HAVE_STDINT_H
+ #include <stdint.h>
+ #endif
+
+--- a/cc/ccom/trees.c
++++ b/cc/ccom/trees.c
+@@ -2080,9 +2080,9 @@
+ /*
+ * Write out logical expressions as branches.
+ */
+ static void
+-andorbr(NODE *p, int true, int false)
++andorbr(NODE *p, int True, int False)
+ {
+ NODE *q;
+ int o, lab;
+
+@@ -2123,19 +2123,19 @@
+ case LE:
+ case LT:
+ case GE:
+ case GT:
+-calc: if (true < 0) {
++calc: if (True < 0) {
+ p->n_op = negrel[p->n_op - EQ];
+- true = false;
+- false = -1;
++ True = False;
++ False = -1;
+ }
+
+ rmcops(p->n_left);
+ rmcops(p->n_right);
+- fixbranch(p, true);
+- if (false >= 0)
+- branch(false);
++ fixbranch(p, True);
++ if (False >= 0)
++ branch(False);
+ break;
+
+ case ULE:
+ case UGT:
+@@ -2147,57 +2147,57 @@
+ case UGE:
+ case ULT:
+ /* Already true/false by definition */
+ if (nncon(p->n_right) && p->n_right->n_lval == 0) {
+- if (true < 0) {
++ if (True < 0) {
+ o = o == ULT ? UGE : ULT;
+- true = false;
++ True = False;
+ }
+ rmcops(p->n_left);
+ ecode(p->n_left);
+ rmcops(p->n_right);
+ ecode(p->n_right);
+ nfree(p);
+ if (o == UGE) /* true */
+- branch(true);
++ branch(True);
+ break;
+ }
+ goto calc;
+
+ case ANDAND:
+- lab = false<0 ? getlab() : false ;
++ lab = False<0 ? getlab() : False ;
+ andorbr(p->n_left, -1, lab);
+ comops(p->n_right);
+- andorbr(p->n_right, true, false);
+- if (false < 0)
++ andorbr(p->n_right, True, False);
++ if (False < 0)
+ plabel( lab);
+ nfree(p);
+ break;
+
+ case OROR:
+- lab = true<0 ? getlab() : true;
++ lab = True<0 ? getlab() : True;
+ andorbr(p->n_left, lab, -1);
+ comops(p->n_right);
+- andorbr(p->n_right, true, false);
+- if (true < 0)
++ andorbr(p->n_right, True, False);
++ if (True < 0)
+ plabel( lab);
+ nfree(p);
+ break;
+
+ case NOT:
+- andorbr(p->n_left, false, true);
++ andorbr(p->n_left, False, True);
+ nfree(p);
+ break;
+
+ default:
+ rmcops(p);
+- if (true >= 0)
+- fixbranch(p, true);
+- if (false >= 0) {
+- if (true >= 0)
+- branch(false);
++ if (True >= 0)
++ fixbranch(p, True);
++ if (False >= 0) {
++ if (True >= 0)
++ branch(False);
+ else
+- fixbranch(buildtree(EQ, p, bcon(0)), false);
++ fixbranch(buildtree(EQ, p, bcon(0)), False);
+ }
+ }
+ }
+
+--- a/cc/cxxcom/trees.c
++++ b/cc/cxxcom/trees.c
+@@ -2021,9 +2021,9 @@
+ /*
+ * Write out logical expressions as branches.
+ */
+ static void
+-andorbr(NODE *p, int true, int false)
++andorbr(NODE *p, int True, int False)
+ {
+ NODE *q;
+ int o, lab;
+
+@@ -2064,19 +2064,19 @@
+ case LE:
+ case LT:
+ case GE:
+ case GT:
+-calc: if (true < 0) {
++calc: if (True < 0) {
+ p->n_op = negrel[p->n_op - EQ];
+- true = false;
+- false = -1;
++ True = False;
++ False = -1;
+ }
+
+ rmcops(p->n_left);
+ rmcops(p->n_right);
+- fixbranch(p, true);
+- if (false >= 0)
+- branch(false);
++ fixbranch(p, True);
++ if (False >= 0)
++ branch(False);
+ break;
+
+ case ULE:
+ case UGT:
+@@ -2088,57 +2088,57 @@
+ case UGE:
+ case ULT:
+ /* Already true/false by definition */
+ if (nncon(p->n_right) && p->n_right->n_lval == 0) {
+- if (true < 0) {
++ if (True < 0) {
+ o = o == ULT ? UGE : ULT;
+- true = false;
++ True = False;
+ }
+ rmcops(p->n_left);
+ ecode(p->n_left);
+ rmcops(p->n_right);
+ ecode(p->n_right);
+ nfree(p);
+- if (o == UGE) /* true */
+- branch(true);
++ if (o == UGE) /* True */
++ branch(True);
+ break;
+ }
+ goto calc;
+
+ case ANDAND:
+- lab = false<0 ? getlab() : false ;
++ lab = False<0 ? getlab() : False ;
+ andorbr(p->n_left, -1, lab);
+ comops(p->n_right);
+- andorbr(p->n_right, true, false);
+- if (false < 0)
++ andorbr(p->n_right, True, False);
++ if (False < 0)
+ plabel( lab);
+ nfree(p);
+ break;
+
+ case OROR:
+- lab = true<0 ? getlab() : true;
++ lab = True<0 ? getlab() : True;
+ andorbr(p->n_left, lab, -1);
+ comops(p->n_right);
+- andorbr(p->n_right, true, false);
+- if (true < 0)
++ andorbr(p->n_right, True, False);
++ if (True < 0)
+ plabel( lab);
+ nfree(p);
+ break;
+
+ case NOT:
+- andorbr(p->n_left, false, true);
++ andorbr(p->n_left, False, True);
+ nfree(p);
+ break;
+
+ default:
+ rmcops(p);
+- if (true >= 0)
+- fixbranch(p, true);
+- if (false >= 0) {
+- if (true >= 0)
+- branch(false);
++ if (True >= 0)
++ fixbranch(p, True);
++ if (False >= 0) {
++ if (True >= 0)
++ branch(False);
+ else
+- fixbranch(buildtree(EQ, p, bcon(0)), false);
++ fixbranch(buildtree(EQ, p, bcon(0)), False);
+ }
+ }
+ }
+
+--- a/mip/reader.c
++++ b/mip/reader.c
+@@ -65,8 +65,9 @@
+
+ # include "pass2.h"
+
+ #include <string.h>
++#include <bsd/string.h>
+ #include <stdarg.h>
+ #include <stdlib.h>
+
+ /* some storage declarations */
+--- a/mip/match.c
++++ b/mip/match.c
+@@ -59,8 +59,9 @@
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
++#include "config.h"
+ #include "pass2.h"
+
+ #ifdef HAVE_STRINGS_H
+ #include <strings.h>
+--- a/mip/regs.c
++++ b/mip/regs.c
+@@ -25,8 +25,9 @@
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
++#include "config.h"
+ #include "pass2.h"
+ #include <string.h>
+ #ifdef HAVE_STRINGS_H
+ #include <strings.h>
diff --git a/dev-lang/pcc/pcc-1.1.0-r2.ebuild b/dev-lang/pcc/pcc-1.1.0-r2.ebuild
new file mode 100644
index 000000000000..1faaeefa3648
--- /dev/null
+++ b/dev-lang/pcc/pcc-1.1.0-r2.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools flag-o-matic
+
+DESCRIPTION="pcc portable c compiler"
+HOMEPAGE="http://pcc.ludd.ltu.se"
+
+SRC_URI="ftp://pcc.ludd.ltu.se/pub/pcc-releases/${P}.tgz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+DEPEND=">=dev-libs/pcc-libs-${PV}
+ dev-libs/libbsd"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}/${P}-multiarch.patch"
+ "${FILESDIR}/${P}-C23.patch"
+)
+
+src_prepare() {
+ default
+
+ eautoreconf
+}
+
+src_configure() {
+ append-cflags -fcommon
+ econf --disable-stripping
+}
+
+src_test() {
+ cc/cc/pcc --version || die # basic test that compiler runs
+}