Skip to content

Commit

Permalink
m68k-palm-elf-gcc: add newlib
Browse files Browse the repository at this point in the history
I mistakenly left newlib out, thinking it wasn't necessary. Now this
port should actually match the Linux build script provided by dmitrygr.
  • Loading branch information
nkorth authored and pmetzger committed Apr 4, 2024
1 parent 311d396 commit 8184725
Show file tree
Hide file tree
Showing 4 changed files with 160 additions and 142 deletions.
4 changes: 3 additions & 1 deletion palm/m68k-palm-elf-gcc/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ PortGroup crossgcc 1.0

crossgcc.setup m68k-palm-elf 9.1.0
crossgcc.languages c
revision 0
crossgcc.setup_libc newlib 3.0.0
revision 1
maintainers {@nkorth nkorth.com:nkorth} openmaintainer
categories palm cross


patch.pre_args -p1
patch.dir ${workpath}
patchfiles retro68.diff \
palm.diff \
aarch64.diff
Expand Down
20 changes: 10 additions & 10 deletions palm/m68k-palm-elf-gcc/files/aarch64.diff
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
diff --git a/config.guess b/config.guess
diff --git a/gcc-9.1.0/config.guess b/gcc-9.1.0/config.guess
index 8e2a58b86..772577d8d 100755
--- a/config.guess
+++ b/config.guess
--- a/gcc-9.1.0/config.guess
+++ b/gcc-9.1.0/config.guess
@@ -1309,6 +1309,9 @@ EOF
*:Rhapsody:*:*)
echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
Expand All @@ -12,10 +12,10 @@ index 8e2a58b86..772577d8d 100755
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
set_cc_for_build
diff --git a/gcc/config.host b/gcc/config.host
diff --git a/gcc-9.1.0/gcc/config.host b/gcc-9.1.0/gcc/config.host
index 816a0f06c..adaa50b73 100644
--- a/gcc/config.host
+++ b/gcc/config.host
--- a/gcc-9.1.0/gcc/config.host
+++ b/gcc-9.1.0/gcc/config.host
@@ -99,7 +99,8 @@ case ${host} in
esac

Expand All @@ -37,11 +37,11 @@ index 816a0f06c..adaa50b73 100644
rs6000-ibm-aix* | powerpc-ibm-aix*)
host_xmake_file="${host_xmake_file} rs6000/x-aix"
;;
diff --git a/gcc/config/aarch64/host-aarch64-darwin.c b/gcc/config/aarch64/host-aarch64-darwin.c
diff --git a/gcc-9.1.0/gcc/config/aarch64/host-aarch64-darwin.c b/gcc-9.1.0/gcc/config/aarch64/host-aarch64-darwin.c
new file mode 100644
index 000000000..5ed81cf7d
--- /dev/null
+++ b/gcc/config/aarch64/host-aarch64-darwin.c
+++ b/gcc-9.1.0/gcc/config/aarch64/host-aarch64-darwin.c
@@ -0,0 +1,32 @@
+/* i386-darwin host-specific hook definitions.
+ Copyright (C) 2003-2019 Free Software Foundation, Inc.
Expand Down Expand Up @@ -75,11 +75,11 @@ index 000000000..5ed81cf7d
+ to include config/host-darwin.h. */
+
+const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER;
diff --git a/gcc/config/aarch64/x-darwin b/gcc/config/aarch64/x-darwin
diff --git a/gcc-9.1.0/gcc/config/aarch64/x-darwin b/gcc-9.1.0/gcc/config/aarch64/x-darwin
new file mode 100644
index 000000000..6d788d5e8
--- /dev/null
+++ b/gcc/config/aarch64/x-darwin
+++ b/gcc-9.1.0/gcc/config/aarch64/x-darwin
@@ -0,0 +1,3 @@
+host-aarch64-darwin.o : $(srcdir)/config/aarch64/host-aarch64-darwin.c
+ $(COMPILE) $<
Expand Down
80 changes: 48 additions & 32 deletions palm/m68k-palm-elf-gcc/files/palm.diff
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
diff --git a/gcc/c-family/c-lex.c b/gcc/c-family/c-lex.c
diff --git a/gcc-9.1.0/gcc/c-family/c-lex.c b/gcc-9.1.0/gcc/c-family/c-lex.c
index 03dca31e7..c46a3a151 100644
--- a/gcc/c-family/c-lex.c
+++ b/gcc/c-family/c-lex.c
--- a/gcc-9.1.0/gcc/c-family/c-lex.c
+++ b/gcc-9.1.0/gcc/c-family/c-lex.c
@@ -1353,10 +1353,15 @@ lex_charconst (const cpp_token *token)
}
/* In C, a character constant has type 'int'.
Expand All @@ -21,10 +21,10 @@ index 03dca31e7..c46a3a151 100644

/* Cast to cppchar_signed_t to get correct sign-extension of RESULT
before possibly widening to HOST_WIDE_INT for build_int_cst. */
diff --git a/gcc/c-family/c-pragma.c b/gcc/c-family/c-pragma.c
diff --git a/gcc-9.1.0/gcc/c-family/c-pragma.c b/gcc-9.1.0/gcc/c-family/c-pragma.c
index fbc734a04..5f8c75086 100644
--- a/gcc/c-family/c-pragma.c
+++ b/gcc/c-family/c-pragma.c
--- a/gcc-9.1.0/gcc/c-family/c-pragma.c
+++ b/gcc-9.1.0/gcc/c-family/c-pragma.c
@@ -1557,7 +1557,7 @@ init_pragma (void)
c_register_pragma_with_expansion (0, "message", handle_pragma_message);

Expand All @@ -34,10 +34,10 @@ index fbc734a04..5f8c75086 100644
#endif

global_sso = default_sso;
diff --git a/gcc/calls.c b/gcc/calls.c
diff --git a/gcc-9.1.0/gcc/calls.c b/gcc-9.1.0/gcc/calls.c
index 3d5af427d..b0ce7d4ac 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
--- a/gcc-9.1.0/gcc/calls.c
+++ b/gcc-9.1.0/gcc/calls.c
@@ -4092,7 +4092,7 @@ expand_call (tree exp, rtx target, int ignore)

if (is_pascal)
Expand All @@ -47,10 +47,10 @@ index 3d5af427d..b0ce7d4ac 100644
poly_uint16 modesize = GET_MODE_SIZE (pascal_return_mode);
#ifdef PUSH_ROUNDING
modesize = PUSH_ROUNDING (modesize);
diff --git a/gcc/config.gcc b/gcc/config.gcc
diff --git a/gcc-9.1.0/gcc/config.gcc b/gcc-9.1.0/gcc/config.gcc
index 19fc2b6fc..904f58ee5 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
--- a/gcc-9.1.0/gcc/config.gcc
+++ b/gcc-9.1.0/gcc/config.gcc
@@ -456,8 +456,6 @@ m32r*-*-*)
m68k-*-*)
extra_headers=math-68881.h
Expand All @@ -60,10 +60,10 @@ index 19fc2b6fc..904f58ee5 100644
;;
microblaze*-*-*)
cpu_type=microblaze
diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c
diff --git a/gcc-9.1.0/gcc/config/m68k/m68k.c b/gcc-9.1.0/gcc/config/m68k/m68k.c
index d66ea01a9..b10a1ebf2 100644
--- a/gcc/config/m68k/m68k.c
+++ b/gcc/config/m68k/m68k.c
--- a/gcc-9.1.0/gcc/config/m68k/m68k.c
+++ b/gcc-9.1.0/gcc/config/m68k/m68k.c
@@ -5537,9 +5537,9 @@ m68k_function_value (const_tree valtype, const_tree func_decl_or_type, bool outg
break;
}
Expand All @@ -87,10 +87,10 @@ index d66ea01a9..b10a1ebf2 100644
return gen_rtx_REG (mode, A0_REG);
else
return gen_rtx_REG (mode, D0_REG);
diff --git a/libcpp/charset.c b/libcpp/charset.c
diff --git a/gcc-9.1.0/libcpp/charset.c b/gcc-9.1.0/libcpp/charset.c
index 67eddcc7f..452143631 100644
--- a/libcpp/charset.c
+++ b/libcpp/charset.c
--- a/gcc-9.1.0/libcpp/charset.c
+++ b/gcc-9.1.0/libcpp/charset.c
@@ -1796,7 +1796,7 @@ narrow_str_to_charconst (cpp_reader *pfile, cpp_string str,
unsigned int *pchars_seen, int *unsignedp)
{
Expand Down Expand Up @@ -125,10 +125,10 @@ index 67eddcc7f..452143631 100644
if (width < BITS_PER_CPPCHAR_T)
{
mask = ((cppchar_t) 1 << width) - 1;
diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in
diff --git a/gcc-9.1.0/libgcc/Makefile.in b/gcc-9.1.0/libgcc/Makefile.in
index ea390a5bb..2b4eb8601 100644
--- a/libgcc/Makefile.in
+++ b/libgcc/Makefile.in
--- a/gcc-9.1.0/libgcc/Makefile.in
+++ b/gcc-9.1.0/libgcc/Makefile.in
@@ -246,7 +246,8 @@ LIBGCC2_DEBUG_CFLAGS = -g
LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) $(HOST_LIBGCC2_CFLAGS) \
$(LIBGCC2_DEBUG_CFLAGS) -DIN_LIBGCC2 \
Expand All @@ -155,18 +155,11 @@ index ea390a5bb..2b4eb8601 100644
# The floating-point conversion routines that involve a single-word integer.
# XX stands for the integer mode.
swfloatfuncs = $(patsubst %,_fixuns%XX,sf df xf)
diff --git a/libgcc/config/m68k/lb1sf68.S b/libgcc/config/m68k/lb1sf68.S
diff --git a/gcc-9.1.0/libgcc/config/m68k/lb1sf68.S b/gcc-9.1.0/libgcc/config/m68k/lb1sf68.S
index c38721122..2bd998c2e 100644
--- a/libgcc/config/m68k/lb1sf68.S
+++ b/libgcc/config/m68k/lb1sf68.S
@@ -97,16 +97,18 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
* a little on this and in the PIC case, we use short offset branches and
* hope that the final object code is within range (which it should be).
*/
+
+
#ifndef __PIC__

--- a/gcc-9.1.0/libgcc/config/m68k/lb1sf68.S
+++ b/gcc-9.1.0/libgcc/config/m68k/lb1sf68.S
@@ -104,11 +104,11 @@
/* Non PIC (absolute/relocatable) versions */

.macro PICCALL addr
Expand All @@ -180,3 +173,26 @@ index c38721122..2bd998c2e 100644
.endm

.macro PICLEA sym, reg
@@ -166,7 +166,7 @@
lea \addr-.-8,a0
jsr pc@(a0)
#else
- jbsr \addr
+ bsr \addr
#endif
.endm

diff --git a/newlib-3.0.0/newlib/libc/machine/m68k/memset.S b/newlib-3.0.0/newlib/libc/machine/m68k/memset.S
--- a/newlib-3.0.0/newlib/libc/machine/m68k/memset.S 2018-01-18 13:07:45
+++ b/newlib-3.0.0/newlib/libc/machine/m68k/memset.S 2024-03-30 16:35:58
@@ -42,8 +42,8 @@
|
SYM(memset):
move.l 4(sp),a0 | dest ptr
- move.l 8(sp),d0 | value
- move.l 12(sp),d1 | len
+ move.w 8(sp),d0 | value
+ move.l 10(sp),d1 | len
cmp.l #16,d1
blo .Lbset | below, byte fills
|
Loading

0 comments on commit 8184725

Please sign in to comment.