mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-09 05:10:05 +02:00
sdcc: new version
This commit is contained in:
@@ -1,716 +0,0 @@
|
||||
From 66447125e5dfb95c8dd070ef443c1d2f0e640e88 Mon Sep 17 00:00:00 2001
|
||||
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
|
||||
Date: Sun, 14 Sep 2014 12:25:39 +0200
|
||||
Subject: Add Haiku to sdbinutils conig.bfd
|
||||
|
||||
So we don't get an "unknown operating system" during build.
|
||||
|
||||
diff --git a/support/sdbinutils/bfd/config.bfd b/support/sdbinutils/bfd/config.bfd
|
||||
index 6d34c6d..52c91b0 100644
|
||||
--- a/support/sdbinutils/bfd/config.bfd
|
||||
+++ b/support/sdbinutils/bfd/config.bfd
|
||||
@@ -811,6 +811,10 @@ case "${targ}" in
|
||||
want64=true
|
||||
targ_underscore=no
|
||||
;;
|
||||
+ x86_64-*-haiku*)
|
||||
+ targ_defvec=x86_64_elf64_vec
|
||||
+ want64=true
|
||||
+ ;;
|
||||
x86_64-*-rdos*)
|
||||
targ_defvec=x86_64_elf64_vec
|
||||
want64=true
|
||||
@@ -853,6 +857,9 @@ case "${targ}" in
|
||||
targ_defvec=i386_elf32_vec
|
||||
targ_selvecs="iamcu_elf32_vec i386_pe_vec i386_pei_vec"
|
||||
;;
|
||||
+ i[3-7]86-*-haiku*)
|
||||
+ targ_defvec=i386_elf32_vec
|
||||
+ ;;
|
||||
i[3-7]86-*-interix*)
|
||||
targ_defvec=i386_pei_vec
|
||||
targ_selvecs="i386_pe_vec"
|
||||
--
|
||||
2.37.3
|
||||
|
||||
|
||||
From aa4c0980ba7455e3d78f31fe3998348cc98c62a6 Mon Sep 17 00:00:00 2001
|
||||
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
|
||||
Date: Sun, 14 Sep 2014 12:26:14 +0200
|
||||
Subject: Missing includes.
|
||||
|
||||
These are not needed on Linux, but they are on Haiku
|
||||
|
||||
diff --git a/sim/ucsim/cmd.src/newcmdposixcl.h b/sim/ucsim/cmd.src/newcmdposixcl.h
|
||||
index bba26c5..edb2db7 100644
|
||||
--- a/sim/ucsim/cmd.src/newcmdposixcl.h
|
||||
+++ b/sim/ucsim/cmd.src/newcmdposixcl.h
|
||||
@@ -33,6 +33,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
#include "newcmdcl.h"
|
||||
#include "cmdutil.h"
|
||||
|
||||
+#include <sys/select.h>
|
||||
|
||||
/*
|
||||
* Command fd console
|
||||
diff --git a/sim/ucsim/pobj.cc b/sim/ucsim/pobj.cc
|
||||
index 84d8861..cbe486d 100644
|
||||
--- a/sim/ucsim/pobj.cc
|
||||
+++ b/sim/ucsim/pobj.cc
|
||||
@@ -33,6 +33,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
+#include <strings.h>
|
||||
|
||||
#include "pstr.h"
|
||||
/*#include "pobjt.h"*/
|
||||
--
|
||||
2.37.3
|
||||
|
||||
|
||||
From f442eebd423e92de5acb950fd58c74b0459efd6c Mon Sep 17 00:00:00 2001
|
||||
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
|
||||
Date: Sun, 15 Jan 2017 20:50:32 +0100
|
||||
Subject: sdcpp: add missing include path
|
||||
|
||||
|
||||
diff --git a/support/cpp/configure.ac b/support/cpp/configure.ac
|
||||
index cbf4e07..34435cb 100644
|
||||
--- a/support/cpp/configure.ac
|
||||
+++ b/support/cpp/configure.ac
|
||||
@@ -217,7 +217,7 @@ AC_FUNC_MMAP_FILE
|
||||
|
||||
# We will need to find libiberty.h and ansidecl.h
|
||||
saved_CFLAGS="$CFLAGS"
|
||||
-CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/libiberty -I${srcdir}/libcpp/include"
|
||||
+CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/../libiberty -I${srcdir}/libcpp/include -I${srcdir}/../sdbinutils/include"
|
||||
gcc_AC_CHECK_DECLS(getenv abort strsignal errno \
|
||||
malloc realloc calloc free clock, , ,[
|
||||
#include "ansidecl.h"
|
||||
--
|
||||
2.37.3
|
||||
|
||||
|
||||
From dd799e32d1e14eaebba8c6c6a91615f24695f8aa Mon Sep 17 00:00:00 2001
|
||||
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
|
||||
Date: Fri, 22 Jan 2016 21:01:19 +0100
|
||||
Subject: Kevin Thacker's patch for runtime relocation support.
|
||||
|
||||
This patch is used to build the Contiki operating system for Z80
|
||||
machines.
|
||||
|
||||
This version is modified for SDCC 4.2, the addresses are now internally
|
||||
stored on 24 bits instead of 16 bits (to help support banked code), and
|
||||
the code in the patch was adjusted for that.
|
||||
|
||||
diff --git a/sdas/linksrc/Makefile.in b/sdas/linksrc/Makefile.in
|
||||
index 43e16f5..e37b167 100644
|
||||
--- a/sdas/linksrc/Makefile.in
|
||||
+++ b/sdas/linksrc/Makefile.in
|
||||
@@ -47,7 +47,7 @@ ASXXLIBSRC = strcmpi.c
|
||||
SRC = lk_readnl.c lkaomf51.c lkar.c lkarea.c lkdata.c lkelf.c lkeval.c \
|
||||
lkhead.c lklex.c lklib.c lklibr.c lklist.c lkmain.c lkmem.c \
|
||||
lknoice.c lkout.c lkrel.c lkrloc.c lkrloc3.c lks19.c lksdcclib.c \
|
||||
- lksym.c sdld.c lksdcdb.c lkbank.c
|
||||
+ lksym.c sdld.c lksdcdb.c lkbank.c lkrrel.c
|
||||
|
||||
LKSOURCES = $(SRC) $(ASXXLIBSRC:%.c=$(ASXXLIB)/%.c)
|
||||
|
||||
diff --git a/sdas/linksrc/aslink.h b/sdas/linksrc/aslink.h
|
||||
index 94c2b7b..f898a19 100644
|
||||
--- a/sdas/linksrc/aslink.h
|
||||
+++ b/sdas/linksrc/aslink.h
|
||||
@@ -1033,6 +1033,8 @@ extern int yflag; /* -y, enable SDCC Debug output
|
||||
*/
|
||||
#endif
|
||||
|
||||
+extern int hflag; /* Generate relocatable executable
|
||||
+ */
|
||||
extern int pflag; /* print linker command file flag
|
||||
*/
|
||||
extern int uflag; /* Listing relocation flag
|
||||
diff --git a/sdas/linksrc/lkdata.c b/sdas/linksrc/lkdata.c
|
||||
index 169e8c1..8686631 100644
|
||||
--- a/sdas/linksrc/lkdata.c
|
||||
+++ b/sdas/linksrc/lkdata.c
|
||||
@@ -66,6 +66,9 @@ int oflag; /* Output file type flag
|
||||
int objflg; /* Linked file/library object output flag
|
||||
*/
|
||||
|
||||
+int hflag; /* Generate relocatable executable
|
||||
+ */
|
||||
+
|
||||
#if NOICE
|
||||
int jflag; /* NoICE output flag
|
||||
*/
|
||||
diff --git a/sdas/linksrc/lkmain.c b/sdas/linksrc/lkmain.c
|
||||
index daf5515..d690d46 100644
|
||||
--- a/sdas/linksrc/lkmain.c
|
||||
+++ b/sdas/linksrc/lkmain.c
|
||||
@@ -212,6 +212,7 @@ main(int argc, char *argv[])
|
||||
startp->f_idp = "";
|
||||
|
||||
pflag = 1;
|
||||
+ hflag = 0;
|
||||
|
||||
for(i=1; i<argc; i++) {
|
||||
ip = ib;
|
||||
@@ -979,6 +980,11 @@ parse()
|
||||
}
|
||||
return(0);
|
||||
|
||||
+ case 'h':
|
||||
+ case 'H':
|
||||
+ hflag = 1;
|
||||
+ break;
|
||||
+
|
||||
case 'I':
|
||||
if (is_sdld() && !(TARGET_IS_Z80 || TARGET_IS_GB)) {
|
||||
iramsav();
|
||||
diff --git a/sdas/linksrc/lkrloc3.c b/sdas/linksrc/lkrloc3.c
|
||||
index b330184..0a83e0f 100644
|
||||
--- a/sdas/linksrc/lkrloc3.c
|
||||
+++ b/sdas/linksrc/lkrloc3.c
|
||||
@@ -31,6 +31,7 @@
|
||||
*/
|
||||
|
||||
#include "aslink.h"
|
||||
+#include "lkrrel.h"
|
||||
|
||||
/*)Module lkrloc3.c
|
||||
*
|
||||
@@ -332,6 +333,9 @@ relr3(void)
|
||||
* Do remaining relocations
|
||||
*/
|
||||
while (more()) {
|
||||
+ int output_relocation_record;
|
||||
+ int raddr;
|
||||
+
|
||||
error = 0;
|
||||
mode = (int) eval();
|
||||
|
||||
@@ -390,6 +394,93 @@ relr3(void)
|
||||
reli -= paga + pags;
|
||||
}
|
||||
|
||||
+ /* KevT 28-05-2005 */
|
||||
+
|
||||
+ if (hflag)
|
||||
+ {
|
||||
+ output_relocation_record = 0;
|
||||
+ if (mode & R3_SYM)
|
||||
+ {
|
||||
+ /* If the symbol is defined in a absolute area, then we do not
|
||||
+ output a record. This allows us to reference absolute addresses
|
||||
+ in our code, but it can still be relocated */
|
||||
+
|
||||
+ /* If the symbol is relative, it is within our relocatable program */
|
||||
+
|
||||
+ /* printf("Symbol: %s\n",s[rindex]->s_id); */
|
||||
+ if ((s[rindex]->s_axp->a_bap->a_flag & A4_ABS)==0)
|
||||
+ {
|
||||
+ output_relocation_record=1;
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ /* If the area is absolute then we do not output a record.
|
||||
+ This allows us to reference absolute memory, but still the code
|
||||
+ can be relocated. */
|
||||
+ /* If the area is relative, it refers to data that is part of the
|
||||
+ relocatable program */
|
||||
+
|
||||
+ /* printf("Area: %s\n",a[rindex]->a_bap->a_id); */
|
||||
+ if ((a[rindex]->a_bap->a_flag & A4_ABS)==0)
|
||||
+ {
|
||||
+ output_relocation_record=1;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (output_relocation_record)
|
||||
+ {
|
||||
+ a_uint relocate_address = pc+(rtp-rtofst);
|
||||
+ if (hilo)
|
||||
+ {
|
||||
+ raddr = reli + ((rtval[rtp]&0x0ff)<<8) + (rtval[rtp+1]&0x0ff);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ raddr = reli + ((rtval[rtp+1]&0x0ff)<<8) + (rtval[rtp]&0x0ff);
|
||||
+ }
|
||||
+ /*printf("Relocation modify address: %04x\n",relocate_address); */
|
||||
+ /*printf("Relocation address: %04x\n",raddr); */
|
||||
+ if (mode & R3_BYTE)
|
||||
+ {
|
||||
+ if (mode & R3_BYTX)
|
||||
+ {
|
||||
+ if (mode & R3_MSB)
|
||||
+ {
|
||||
+
|
||||
+relrec8hi(relocate_address,raddr);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+
|
||||
+relrec8lo(relocate_address,raddr);
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ printf("not supported");
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ if (mode & R3_BYTX)
|
||||
+ {
|
||||
+ if (mode & R3_MSB)
|
||||
+ {
|
||||
+ printf("not supported");
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ printf("not supported");
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ relrec16(relocate_address);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
|
||||
/* pdk instruction fusion */
|
||||
if (TARGET_IS_PDK) {
|
||||
@@ -856,6 +947,12 @@ rele3()
|
||||
if (uflag != 0) {
|
||||
lkulist(0);
|
||||
}
|
||||
+
|
||||
+ /* output relocation data */
|
||||
+ if (hflag) {
|
||||
+ relrecwrite();
|
||||
+ }
|
||||
+
|
||||
if (oflag != 0) {
|
||||
lkflush();
|
||||
lkfclose();
|
||||
diff --git a/sdas/linksrc/lkrrel.c b/sdas/linksrc/lkrrel.c
|
||||
new file mode 100644
|
||||
index 0000000..0d9f943
|
||||
--- /dev/null
|
||||
+++ b/sdas/linksrc/lkrrel.c
|
||||
@@ -0,0 +1,256 @@
|
||||
+/* (c) Kevin Thacker, May 2005 */
|
||||
+#include <stdio.h>
|
||||
+#include <string.h>
|
||||
+#include <stdlib.h>
|
||||
+#include "aslink.h"
|
||||
+#include "lkrrel.h"
|
||||
+
|
||||
+struct relrechead
|
||||
+{
|
||||
+ int count;
|
||||
+ struct relrec *head;
|
||||
+};
|
||||
+
|
||||
+/* 16-bit values, add full 16-bit base address */
|
||||
+
|
||||
+static struct relrechead head16= {0,NULL};
|
||||
+/* 8-bit, but add high byte of 16-bit base address */
|
||||
+static struct relrechead head8hi = {0,NULL};
|
||||
+/* 8-bit, but add low byte of 16-bit base address */
|
||||
+static struct relrechead head8lo = {0,NULL};
|
||||
+
|
||||
+/* internal; free's list */
|
||||
+static void relrecfree(struct relrechead *head)
|
||||
+{
|
||||
+ struct relrec *cur = head->head;
|
||||
+
|
||||
+ while (cur!=NULL)
|
||||
+ {
|
||||
+ struct relrec *next = cur->next;
|
||||
+ free(cur);
|
||||
+
|
||||
+ cur = next;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+/* free relocation record list; e.g. on exit */
|
||||
+void freerelrec()
|
||||
+{
|
||||
+ relrecfree(&head16);
|
||||
+ relrecfree(&head8hi);
|
||||
+ relrecfree(&head8lo);
|
||||
+}
|
||||
+
|
||||
+/* internal; allocate a relocation record */
|
||||
+static void newrelrec(struct relrechead *head, a_uint addr, a_uint symaddr)
|
||||
+{
|
||||
+ struct relrec *rec;
|
||||
+
|
||||
+ rec = (struct relrec *) malloc(sizeof(struct relrec));
|
||||
+
|
||||
+ /* error if allocation failed */
|
||||
+ if (rec==NULL)
|
||||
+ return;
|
||||
+
|
||||
+ rec->addr = addr;
|
||||
+ rec->symaddr = symaddr;
|
||||
+
|
||||
+ /* add to start of list */
|
||||
+ rec->next = head->head;
|
||||
+ head->head = rec;
|
||||
+ head->count++;
|
||||
+}
|
||||
+
|
||||
+/* add item to 16-bit relocation record list */
|
||||
+void relrec16(a_uint addr)
|
||||
+{
|
||||
+ newrelrec(&head16, addr,0);
|
||||
+}
|
||||
+
|
||||
+/* add item to 8-bit (high) relocation record list */
|
||||
+void relrec8hi(a_uint addr, a_uint symaddr)
|
||||
+{
|
||||
+ newrelrec(&head8hi, addr,symaddr);
|
||||
+}
|
||||
+
|
||||
+/* add address to 8-bit (low) relocation list */
|
||||
+void relrec8lo(a_uint addr, a_uint symaddr)
|
||||
+{
|
||||
+ newrelrec(&head8lo, addr,symaddr);
|
||||
+}
|
||||
+
|
||||
+/* internal; compare two addresses within two relocate records */
|
||||
+static int relreccompare(const void *a, const void *b)
|
||||
+{
|
||||
+ const struct relrec *relreca = (const struct relrec *)a;
|
||||
+ const struct relrec *relrecb = (const struct relrec *)b;
|
||||
+
|
||||
+ return (relreca->addr-relrecb->addr);
|
||||
+}
|
||||
+
|
||||
+/* sort a list of relocate records and return an array of the records */
|
||||
+static struct relrec *relrecsort(struct relrechead *head)
|
||||
+{
|
||||
+ int count;
|
||||
+ struct relrec *reclist;
|
||||
+ struct relrec *cur;
|
||||
+
|
||||
+ if (head->count==0)
|
||||
+ return NULL;
|
||||
+
|
||||
+ /* allocate list to hold all items */
|
||||
+ reclist = (struct relrec *)malloc(sizeof(struct relrec)*head->count);
|
||||
+
|
||||
+ if (reclist==NULL)
|
||||
+ return NULL;
|
||||
+
|
||||
+ /* fill list */
|
||||
+ count = 0;
|
||||
+ cur = head->head;
|
||||
+ while (cur!=NULL)
|
||||
+ {
|
||||
+ memcpy(&reclist[count],cur,sizeof(struct relrec));
|
||||
+ count++;
|
||||
+ cur = cur->next;
|
||||
+ }
|
||||
+
|
||||
+ /* sort into ascending address order */
|
||||
+ qsort(reclist, count, sizeof(struct relrec),relreccompare);
|
||||
+
|
||||
+ return reclist;
|
||||
+}
|
||||
+
|
||||
+int outbyte(int addr, char byte)
|
||||
+{
|
||||
+ rtval[0] = addr&0x0ff;
|
||||
+ rtval[1] = (addr>>8)&0x0ff;
|
||||
+ rtval[2] = (addr>>16)&0x0ff;
|
||||
+
|
||||
+ rtval[3] = byte&0x0ff;
|
||||
+ addr+=1;
|
||||
+ rtflg[0] = 1;
|
||||
+ rtflg[1] = 1;
|
||||
+ rtflg[2] = 1;
|
||||
+ rtflg[3] = 1;
|
||||
+ rtcnt = 4;
|
||||
+ ixx(1);
|
||||
+ return addr;
|
||||
+}
|
||||
+
|
||||
+void relrecwritelist1(struct relrechead *list,int *addrptr)
|
||||
+{
|
||||
+ int i;
|
||||
+ struct relrec *relreclist;
|
||||
+ int addr;
|
||||
+
|
||||
+ addr = *addrptr;
|
||||
+
|
||||
+ relreclist = relrecsort(list);
|
||||
+
|
||||
+ if (relreclist!=NULL)
|
||||
+ {
|
||||
+ int prevaddr = 0;
|
||||
+ for (i=0; i<list->count; i++)
|
||||
+ {
|
||||
+ struct relrec *cur = &relreclist[i];
|
||||
+
|
||||
+ int delta = cur->addr-prevaddr;
|
||||
+
|
||||
+ if (delta>254)
|
||||
+ {
|
||||
+ int largedelta = delta-1;
|
||||
+ addr = outbyte(addr,0x0ff);
|
||||
+ addr = outbyte(addr,largedelta&0x0ff);
|
||||
+ addr = outbyte(addr,(largedelta>>8)&0x0ff);
|
||||
+ delta = 1;
|
||||
+ }
|
||||
+ prevaddr = cur->addr;
|
||||
+ addr = outbyte(addr,delta&0x0ff);
|
||||
+ }
|
||||
+
|
||||
+ free(relreclist);
|
||||
+ }
|
||||
+
|
||||
+ addr = outbyte(addr, 0);
|
||||
+
|
||||
+ *addrptr = addr;
|
||||
+
|
||||
+}
|
||||
+
|
||||
+void relrecwritelist2(struct relrechead *list,int *addrptr)
|
||||
+{
|
||||
+ int i;
|
||||
+ struct relrec *relreclist;
|
||||
+ int addr;
|
||||
+
|
||||
+ addr = *addrptr;
|
||||
+
|
||||
+ relreclist = relrecsort(list);
|
||||
+
|
||||
+ if (relreclist!=NULL)
|
||||
+ {
|
||||
+ int prevaddr = 0;
|
||||
+ for (i=0; i<list->count; i++)
|
||||
+ {
|
||||
+ struct relrec *cur = &relreclist[i];
|
||||
+ int delta = cur->addr-prevaddr;
|
||||
+ prevaddr = cur->addr;
|
||||
+
|
||||
+ if (delta>254)
|
||||
+ {
|
||||
+ int largedelta = delta-1;
|
||||
+ addr = outbyte(addr,0x0ff);
|
||||
+ addr = outbyte(addr,largedelta&0x0ff);
|
||||
+ addr = outbyte(addr,(largedelta>>8)&0x0ff);
|
||||
+ delta = 1;
|
||||
+ }
|
||||
+
|
||||
+ addr = outbyte(addr,delta&0x0ff);
|
||||
+ addr = outbyte(addr,cur->symaddr&0x0ff);
|
||||
+ }
|
||||
+
|
||||
+ free(relreclist);
|
||||
+ }
|
||||
+
|
||||
+ addr = outbyte(addr,0);
|
||||
+
|
||||
+ *addrptr = addr;
|
||||
+
|
||||
+}
|
||||
+
|
||||
+
|
||||
+void relrecwrite()
|
||||
+{
|
||||
+ int areasize = 0;
|
||||
+
|
||||
+ struct area *cur = areap;
|
||||
+ while (cur!=NULL)
|
||||
+ {
|
||||
+ areasize+=cur->a_size;
|
||||
+ cur=cur->a_ap;
|
||||
+ }
|
||||
+
|
||||
+ //printf("total length before relocation records: %04x\n",areasize);
|
||||
+
|
||||
+ /* re-write offset to relocation records */
|
||||
+ rtval[0] = 0;
|
||||
+ rtval[1] = 0;
|
||||
+ rtval[2] = 0;
|
||||
+ rtval[3] = areasize&0x0ff;
|
||||
+ rtval[4] = (areasize>>8)&0x0ff;
|
||||
+ rtflg[0] = 1;
|
||||
+ rtflg[1] = 1;
|
||||
+ rtflg[2] = 1;
|
||||
+ rtflg[3] = 1;
|
||||
+ rtflg[4] = 1;
|
||||
+ rtcnt = 5;
|
||||
+ ixx(1);
|
||||
+
|
||||
+
|
||||
+ int addr = areasize;
|
||||
+
|
||||
+
|
||||
+ relrecwritelist1(&head16,&addr);
|
||||
+ relrecwritelist1(&head8lo,&addr);
|
||||
+ relrecwritelist2(&head8hi,&addr);
|
||||
+}
|
||||
diff --git a/sdas/linksrc/lkrrel.h b/sdas/linksrc/lkrrel.h
|
||||
new file mode 100644
|
||||
index 0000000..ca1cfd4
|
||||
--- /dev/null
|
||||
+++ b/sdas/linksrc/lkrrel.h
|
||||
@@ -0,0 +1,17 @@
|
||||
+/* relocation record */
|
||||
+struct relrec
|
||||
+{
|
||||
+ /* next item */
|
||||
+ struct relrec *next;
|
||||
+
|
||||
+ /* address of relocate */
|
||||
+ a_uint addr;
|
||||
+
|
||||
+ a_uint symaddr;
|
||||
+};
|
||||
+
|
||||
+void relrec16(a_uint addr);
|
||||
+void relrec8lo(a_uint addr, a_uint symaddr);
|
||||
+void relrec8hi(a_uint addr, a_uint symaddr);
|
||||
+void freerelrec();
|
||||
+void relrecwrite();
|
||||
--
|
||||
2.37.3
|
||||
|
||||
|
||||
From 02b6fcf8a92f183f742e1a55ab579dcd40ba1bdf Mon Sep 17 00:00:00 2001
|
||||
From: PulkoMandy <pulkomandy@pulkomandy.tk>
|
||||
Date: Mon, 1 May 2023 12:21:48 +0200
|
||||
Subject: configure.ac: use -gdwarf-3 instead of -ggdb
|
||||
|
||||
This works better with Haiku's Debugger
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index cc5309e..7d3d1b8 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -388,10 +388,10 @@ if test "$ac_cv_c_compiler_gnu" = "yes"; then
|
||||
rm -f _test_.*)
|
||||
|
||||
# This is the first time when CFLAGS are set/modified!!
|
||||
- sdcc_IS_VALID_OPTION(-ggdb)
|
||||
- if test "$sdcc_cv_c_ggdb" = "yes"; then
|
||||
- CFLAGS="-ggdb ${CFLAGS}"
|
||||
- CXXFLAGS="-ggdb ${CXXFLAGS}"
|
||||
+ sdcc_IS_VALID_OPTION(-gdwarf-3)
|
||||
+ if test "$sdcc_cv_c_gdwarf_3" = "yes"; then
|
||||
+ CFLAGS="-gdwarf-3 ${CFLAGS}"
|
||||
+ CXXFLAGS="-gdwarf-3 ${CXXFLAGS}"
|
||||
fi
|
||||
|
||||
sdcc_IS_VALID_OPTION(-pipe)
|
||||
--
|
||||
2.37.3
|
||||
|
||||
|
||||
From 970de68df98a204b81aa1eacd33ca24a9a1be6eb Mon Sep 17 00:00:00 2001
|
||||
From: PulkoMandy <pulkomandy@pulkomandy.tk>
|
||||
Date: Mon, 1 May 2023 12:23:55 +0200
|
||||
Subject: Do not strip binaries when installing them
|
||||
|
||||
This is done already by Haiku packaging when creating the debuginfo
|
||||
package.
|
||||
|
||||
diff --git a/sdas/linksrc/Makefile.in b/sdas/linksrc/Makefile.in
|
||||
index e37b167..7e7f9ea 100644
|
||||
--- a/sdas/linksrc/Makefile.in
|
||||
+++ b/sdas/linksrc/Makefile.in
|
||||
@@ -87,28 +87,22 @@ $(ASLINK): $(LKOBJECTS)
|
||||
# ----------------------------------------------------
|
||||
install: all installdirs
|
||||
$(INSTALL) $(top_builddir)/bin/sdld$(EXEEXT) $(DESTDIR)$(bindir)/`echo 'sdld' | sed '$(transform)'`$(EXEEXT)
|
||||
- $(STRIP) $(DESTDIR)$(bindir)/`echo 'sdld' | sed '$(transform)'`$(EXEEXT)
|
||||
if [ "`grep stm8 $(top_builddir)/ports.build`" = "stm8" ]; \
|
||||
then \
|
||||
$(INSTALL) $(top_builddir)/bin/sdldstm8$(EXEEXT) $(DESTDIR)$(bindir)/`echo 'sdldstm8' | sed '$(transform)'`$(EXEEXT); \
|
||||
- $(STRIP) $(DESTDIR)$(bindir)/`echo 'sdldstm8' | sed '$(transform)'`$(EXEEXT); \
|
||||
fi
|
||||
if [ "`grep hc08 $(top_builddir)/ports.build`" = "hc08" ]; \
|
||||
then \
|
||||
$(INSTALL) $(top_builddir)/bin/sdld6808$(EXEEXT) $(DESTDIR)$(bindir)/`echo 'sdld6808' | sed '$(transform)'`$(EXEEXT); \
|
||||
- $(STRIP) $(DESTDIR)$(bindir)/`echo 'sdld6808' | sed '$(transform)'`$(EXEEXT); \
|
||||
fi
|
||||
if [ "`grep z80 $(top_builddir)/ports.build`" = "z80" ]; \
|
||||
then \
|
||||
$(INSTALL) $(top_builddir)/bin/sdldz80$(EXEEXT) $(DESTDIR)$(bindir)/`echo 'sdldz80' | sed '$(transform)'`$(EXEEXT); \
|
||||
- $(STRIP) $(DESTDIR)$(bindir)/`echo 'sdldz80' | sed '$(transform)'`$(EXEEXT); \
|
||||
$(INSTALL) $(top_builddir)/bin/sdldgb$(EXEEXT) $(DESTDIR)$(bindir)/`echo 'sdldgb' | sed '$(transform)'`$(EXEEXT); \
|
||||
- $(STRIP) $(DESTDIR)$(bindir)/`echo 'sdldgb' | sed '$(transform)'`$(EXEEXT); \
|
||||
fi
|
||||
if [ "`grep pdk $(top_builddir)/ports.build`" = "pdk" ]; \
|
||||
then \
|
||||
$(INSTALL) $(top_builddir)/bin/sdldpdk$(EXEEXT) $(DESTDIR)$(bindir)/`echo 'sdldpdk' | sed '$(transform)'`$(EXEEXT); \
|
||||
- $(STRIP) $(DESTDIR)$(bindir)/`echo 'sdldpdk' | sed '$(transform)'`$(EXEEXT); \
|
||||
fi
|
||||
|
||||
# Deleting all the installed files
|
||||
diff --git a/src/Makefile.in b/src/Makefile.in
|
||||
index 1533d1f..8f2c2c6 100644
|
||||
--- a/src/Makefile.in
|
||||
+++ b/src/Makefile.in
|
||||
@@ -69,7 +69,6 @@ $(top_builddir)/support/gc/libgc.a:
|
||||
# ---------------------------------------------------
|
||||
install: all installdirs
|
||||
$(INSTALL) $(TARGET) $(DESTDIR)$(bindir)/`echo sdcc|sed '$(transform)'`$(EXEEXT)
|
||||
- $(STRIP) $(DESTDIR)$(bindir)/`echo sdcc|sed '$(transform)'`$(EXEEXT)
|
||||
|
||||
|
||||
# Deleting all the installed files
|
||||
--
|
||||
2.37.3
|
||||
|
||||
|
||||
From ed45ed6c696d9f250c427d65379ddd1d7e37c52c Mon Sep 17 00:00:00 2001
|
||||
From: PulkoMandy <pulkomandy@pulkomandy.tk>
|
||||
Date: Mon, 1 May 2023 14:19:47 +0200
|
||||
Subject: Backport upstream bugfix r13588
|
||||
|
||||
Fix for https://sourceforge.net/p/sdcc/bugs/3401
|
||||
|
||||
diff --git a/src/SDCCast.c b/src/SDCCast.c
|
||||
index 04f2cc1..1dab15c 100644
|
||||
--- a/src/SDCCast.c
|
||||
+++ b/src/SDCCast.c
|
||||
@@ -4060,10 +4060,11 @@ decorateType (ast *tree, RESULT_TYPE resultType, bool reduceTypeAllowed)
|
||||
if (reduceTypeAllowed &&
|
||||
IS_LITERAL (RTYPE (tree)) &&
|
||||
IS_BOOLEAN (LTYPE (tree)) &&
|
||||
- IS_INTEGRAL (RTYPE (tree)) &&
|
||||
+ IS_AST_LIT_VALUE (tree->right) &&
|
||||
resultType == RESULT_TYPE_BOOL &&
|
||||
tree->opval.op == '^') /* the same source is used by 'bitwise or' */
|
||||
{
|
||||
+ wassert (tree->right->type == EX_VALUE);
|
||||
unsigned long litval = AST_ULONG_VALUE (tree->right);
|
||||
if (litval == 0 || litval == 1)
|
||||
{
|
||||
@@ -4077,11 +4078,11 @@ decorateType (ast *tree, RESULT_TYPE resultType, bool reduceTypeAllowed)
|
||||
return decorateType (tree, resultType, reduceTypeAllowed);
|
||||
}
|
||||
}
|
||||
-
|
||||
+
|
||||
/* OR / XOR char with literal integral, try to reduce integral to CHAR if it fits in a CHAR */
|
||||
if (reduceTypeAllowed &&
|
||||
!TARGET_PDK_LIKE && // Temporary fix to avoid bug #3259 - Wrong opcodes
|
||||
- IS_LITERAL (RTYPE (tree)) &&
|
||||
+ IS_AST_LIT_VALUE (tree->right) &&
|
||||
IS_INTEGRAL (RTYPE (tree)) &&
|
||||
!IS_CHAR (RTYPE (tree)) &&
|
||||
IS_CHAR(LTYPE(tree)))
|
||||
--
|
||||
2.37.3
|
||||
|
||||
904
dev-embedded/sdcc/patches/sdcc-4.3.0.patchset
Normal file
904
dev-embedded/sdcc/patches/sdcc-4.3.0.patchset
Normal file
@@ -0,0 +1,904 @@
|
||||
From cc9bdc24b6ec8953ac318c2d2a47cfc74f8c8c80 Mon Sep 17 00:00:00 2001
|
||||
From: PulkoMandy <pulkomandy@pulkomandy.tk>
|
||||
Date: Mon, 14 Aug 2023 17:10:50 +0200
|
||||
Subject: Kevin Thacker's patch for generating relocatable executables
|
||||
|
||||
|
||||
diff --git a/sdas/linksrc/Makefile.in b/sdas/linksrc/Makefile.in
|
||||
index b7eb8fc..e392266 100644
|
||||
--- a/sdas/linksrc/Makefile.in
|
||||
+++ b/sdas/linksrc/Makefile.in
|
||||
@@ -47,7 +47,7 @@ ASXXLIBSRC = strcmpi.c
|
||||
SRC = lk_readnl.c lkaomf51.c lkar.c lkarea.c lkdata.c lkelf.c lkeval.c \
|
||||
lkhead.c lklex.c lklib.c lklibr.c lklist.c lkmain.c lkmem.c \
|
||||
lknoice.c lkout.c lkrel.c lkrloc.c lkrloc3.c lksdcclib.c \
|
||||
- lksym.c sdld.c lksdcdb.c lkbank.c
|
||||
+ lksym.c sdld.c lksdcdb.c lkbank.c lkrrel.c
|
||||
|
||||
LKSOURCES = $(SRC) $(ASXXLIBSRC:%.c=$(ASXXLIB)/%.c)
|
||||
|
||||
@@ -87,28 +87,22 @@ $(ASLINK): $(LKOBJECTS)
|
||||
# ----------------------------------------------------
|
||||
install: all installdirs
|
||||
$(INSTALL) $(top_builddir)/bin/sdld$(EXEEXT) $(DESTDIR)$(bindir)/`echo 'sdld' | sed '$(transform)'`$(EXEEXT)
|
||||
- $(STRIP) $(DESTDIR)$(bindir)/`echo 'sdld' | sed '$(transform)'`$(EXEEXT)
|
||||
if [ "`grep stm8 $(top_builddir)/ports.build`" = "stm8" ]; \
|
||||
then \
|
||||
$(INSTALL) $(top_builddir)/bin/sdldstm8$(EXEEXT) $(DESTDIR)$(bindir)/`echo 'sdldstm8' | sed '$(transform)'`$(EXEEXT); \
|
||||
- $(STRIP) $(DESTDIR)$(bindir)/`echo 'sdldstm8' | sed '$(transform)'`$(EXEEXT); \
|
||||
fi
|
||||
if [ "`grep hc08 $(top_builddir)/ports.build`" = "hc08" ]; \
|
||||
then \
|
||||
$(INSTALL) $(top_builddir)/bin/sdld6808$(EXEEXT) $(DESTDIR)$(bindir)/`echo 'sdld6808' | sed '$(transform)'`$(EXEEXT); \
|
||||
- $(STRIP) $(DESTDIR)$(bindir)/`echo 'sdld6808' | sed '$(transform)'`$(EXEEXT); \
|
||||
fi
|
||||
if [ "`grep z80 $(top_builddir)/ports.build`" = "z80" ]; \
|
||||
then \
|
||||
$(INSTALL) $(top_builddir)/bin/sdldz80$(EXEEXT) $(DESTDIR)$(bindir)/`echo 'sdldz80' | sed '$(transform)'`$(EXEEXT); \
|
||||
- $(STRIP) $(DESTDIR)$(bindir)/`echo 'sdldz80' | sed '$(transform)'`$(EXEEXT); \
|
||||
$(INSTALL) $(top_builddir)/bin/sdldgb$(EXEEXT) $(DESTDIR)$(bindir)/`echo 'sdldgb' | sed '$(transform)'`$(EXEEXT); \
|
||||
- $(STRIP) $(DESTDIR)$(bindir)/`echo 'sdldgb' | sed '$(transform)'`$(EXEEXT); \
|
||||
fi
|
||||
if [ "`grep pdk $(top_builddir)/ports.build`" = "pdk" ]; \
|
||||
then \
|
||||
$(INSTALL) $(top_builddir)/bin/sdldpdk$(EXEEXT) $(DESTDIR)$(bindir)/`echo 'sdldpdk' | sed '$(transform)'`$(EXEEXT); \
|
||||
- $(STRIP) $(DESTDIR)$(bindir)/`echo 'sdldpdk' | sed '$(transform)'`$(EXEEXT); \
|
||||
fi
|
||||
|
||||
# Deleting all the installed files
|
||||
diff --git a/sdas/linksrc/aslink.h b/sdas/linksrc/aslink.h
|
||||
index 4033cfa..f2d944c 100644
|
||||
--- a/sdas/linksrc/aslink.h
|
||||
+++ b/sdas/linksrc/aslink.h
|
||||
@@ -1036,6 +1036,8 @@ extern int yflag; /* -y, enable SDCC Debug output
|
||||
*/
|
||||
#endif
|
||||
|
||||
+extern int hflag; /* Generate relocatable executables
|
||||
+ */
|
||||
extern int pflag; /* print linker command file flag
|
||||
*/
|
||||
extern int uflag; /* Listing relocation flag
|
||||
diff --git a/sdas/linksrc/lkdata.c b/sdas/linksrc/lkdata.c
|
||||
index 169e8c1..015e727 100644
|
||||
--- a/sdas/linksrc/lkdata.c
|
||||
+++ b/sdas/linksrc/lkdata.c
|
||||
@@ -66,6 +66,9 @@ int oflag; /* Output file type flag
|
||||
int objflg; /* Linked file/library object output flag
|
||||
*/
|
||||
|
||||
+int hflag; /* Generate relocatable executables
|
||||
+ */
|
||||
+
|
||||
#if NOICE
|
||||
int jflag; /* NoICE output flag
|
||||
*/
|
||||
diff --git a/sdas/linksrc/lkmain.c b/sdas/linksrc/lkmain.c
|
||||
index daf5515..8f4b8bd 100644
|
||||
--- a/sdas/linksrc/lkmain.c
|
||||
+++ b/sdas/linksrc/lkmain.c
|
||||
@@ -212,6 +212,7 @@ main(int argc, char *argv[])
|
||||
startp->f_idp = "";
|
||||
|
||||
pflag = 1;
|
||||
+ hflag = 0;
|
||||
|
||||
for(i=1; i<argc; i++) {
|
||||
ip = ib;
|
||||
@@ -979,6 +980,11 @@ parse()
|
||||
}
|
||||
return(0);
|
||||
|
||||
+ case 'h':
|
||||
+ case 'H':
|
||||
+ hflag = 1;
|
||||
+ break;
|
||||
+
|
||||
case 'I':
|
||||
if (is_sdld() && !(TARGET_IS_Z80 || TARGET_IS_GB)) {
|
||||
iramsav();
|
||||
diff --git a/sdas/linksrc/lkrloc3.c b/sdas/linksrc/lkrloc3.c
|
||||
index b330184..f813dd0 100644
|
||||
--- a/sdas/linksrc/lkrloc3.c
|
||||
+++ b/sdas/linksrc/lkrloc3.c
|
||||
@@ -31,6 +31,7 @@
|
||||
*/
|
||||
|
||||
#include "aslink.h"
|
||||
+#include "lkrrel.h"
|
||||
|
||||
/*)Module lkrloc3.c
|
||||
*
|
||||
@@ -332,6 +333,9 @@ relr3(void)
|
||||
* Do remaining relocations
|
||||
*/
|
||||
while (more()) {
|
||||
+ int output_relocation_record;
|
||||
+ int raddr;
|
||||
+
|
||||
error = 0;
|
||||
mode = (int) eval();
|
||||
|
||||
@@ -391,20 +395,106 @@ relr3(void)
|
||||
}
|
||||
|
||||
|
||||
+ /* KevT 28-05-2005 */
|
||||
+
|
||||
+ if (hflag)
|
||||
+ {
|
||||
+ output_relocation_record = 0;
|
||||
+ if (mode & R3_SYM)
|
||||
+ {
|
||||
+ /* If the symbol is defined in a absolute area, then we do not
|
||||
+ output a record. This allows us to reference absolute addresses
|
||||
+ in our code, but it can still be relocated */
|
||||
+
|
||||
+ /* If the symbol is relative, it is within our relocatable program */
|
||||
+
|
||||
+ /* printf("Symbol: %s\n",s[rindex]->s_id); */
|
||||
+ if ((s[rindex]->s_axp->a_bap->a_flag & A4_ABS)==0)
|
||||
+ {
|
||||
+ output_relocation_record=1;
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ /* If the area is absolute then we do not output a record.
|
||||
+ This allows us to reference absolute memory, but still the code
|
||||
+ can be relocated. */
|
||||
+ /* If the area is relative, it refers to data that is part of the
|
||||
+ relocatable program */
|
||||
+
|
||||
+ /* printf("Area: %s\n",a[rindex]->a_bap->a_id); */
|
||||
+ if ((a[rindex]->a_bap->a_flag & A4_ABS)==0)
|
||||
+ {
|
||||
+ output_relocation_record=1;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (output_relocation_record)
|
||||
+ {
|
||||
+ a_uint relocate_address = pc+(rtp-rtofst);
|
||||
+ if (hilo)
|
||||
+ {
|
||||
+ raddr = reli + ((rtval[rtp]&0x0ff)<<8) + (rtval[rtp+1]&0x0ff);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ raddr = reli + ((rtval[rtp+1]&0x0ff)<<8) + (rtval[rtp]&0x0ff);
|
||||
+ }
|
||||
+ /*printf("Relocation modify address: %04x\n",relocate_address); */
|
||||
+ /*printf("Relocation address: %04x\n",raddr); */
|
||||
+ if (mode & R3_BYTE)
|
||||
+ {
|
||||
+ if (mode & R3_BYTX)
|
||||
+ {
|
||||
+ if (mode & R3_MSB)
|
||||
+ {
|
||||
+ relrec8hi(relocate_address,raddr);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ relrec8lo(relocate_address,raddr);
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ printf("not supported");
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ if (mode & R3_BYTX)
|
||||
+ {
|
||||
+ if (mode & R3_MSB)
|
||||
+ {
|
||||
+ printf("not supported");
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ printf("not supported");
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ relrec16(relocate_address);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
/* pdk instruction fusion */
|
||||
if (TARGET_IS_PDK) {
|
||||
- relv = adb_3b(reli, rtp);
|
||||
-
|
||||
- /* pdk addresses in words, not in bytes,
|
||||
- * for goto/call instructions and byte selections.
|
||||
- */
|
||||
- int jump = 1, mask = 0;
|
||||
- if (rtval[rtp + 4] == 15) {
|
||||
- jump = rtval[rtp + 3] & 0x70;
|
||||
- mask = 0x40;
|
||||
- if (get_sdld_target() == TARGET_ID_PDK) {
|
||||
- set_sdld_target(TARGET_ID_PDK15);
|
||||
- } else if (get_sdld_target() != TARGET_ID_PDK15) {
|
||||
+ relv = adb_3b(reli, rtp);
|
||||
+
|
||||
+ /* pdk addresses in words, not in bytes,
|
||||
+ * for goto/call instructions and byte selections.
|
||||
+ */
|
||||
+ int jump = 1, mask = 0;
|
||||
+ if (rtval[rtp + 4] == 15) {
|
||||
+ jump = rtval[rtp + 3] & 0x70;
|
||||
+ mask = 0x40;
|
||||
+ if (get_sdld_target() == TARGET_ID_PDK) {
|
||||
+ set_sdld_target(TARGET_ID_PDK15);
|
||||
+ } else if (get_sdld_target() != TARGET_ID_PDK15) {
|
||||
error = 12;
|
||||
}
|
||||
} else if (rtval[rtp + 4] == 14) {
|
||||
@@ -856,6 +946,12 @@ rele3()
|
||||
if (uflag != 0) {
|
||||
lkulist(0);
|
||||
}
|
||||
+
|
||||
+ /* output relocation data */
|
||||
+ if (hflag != 0) {
|
||||
+ relrecwrite();
|
||||
+ }
|
||||
+
|
||||
if (oflag != 0) {
|
||||
lkflush();
|
||||
lkfclose();
|
||||
diff --git a/sdas/linksrc/lkrrel.c b/sdas/linksrc/lkrrel.c
|
||||
new file mode 100644
|
||||
index 0000000..0d9f943
|
||||
--- /dev/null
|
||||
+++ b/sdas/linksrc/lkrrel.c
|
||||
@@ -0,0 +1,256 @@
|
||||
+/* (c) Kevin Thacker, May 2005 */
|
||||
+#include <stdio.h>
|
||||
+#include <string.h>
|
||||
+#include <stdlib.h>
|
||||
+#include "aslink.h"
|
||||
+#include "lkrrel.h"
|
||||
+
|
||||
+struct relrechead
|
||||
+{
|
||||
+ int count;
|
||||
+ struct relrec *head;
|
||||
+};
|
||||
+
|
||||
+/* 16-bit values, add full 16-bit base address */
|
||||
+
|
||||
+static struct relrechead head16= {0,NULL};
|
||||
+/* 8-bit, but add high byte of 16-bit base address */
|
||||
+static struct relrechead head8hi = {0,NULL};
|
||||
+/* 8-bit, but add low byte of 16-bit base address */
|
||||
+static struct relrechead head8lo = {0,NULL};
|
||||
+
|
||||
+/* internal; free's list */
|
||||
+static void relrecfree(struct relrechead *head)
|
||||
+{
|
||||
+ struct relrec *cur = head->head;
|
||||
+
|
||||
+ while (cur!=NULL)
|
||||
+ {
|
||||
+ struct relrec *next = cur->next;
|
||||
+ free(cur);
|
||||
+
|
||||
+ cur = next;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+/* free relocation record list; e.g. on exit */
|
||||
+void freerelrec()
|
||||
+{
|
||||
+ relrecfree(&head16);
|
||||
+ relrecfree(&head8hi);
|
||||
+ relrecfree(&head8lo);
|
||||
+}
|
||||
+
|
||||
+/* internal; allocate a relocation record */
|
||||
+static void newrelrec(struct relrechead *head, a_uint addr, a_uint symaddr)
|
||||
+{
|
||||
+ struct relrec *rec;
|
||||
+
|
||||
+ rec = (struct relrec *) malloc(sizeof(struct relrec));
|
||||
+
|
||||
+ /* error if allocation failed */
|
||||
+ if (rec==NULL)
|
||||
+ return;
|
||||
+
|
||||
+ rec->addr = addr;
|
||||
+ rec->symaddr = symaddr;
|
||||
+
|
||||
+ /* add to start of list */
|
||||
+ rec->next = head->head;
|
||||
+ head->head = rec;
|
||||
+ head->count++;
|
||||
+}
|
||||
+
|
||||
+/* add item to 16-bit relocation record list */
|
||||
+void relrec16(a_uint addr)
|
||||
+{
|
||||
+ newrelrec(&head16, addr,0);
|
||||
+}
|
||||
+
|
||||
+/* add item to 8-bit (high) relocation record list */
|
||||
+void relrec8hi(a_uint addr, a_uint symaddr)
|
||||
+{
|
||||
+ newrelrec(&head8hi, addr,symaddr);
|
||||
+}
|
||||
+
|
||||
+/* add address to 8-bit (low) relocation list */
|
||||
+void relrec8lo(a_uint addr, a_uint symaddr)
|
||||
+{
|
||||
+ newrelrec(&head8lo, addr,symaddr);
|
||||
+}
|
||||
+
|
||||
+/* internal; compare two addresses within two relocate records */
|
||||
+static int relreccompare(const void *a, const void *b)
|
||||
+{
|
||||
+ const struct relrec *relreca = (const struct relrec *)a;
|
||||
+ const struct relrec *relrecb = (const struct relrec *)b;
|
||||
+
|
||||
+ return (relreca->addr-relrecb->addr);
|
||||
+}
|
||||
+
|
||||
+/* sort a list of relocate records and return an array of the records */
|
||||
+static struct relrec *relrecsort(struct relrechead *head)
|
||||
+{
|
||||
+ int count;
|
||||
+ struct relrec *reclist;
|
||||
+ struct relrec *cur;
|
||||
+
|
||||
+ if (head->count==0)
|
||||
+ return NULL;
|
||||
+
|
||||
+ /* allocate list to hold all items */
|
||||
+ reclist = (struct relrec *)malloc(sizeof(struct relrec)*head->count);
|
||||
+
|
||||
+ if (reclist==NULL)
|
||||
+ return NULL;
|
||||
+
|
||||
+ /* fill list */
|
||||
+ count = 0;
|
||||
+ cur = head->head;
|
||||
+ while (cur!=NULL)
|
||||
+ {
|
||||
+ memcpy(&reclist[count],cur,sizeof(struct relrec));
|
||||
+ count++;
|
||||
+ cur = cur->next;
|
||||
+ }
|
||||
+
|
||||
+ /* sort into ascending address order */
|
||||
+ qsort(reclist, count, sizeof(struct relrec),relreccompare);
|
||||
+
|
||||
+ return reclist;
|
||||
+}
|
||||
+
|
||||
+int outbyte(int addr, char byte)
|
||||
+{
|
||||
+ rtval[0] = addr&0x0ff;
|
||||
+ rtval[1] = (addr>>8)&0x0ff;
|
||||
+ rtval[2] = (addr>>16)&0x0ff;
|
||||
+
|
||||
+ rtval[3] = byte&0x0ff;
|
||||
+ addr+=1;
|
||||
+ rtflg[0] = 1;
|
||||
+ rtflg[1] = 1;
|
||||
+ rtflg[2] = 1;
|
||||
+ rtflg[3] = 1;
|
||||
+ rtcnt = 4;
|
||||
+ ixx(1);
|
||||
+ return addr;
|
||||
+}
|
||||
+
|
||||
+void relrecwritelist1(struct relrechead *list,int *addrptr)
|
||||
+{
|
||||
+ int i;
|
||||
+ struct relrec *relreclist;
|
||||
+ int addr;
|
||||
+
|
||||
+ addr = *addrptr;
|
||||
+
|
||||
+ relreclist = relrecsort(list);
|
||||
+
|
||||
+ if (relreclist!=NULL)
|
||||
+ {
|
||||
+ int prevaddr = 0;
|
||||
+ for (i=0; i<list->count; i++)
|
||||
+ {
|
||||
+ struct relrec *cur = &relreclist[i];
|
||||
+
|
||||
+ int delta = cur->addr-prevaddr;
|
||||
+
|
||||
+ if (delta>254)
|
||||
+ {
|
||||
+ int largedelta = delta-1;
|
||||
+ addr = outbyte(addr,0x0ff);
|
||||
+ addr = outbyte(addr,largedelta&0x0ff);
|
||||
+ addr = outbyte(addr,(largedelta>>8)&0x0ff);
|
||||
+ delta = 1;
|
||||
+ }
|
||||
+ prevaddr = cur->addr;
|
||||
+ addr = outbyte(addr,delta&0x0ff);
|
||||
+ }
|
||||
+
|
||||
+ free(relreclist);
|
||||
+ }
|
||||
+
|
||||
+ addr = outbyte(addr, 0);
|
||||
+
|
||||
+ *addrptr = addr;
|
||||
+
|
||||
+}
|
||||
+
|
||||
+void relrecwritelist2(struct relrechead *list,int *addrptr)
|
||||
+{
|
||||
+ int i;
|
||||
+ struct relrec *relreclist;
|
||||
+ int addr;
|
||||
+
|
||||
+ addr = *addrptr;
|
||||
+
|
||||
+ relreclist = relrecsort(list);
|
||||
+
|
||||
+ if (relreclist!=NULL)
|
||||
+ {
|
||||
+ int prevaddr = 0;
|
||||
+ for (i=0; i<list->count; i++)
|
||||
+ {
|
||||
+ struct relrec *cur = &relreclist[i];
|
||||
+ int delta = cur->addr-prevaddr;
|
||||
+ prevaddr = cur->addr;
|
||||
+
|
||||
+ if (delta>254)
|
||||
+ {
|
||||
+ int largedelta = delta-1;
|
||||
+ addr = outbyte(addr,0x0ff);
|
||||
+ addr = outbyte(addr,largedelta&0x0ff);
|
||||
+ addr = outbyte(addr,(largedelta>>8)&0x0ff);
|
||||
+ delta = 1;
|
||||
+ }
|
||||
+
|
||||
+ addr = outbyte(addr,delta&0x0ff);
|
||||
+ addr = outbyte(addr,cur->symaddr&0x0ff);
|
||||
+ }
|
||||
+
|
||||
+ free(relreclist);
|
||||
+ }
|
||||
+
|
||||
+ addr = outbyte(addr,0);
|
||||
+
|
||||
+ *addrptr = addr;
|
||||
+
|
||||
+}
|
||||
+
|
||||
+
|
||||
+void relrecwrite()
|
||||
+{
|
||||
+ int areasize = 0;
|
||||
+
|
||||
+ struct area *cur = areap;
|
||||
+ while (cur!=NULL)
|
||||
+ {
|
||||
+ areasize+=cur->a_size;
|
||||
+ cur=cur->a_ap;
|
||||
+ }
|
||||
+
|
||||
+ //printf("total length before relocation records: %04x\n",areasize);
|
||||
+
|
||||
+ /* re-write offset to relocation records */
|
||||
+ rtval[0] = 0;
|
||||
+ rtval[1] = 0;
|
||||
+ rtval[2] = 0;
|
||||
+ rtval[3] = areasize&0x0ff;
|
||||
+ rtval[4] = (areasize>>8)&0x0ff;
|
||||
+ rtflg[0] = 1;
|
||||
+ rtflg[1] = 1;
|
||||
+ rtflg[2] = 1;
|
||||
+ rtflg[3] = 1;
|
||||
+ rtflg[4] = 1;
|
||||
+ rtcnt = 5;
|
||||
+ ixx(1);
|
||||
+
|
||||
+
|
||||
+ int addr = areasize;
|
||||
+
|
||||
+
|
||||
+ relrecwritelist1(&head16,&addr);
|
||||
+ relrecwritelist1(&head8lo,&addr);
|
||||
+ relrecwritelist2(&head8hi,&addr);
|
||||
+}
|
||||
diff --git a/sdas/linksrc/lkrrel.h b/sdas/linksrc/lkrrel.h
|
||||
new file mode 100644
|
||||
index 0000000..ca1cfd4
|
||||
--- /dev/null
|
||||
+++ b/sdas/linksrc/lkrrel.h
|
||||
@@ -0,0 +1,17 @@
|
||||
+/* relocation record */
|
||||
+struct relrec
|
||||
+{
|
||||
+ /* next item */
|
||||
+ struct relrec *next;
|
||||
+
|
||||
+ /* address of relocate */
|
||||
+ a_uint addr;
|
||||
+
|
||||
+ a_uint symaddr;
|
||||
+};
|
||||
+
|
||||
+void relrec16(a_uint addr);
|
||||
+void relrec8lo(a_uint addr, a_uint symaddr);
|
||||
+void relrec8hi(a_uint addr, a_uint symaddr);
|
||||
+void freerelrec();
|
||||
+void relrecwrite();
|
||||
--
|
||||
2.37.3
|
||||
|
||||
|
||||
From 75a214c0650285c0eabf34ac3ec97194eead145c Mon Sep 17 00:00:00 2001
|
||||
From: PulkoMandy <pulkomandy@pulkomandy.tk>
|
||||
Date: Mon, 14 Aug 2023 17:11:04 +0200
|
||||
Subject: Port changes from SDCC 4.2.0 patchset
|
||||
|
||||
A lot of them are not needed anymore becasue SDCC 4.3.0 got them from
|
||||
upstream binutils, but some remain in the toplevel directories which are
|
||||
not shared with binutils.
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index ead779c..ac2523d 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -388,10 +388,10 @@ if test "$ac_cv_c_compiler_gnu" = "yes"; then
|
||||
rm -f _test_.*)
|
||||
|
||||
# This is the first time when CFLAGS are set/modified!!
|
||||
- sdcc_IS_VALID_OPTION(-ggdb)
|
||||
- if test "$sdcc_cv_c_ggdb" = "yes"; then
|
||||
- CFLAGS="-ggdb ${CFLAGS}"
|
||||
- CXXFLAGS="-ggdb ${CXXFLAGS}"
|
||||
+ sdcc_IS_VALID_OPTION(-gdwarf-3)
|
||||
+ if test "$sdcc_cv_c_gdwarf-3" = "yes"; then
|
||||
+ CFLAGS="-gdwarf-3 ${CFLAGS}"
|
||||
+ CXXFLAGS="-gdwarf-3 ${CXXFLAGS}"
|
||||
fi
|
||||
|
||||
sdcc_IS_VALID_OPTION(-pipe)
|
||||
diff --git a/src/Makefile.in b/src/Makefile.in
|
||||
index df756fa..35b233d 100644
|
||||
--- a/src/Makefile.in
|
||||
+++ b/src/Makefile.in
|
||||
@@ -65,7 +65,6 @@ $(top_builddir)/support/gc/libgc.a:
|
||||
# ---------------------------------------------------
|
||||
install: all installdirs
|
||||
$(INSTALL) $(TARGET) $(DESTDIR)$(bindir)/`echo sdcc|sed '$(transform)'`$(EXEEXT)
|
||||
- $(STRIP) $(DESTDIR)$(bindir)/`echo sdcc|sed '$(transform)'`$(EXEEXT)
|
||||
|
||||
|
||||
# Deleting all the installed files
|
||||
--
|
||||
2.37.3
|
||||
|
||||
|
||||
From 9769294b9ce181217dbb53518ed5f60c097038dc Mon Sep 17 00:00:00 2001
|
||||
From: PulkoMandy <pulkomandy@pulkomandy.tk>
|
||||
Date: Mon, 14 Aug 2023 23:12:39 +0200
|
||||
Subject: Remove no-PIE options
|
||||
|
||||
They break the build on Haiku
|
||||
|
||||
diff --git a/support/cpp/gcc/Makefile.in b/support/cpp/gcc/Makefile.in
|
||||
index a66839a..6eef446 100644
|
||||
--- a/support/cpp/gcc/Makefile.in
|
||||
+++ b/support/cpp/gcc/Makefile.in
|
||||
@@ -1773,11 +1773,7 @@ libgcc.mvars: config.status Makefile specs xgcc$(exeext)
|
||||
echo GCC_CFLAGS = '$(GCC_CFLAGS)' >> tmp-libgcc.mvars
|
||||
echo INHIBIT_LIBC_CFLAGS = '$(INHIBIT_LIBC_CFLAGS)' >> tmp-libgcc.mvars
|
||||
echo TARGET_SYSTEM_ROOT = '$(TARGET_SYSTEM_ROOT)' >> tmp-libgcc.mvars
|
||||
- if test @enable_default_pie@ = yes; then \
|
||||
- NO_PIE_CFLAGS="-fno-PIE"; \
|
||||
- else \
|
||||
- NO_PIE_CFLAGS=; \
|
||||
- fi; \
|
||||
+ NO_PIE_CFLAGS=; \
|
||||
echo NO_PIE_CFLAGS = "$$NO_PIE_CFLAGS" >> tmp-libgcc.mvars
|
||||
|
||||
mv tmp-libgcc.mvars libgcc.mvars
|
||||
diff --git a/support/cpp/gcc/configure b/support/cpp/gcc/configure
|
||||
index c1dbf50..8896b08 100755
|
||||
--- a/support/cpp/gcc/configure
|
||||
+++ b/support/cpp/gcc/configure
|
||||
@@ -28753,61 +28753,6 @@ $as_echo "#define ENABLE_DEFAULT_PIE 1" >>confdefs.h
|
||||
fi
|
||||
|
||||
|
||||
-# Check if -fno-PIE works.
|
||||
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fno-PIE option" >&5
|
||||
-$as_echo_n "checking for -fno-PIE option... " >&6; }
|
||||
-if ${gcc_cv_c_no_fpie+:} false; then :
|
||||
- $as_echo_n "(cached) " >&6
|
||||
-else
|
||||
- saved_CXXFLAGS="$CXXFLAGS"
|
||||
- CXXFLAGS="$CXXFLAGS -fno-PIE"
|
||||
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
-/* end confdefs.h. */
|
||||
-int main(void) {return 0;}
|
||||
-_ACEOF
|
||||
-if ac_fn_cxx_try_compile "$LINENO"; then :
|
||||
- gcc_cv_c_no_fpie=yes
|
||||
-else
|
||||
- gcc_cv_c_no_fpie=no
|
||||
-fi
|
||||
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
- CXXFLAGS="$saved_CXXFLAGS"
|
||||
-fi
|
||||
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_c_no_fpie" >&5
|
||||
-$as_echo "$gcc_cv_c_no_fpie" >&6; }
|
||||
-if test "$gcc_cv_c_no_fpie" = "yes"; then
|
||||
- NO_PIE_CFLAGS="-fno-PIE"
|
||||
-fi
|
||||
-
|
||||
-
|
||||
-# Check if -no-pie works.
|
||||
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -no-pie option" >&5
|
||||
-$as_echo_n "checking for -no-pie option... " >&6; }
|
||||
-if ${gcc_cv_no_pie+:} false; then :
|
||||
- $as_echo_n "(cached) " >&6
|
||||
-else
|
||||
- saved_LDFLAGS="$LDFLAGS"
|
||||
- LDFLAGS="$LDFLAGS -no-pie"
|
||||
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
-/* end confdefs.h. */
|
||||
-int main(void) {return 0;}
|
||||
-_ACEOF
|
||||
-if ac_fn_cxx_try_link "$LINENO"; then :
|
||||
- gcc_cv_no_pie=yes
|
||||
-else
|
||||
- gcc_cv_no_pie=no
|
||||
-fi
|
||||
-rm -f core conftest.err conftest.$ac_objext \
|
||||
- conftest$ac_exeext conftest.$ac_ext
|
||||
- LDFLAGS="$saved_LDFLAGS"
|
||||
-fi
|
||||
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_no_pie" >&5
|
||||
-$as_echo "$gcc_cv_no_pie" >&6; }
|
||||
-if test "$gcc_cv_no_pie" = "yes"; then
|
||||
- NO_PIE_FLAG="-no-pie"
|
||||
-fi
|
||||
-
|
||||
-
|
||||
# Enable Intel CET on Intel CET enabled host if jit is enabled.
|
||||
# Check whether --enable-cet was given.
|
||||
if test "${enable_cet+set}" = set; then :
|
||||
diff --git a/support/cpp/gcc/configure.ac b/support/cpp/gcc/configure.ac
|
||||
index e5aad31..275e1c1 100644
|
||||
--- a/support/cpp/gcc/configure.ac
|
||||
+++ b/support/cpp/gcc/configure.ac
|
||||
@@ -7648,34 +7648,6 @@ if test x$enable_default_pie = xyes ; then
|
||||
fi
|
||||
AC_SUBST([enable_default_pie])
|
||||
|
||||
-# Check if -fno-PIE works.
|
||||
-AC_CACHE_CHECK([for -fno-PIE option],
|
||||
- [gcc_cv_c_no_fpie],
|
||||
- [saved_CXXFLAGS="$CXXFLAGS"
|
||||
- CXXFLAGS="$CXXFLAGS -fno-PIE"
|
||||
- AC_COMPILE_IFELSE([AC_LANG_SOURCE([int main(void) {return 0;}])],
|
||||
- [gcc_cv_c_no_fpie=yes],
|
||||
- [gcc_cv_c_no_fpie=no])
|
||||
- CXXFLAGS="$saved_CXXFLAGS"])
|
||||
-if test "$gcc_cv_c_no_fpie" = "yes"; then
|
||||
- NO_PIE_CFLAGS="-fno-PIE"
|
||||
-fi
|
||||
-AC_SUBST([NO_PIE_CFLAGS])
|
||||
-
|
||||
-# Check if -no-pie works.
|
||||
-AC_CACHE_CHECK([for -no-pie option],
|
||||
- [gcc_cv_no_pie],
|
||||
- [saved_LDFLAGS="$LDFLAGS"
|
||||
- LDFLAGS="$LDFLAGS -no-pie"
|
||||
- AC_LINK_IFELSE([AC_LANG_SOURCE([int main(void) {return 0;}])],
|
||||
- [gcc_cv_no_pie=yes],
|
||||
- [gcc_cv_no_pie=no])
|
||||
- LDFLAGS="$saved_LDFLAGS"])
|
||||
-if test "$gcc_cv_no_pie" = "yes"; then
|
||||
- NO_PIE_FLAG="-no-pie"
|
||||
-fi
|
||||
-AC_SUBST([NO_PIE_FLAG])
|
||||
-
|
||||
# Enable Intel CET on Intel CET enabled host if jit is enabled.
|
||||
GCC_CET_HOST_FLAGS(CET_HOST_FLAGS)
|
||||
case x$enable_languages in
|
||||
--
|
||||
2.37.3
|
||||
|
||||
|
||||
From b69f4653706ad3bdf3e6287614e823a8f0bc4b39 Mon Sep 17 00:00:00 2001
|
||||
From: PulkoMandy <pulkomandy@pulkomandy.tk>
|
||||
Date: Wed, 16 Aug 2023 12:14:44 +0200
|
||||
Subject: More Haiku support patches
|
||||
|
||||
Imported from GCC 13, as the C preprocessor in SDCC is actually from
|
||||
GCC.
|
||||
|
||||
diff --git a/support/cpp/gcc/config.gcc b/support/cpp/gcc/config.gcc
|
||||
index bec4c7d..c0d4b25 100644
|
||||
--- a/support/cpp/gcc/config.gcc
|
||||
+++ b/support/cpp/gcc/config.gcc
|
||||
@@ -828,6 +828,22 @@ case ${target} in
|
||||
*-*-fuchsia*)
|
||||
native_system_header_dir=/include
|
||||
;;
|
||||
+*-*-haiku*)
|
||||
+ # This is the generic ELF configuration of Haiku. Later
|
||||
+ # machine-specific sections may refine and add to this
|
||||
+ # configuration.
|
||||
+ #
|
||||
+ gas=yes
|
||||
+ gnu_ld=yes
|
||||
+ tmake_file="t-slibgcc"
|
||||
+ case ${enable_threads} in
|
||||
+ "" | yes | posix) thread_file='posix' ;;
|
||||
+ esac
|
||||
+ default_use_cxa_atexit=yes
|
||||
+ tm_p_file="${tm_p_file} haiku-protos.h"
|
||||
+ extra_objs="${extra_objs} haiku.o"
|
||||
+ extra_options="${extra_options} haiku.opt"
|
||||
+ ;;
|
||||
*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu | *-*-uclinuxfdpiceabi)
|
||||
extra_options="$extra_options gnu-user.opt"
|
||||
gas=yes
|
||||
@@ -1137,6 +1153,12 @@ aarch64*-*-netbsd*)
|
||||
tmake_file="${tmake_file} aarch64/t-aarch64 aarch64/t-aarch64-netbsd"
|
||||
extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
|
||||
;;
|
||||
+aarch64*-*-haiku*)
|
||||
+ gcc_cv_initfini_array=yes
|
||||
+ tm_file="${tm_file} elfos.h haiku.h haiku-stdint.h"
|
||||
+ tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-haiku.h"
|
||||
+ tmake_file="${tmake_file} t-haiku aarch64/t-aarch64 aarch64/t-aarch64-haiku"
|
||||
+ ;;
|
||||
aarch64*-*-linux*)
|
||||
tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h"
|
||||
tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-errata.h aarch64/aarch64-linux.h"
|
||||
@@ -1307,6 +1329,16 @@ arm*-*-netbsdelf*)
|
||||
armv7*) target_cpu_cname="generic-armv7-a";;
|
||||
esac
|
||||
;;
|
||||
+arm*-*-haiku*)
|
||||
+ tmake_file="${tmake_file} t-haiku arm/t-arm arm/t-arm-elf arm/t-bpabi arm/t-haiku"
|
||||
+ tm_file="elfos.h haiku.h arm/elf.h arm/bpabi.h arm/haiku.h haiku-stdint.h"
|
||||
+ # The BPABI long long divmod functions return a 128-bit value in
|
||||
+ # registers r0-r3. Correctly modeling that requires the use of
|
||||
+ # TImode.
|
||||
+ need_64bit_hwint=yes
|
||||
+ default_use_cxa_atexit=yes
|
||||
+ tm_file="${tm_file} arm/aout.h arm/arm.h"
|
||||
+ ;;
|
||||
arm*-*-linux-* | arm*-*-uclinuxfdpiceabi)
|
||||
tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
|
||||
extra_options="${extra_options} linux-android.opt"
|
||||
@@ -1926,6 +1958,14 @@ i[34567]86-*-freebsd*)
|
||||
x86_64-*-freebsd*)
|
||||
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/x86-64.h i386/freebsd.h i386/freebsd64.h"
|
||||
;;
|
||||
+i[34567]86-*-haiku*)
|
||||
+ tmake_file="${tmake_file} t-haiku i386/t-crtpic"
|
||||
+ tm_file="${tm_file} i386/unix.h i386/att.h elfos.h haiku.h i386/haiku.h haiku-stdint.h"
|
||||
+ ;;
|
||||
+x86_64-*-haiku*)
|
||||
+ tmake_file="${tmake_file} t-haiku i386/t-haiku64"
|
||||
+ tm_file="${tm_file} i386/unix.h i386/att.h elfos.h haiku.h i386/haiku64.h haiku-stdint.h"
|
||||
+ ;;
|
||||
i[34567]86-*-netbsdelf*)
|
||||
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${nbsd_tm_file} i386/netbsd-elf.h"
|
||||
extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
|
||||
@@ -2391,6 +2431,13 @@ m68k-*-rtems*)
|
||||
tm_file="${tm_file} m68k/m68k-none.h m68k/m68kelf.h dbxelf.h elfos.h m68k/m68kemb.h m68k/m68020-elf.h m68k/rtemself.h rtems.h newlib-stdint.h"
|
||||
tm_defines="${tm_defines} MOTOROLA=1"
|
||||
;;
|
||||
+m68k-*-haiku*)
|
||||
+ default_m68k_cpu=68020
|
||||
+ default_cf_cpu=5206
|
||||
+ tmake_file="${tmake_file} m68k/t-m68kbare m68k/t-crtstuff t-haiku" #??
|
||||
+ tm_file="${tm_file} elfos.h haiku.h m68k/haiku.h haiku-stdint.h"
|
||||
+ tm_defines="${tm_defines} MOTOROLA=1"
|
||||
+ ;;
|
||||
mcore-*-elf)
|
||||
tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file} mcore/mcore-elf.h"
|
||||
tmake_file=mcore/t-mcore
|
||||
@@ -2442,6 +2489,13 @@ microblaze*-*-elf)
|
||||
cxx_target_objs="${cxx_target_objs} microblaze-c.o"
|
||||
tmake_file="${tmake_file} microblaze/t-microblaze"
|
||||
;;
|
||||
+riscv*-*-haiku*)
|
||||
+ gcc_cv_initfini_array=yes
|
||||
+ tm_file="elfos.h haiku.h ${tm_file} riscv/haiku.h haiku-stdint.h"
|
||||
+ tmake_file="${tmake_file} t-haiku riscv/t-riscv riscv/t-haiku"
|
||||
+ gnu_ld=yes
|
||||
+ gas=yes
|
||||
+ ;;
|
||||
riscv*-*-linux*)
|
||||
tm_file="elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} riscv/linux.h"
|
||||
case "x${enable_multilib}" in
|
||||
@@ -2542,6 +2596,11 @@ mips*-mti-linux*)
|
||||
gnu_ld=yes
|
||||
gas=yes
|
||||
;;
|
||||
+mipsel-*-haiku*)
|
||||
+ target_cpu_default="MASK_ABICALLS"
|
||||
+ tm_file="elfos.h ${tm_file} haiku.h mips/haiku.h haiku-stdint.h"
|
||||
+ tmake_file="${tmake_file} mips/t-elf t-haiku"
|
||||
+ ;;
|
||||
mips*-*-linux*) # Linux MIPS, either endian.
|
||||
tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/linux.h mips/linux-common.h"
|
||||
extra_options="${extra_options} linux-android.opt"
|
||||
@@ -2977,6 +3036,11 @@ powerpc-*-eabi*)
|
||||
tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
|
||||
use_gcc_stdint=wrap
|
||||
;;
|
||||
+powerpc-*-haiku*)
|
||||
+ tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-ppcos rs6000/t-ppccomm t-haiku"
|
||||
+ tm_file="${tm_file} elfos.h freebsd-spec.h rs6000/sysv4.h haiku.h rs6000/haiku.h haiku-stdint.h"
|
||||
+ extra_options="${extra_options} rs6000/sysv4.opt"
|
||||
+ ;;
|
||||
powerpc-*-rtems*)
|
||||
tm_file="rs6000/biarch64.h ${tm_file} dbxelf.h elfos.h gnu-user.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/rtems.h rtems.h"
|
||||
extra_options="${extra_options} rs6000/sysv4.opt rs6000/linux64.opt"
|
||||
@@ -3433,6 +3497,11 @@ sparc64-*-rtems*)
|
||||
extra_options="${extra_options}"
|
||||
tmake_file="${tmake_file} sparc/t-sparc sparc/t-rtems-64"
|
||||
;;
|
||||
+sparc64-*-haiku*)
|
||||
+ tm_file="${tm_file} elfos.h sparc/sysv4.h sparc/sp64-elf.h haiku.h sparc/haiku.h haiku-stdint.h"
|
||||
+ extra_options="${extra_options}"
|
||||
+ tmake_file="${tmake_file} t-haiku sparc/t-sparc sparc/t-haiku"
|
||||
+ ;;
|
||||
sparc64-*-linux*)
|
||||
tm_file="sparc/biarch64.h ${tm_file} dbxelf.h elfos.h sparc/sysv4.h gnu-user.h linux.h glibc-stdint.h sparc/default64.h sparc/linux64.h sparc/tso.h"
|
||||
extra_options="${extra_options} sparc/long-double-switch.opt"
|
||||
diff --git a/support/cpp/gcc/config/haiku.opt b/support/cpp/gcc/config/haiku.opt
|
||||
new file mode 100644
|
||||
index 0000000..5b22f3b
|
||||
--- /dev/null
|
||||
+++ b/support/cpp/gcc/config/haiku.opt
|
||||
@@ -0,0 +1,32 @@
|
||||
+; Haiku options.
|
||||
+
|
||||
+; Copyright (C) 2010-2022 Free Software Foundation, Inc.
|
||||
+;
|
||||
+; This file is part of GCC.
|
||||
+;
|
||||
+; GCC is free software; you can redistribute it and/or modify it under
|
||||
+; the terms of the GNU General Public License as published by the Free
|
||||
+; Software Foundation; either version 3, or (at your option) any later
|
||||
+; version.
|
||||
+;
|
||||
+; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
+; WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
+; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
+; for more details.
|
||||
+;
|
||||
+; You should have received a copy of the GNU General Public License
|
||||
+; along with GCC; see the file COPYING3. If not see
|
||||
+; <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+; See the GCC internals manual (options.texi) for a description of
|
||||
+; this file's format.
|
||||
+
|
||||
+; Please try to keep this file in ASCII collating order.
|
||||
+
|
||||
+pthread
|
||||
+Driver
|
||||
+
|
||||
+rdynamic
|
||||
+Driver
|
||||
+
|
||||
+; This comment is to ensure we retain the blank line above.
|
||||
--
|
||||
2.37.3
|
||||
|
||||
@@ -7,13 +7,13 @@ Rabbit 3000A, TLCS-90) and STMicroelectronics STM8. Work is in progress on \
|
||||
supporting the Microchip PIC16 and PIC18 targets. It can be retargeted for \
|
||||
other microprocessors."
|
||||
HOMEPAGE="http://sdcc.sourceforge.net"
|
||||
COPYRIGHT="1999-2022 Sandeep Dutta"
|
||||
COPYRIGHT="1999-2023 Sandeep Dutta"
|
||||
LICENSE="GNU GPL v2"
|
||||
REVISION="2"
|
||||
REVISION="1"
|
||||
SOURCE_URI="http://sourceforge.net/projects/sdcc/files/sdcc/$portVersion/sdcc-src-$portVersion.tar.bz2"
|
||||
SOURCE_DIR="sdcc-$portVersion"
|
||||
CHECKSUM_SHA256="b49bae1d23bcd6057a82c4ffe5613f9cd0cbcfd1e940e9d84c4bfe9df0a8c053"
|
||||
PATCHES="sdcc-4.2.0.patchset"
|
||||
CHECKSUM_SHA256="2a6fc0f021080103daf393ac0efea8ce0f5e9fe2140dce30b999282c81c893cd"
|
||||
PATCHES="sdcc-4.3.0.patchset"
|
||||
|
||||
ARCHITECTURES="all !x86_gcc2"
|
||||
SECONDARY_ARCHITECTURES="x86"
|
||||
@@ -24,7 +24,6 @@ PROVIDES="
|
||||
cmd:makebin
|
||||
cmd:packihx
|
||||
cmd:s51
|
||||
cmd:savr
|
||||
cmd:sdar
|
||||
cmd:sdas390
|
||||
cmd:sdas6500
|
||||
@@ -53,29 +52,15 @@ PROVIDES="
|
||||
cmd:sdnm
|
||||
cmd:sdobjcopy
|
||||
cmd:sdranlib
|
||||
cmd:shc08
|
||||
cmd:sm6800
|
||||
cmd:sm6809
|
||||
cmd:sm68hc08
|
||||
cmd:sm68hc11
|
||||
cmd:smos6502
|
||||
cmd:sp1516
|
||||
cmd:spblaze
|
||||
cmd:spdk
|
||||
cmd:srxk
|
||||
cmd:sst7
|
||||
cmd:sstm8
|
||||
cmd:stlcs
|
||||
cmd:sxa
|
||||
cmd:sz80
|
||||
cmd:ucsim_51
|
||||
cmd:ucsim_avr
|
||||
cmd:ucsim_hc08
|
||||
cmd:ucsim_f8
|
||||
cmd:ucsim_i8085
|
||||
cmd:ucsim_m6800
|
||||
cmd:ucsim_m6809
|
||||
cmd:ucsim_m68hc08
|
||||
cmd:ucsim_m68hc11
|
||||
cmd:ucsim_mcs6502
|
||||
cmd:ucsim_m68hc12
|
||||
cmd:ucsim_mos6502
|
||||
cmd:ucsim_p1516
|
||||
cmd:ucsim_pblaze
|
||||
@@ -103,8 +88,6 @@ BUILD_REQUIRES="
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel
|
||||
cmd:autoconf
|
||||
cmd:autoreconf
|
||||
cmd:automake
|
||||
cmd:bison
|
||||
cmd:find
|
||||
@@ -121,7 +104,6 @@ defineDebugInfoPackage sdcc$secondaryArchSuffix \
|
||||
$prefix/bin/makebin \
|
||||
$prefix/bin/packihx \
|
||||
$prefix/bin/s51 \
|
||||
$prefix/bin/savr \
|
||||
$prefix/bin/sdar \
|
||||
$prefix/bin/sdas390 \
|
||||
$prefix/bin/sdas6500 \
|
||||
@@ -148,29 +130,15 @@ defineDebugInfoPackage sdcc$secondaryArchSuffix \
|
||||
$prefix/bin/sdnm \
|
||||
$prefix/bin/sdobjcopy \
|
||||
$prefix/bin/sdranlib \
|
||||
$prefix/bin/shc08 \
|
||||
$prefix/bin/sm6800 \
|
||||
$prefix/bin/sm6809 \
|
||||
$prefix/bin/sm68hc08 \
|
||||
$prefix/bin/sm68hc11 \
|
||||
$prefix/bin/smos6502 \
|
||||
$prefix/bin/sp1516 \
|
||||
$prefix/bin/spblaze \
|
||||
$prefix/bin/spdk \
|
||||
$prefix/bin/srxk \
|
||||
$prefix/bin/sst7 \
|
||||
$prefix/bin/sstm8 \
|
||||
$prefix/bin/stlcs \
|
||||
$prefix/bin/sxa \
|
||||
$prefix/bin/sz80 \
|
||||
$prefix/bin/ucsim_51 \
|
||||
$prefix/bin/ucsim_avr \
|
||||
$prefix/bin/ucsim_hc08 \
|
||||
$prefix/bin/ucsim_f8 \
|
||||
$prefix/bin/ucsim_i8085 \
|
||||
$prefix/bin/ucsim_m6800 \
|
||||
$prefix/bin/ucsim_m6809 \
|
||||
$prefix/bin/ucsim_m68hc08 \
|
||||
$prefix/bin/ucsim_m68hc11 \
|
||||
$prefix/bin/ucsim_mcs6502 \
|
||||
$prefix/bin/ucsim_m68hc12 \
|
||||
$prefix/bin/ucsim_mos6502 \
|
||||
$prefix/bin/ucsim_p1516 \
|
||||
$prefix/bin/ucsim_pblaze \
|
||||
@@ -184,32 +152,10 @@ defineDebugInfoPackage sdcc$secondaryArchSuffix \
|
||||
|
||||
BUILD()
|
||||
{
|
||||
pushd device/lib/pic16
|
||||
autoreconf -f
|
||||
popd
|
||||
|
||||
pushd device/non-free/lib/pic16
|
||||
autoreconf -f
|
||||
popd
|
||||
|
||||
pushd device/lib/pic14
|
||||
autoreconf -f
|
||||
popd
|
||||
|
||||
pushd device/non-free/lib/pic14
|
||||
autoreconf -f
|
||||
popd
|
||||
|
||||
pushd support/cpp
|
||||
autoconf
|
||||
popd
|
||||
|
||||
autoconf
|
||||
|
||||
mkdir -p build
|
||||
pushd build
|
||||
|
||||
export CFLAGS="-DO_ASYNC=0"
|
||||
export CFLAGS="-DO_ASYNC=0 -fPIC"
|
||||
export LDFLAGS="-lnetwork"
|
||||
|
||||
runConfigure ../configure \
|
||||
Reference in New Issue
Block a user