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-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'.
      In C++ 'char', but multi-char charconsts have type 'int'.  */
-  else if (!c_dialect_cxx () || chars_seen > 1)
-    type = integer_type_node;
-  else
+  else if (c_dialect_cxx ())
     type = char_type_node;
+  else if (chars_seen > 2)
+    type = long_unsigned_type_node;
+  else if (chars_seen > 1)
+    type = unsigned_type_node;
+  else
+    type = integer_type_node;
+
 
   /* 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-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-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);
 
 #ifdef REGISTER_TARGET_PRAGMAS
-  REGISTER_TARGET_PRAGMAS ();
+//  REGISTER_TARGET_PRAGMAS ();
 #endif
 
   global_sso = default_sso;
diff --git a/gcc-9.1.0/gcc/calls.c b/gcc-9.1.0/gcc/calls.c
index 3d5af427d..b0ce7d4ac 100644
--- 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)
 	{
-	  auto pascal_return_mode = TYPE_MODE (TREE_TYPE (funtype));
+	  machine_mode pascal_return_mode = TYPE_MODE (TREE_TYPE (funtype));
 	  poly_uint16 modesize = GET_MODE_SIZE (pascal_return_mode);
 #ifdef PUSH_ROUNDING
 	  modesize = PUSH_ROUNDING (modesize);
diff --git a/gcc-9.1.0/gcc/config.gcc b/gcc-9.1.0/gcc/config.gcc
index 19fc2b6fc..904f58ee5 100644
--- 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
 	extra_options="${extra_options} m68k/m68k-tables.opt"
-	c_target_objs="m68k-mac-pragmas.o"
-	cxx_target_objs="m68k-mac-pragmas.o"
 	;;
 microblaze*-*-*)
         cpu_type=microblaze
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-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;
   }
 
-#if 1 /* POINTERS_IN_D0 */
+#if 0 /* POINTERS_IN_D0 */
   return gen_rtx_REG (mode, D0_REG);
-#else
+
   /* If the function returns a pointer, push that into %a0.  */
   if (type && POINTER_TYPE_P (TREE_TYPE (type)) && !outgoing)
     /* For compatibility with the large body of existing code which
@@ -5558,7 +5558,9 @@ m68k_function_value (const_tree valtype, const_tree func_decl_or_type, bool outg
 		  gen_rtx_EXPR_LIST (VOIDmode,
 				     gen_rtx_REG (mode, D0_REG),
 				     const0_rtx)));
-  else if (POINTER_TYPE_P (valtype))
+  else
+#else
+ if (POINTER_TYPE_P (valtype))
     return gen_rtx_REG (mode, A0_REG);
   else
     return gen_rtx_REG (mode, D0_REG);
diff --git a/gcc-9.1.0/libcpp/charset.c b/gcc-9.1.0/libcpp/charset.c
index 67eddcc7f..452143631 100644
--- 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)
 {
   size_t width = CPP_OPTION (pfile, char_precision);
-  size_t max_chars = CPP_OPTION (pfile, int_precision) / width;
+  size_t max_chars = 4;
   size_t mask = width_to_mask (width);
   size_t i;
   cppchar_t result, c;
@@ -1831,9 +1831,9 @@ narrow_str_to_charconst (cpp_reader *pfile, cpp_string str,
   else if (i > 1 && i != 4 && CPP_OPTION (pfile, warn_multichar))
     cpp_warning (pfile, CPP_W_MULTICHAR, "multi-character character constant");
 
-  /* Multichar constants are of type int and therefore signed.  */
+  /* Multichar constants are of type UNSIGNED LONG for PALMOS.  */
   if (i > 1)
-    unsigned_p = 0;
+    unsigned_p = 1;
   else
     unsigned_p = CPP_OPTION (pfile, unsigned_char);
 
@@ -1841,8 +1841,10 @@ narrow_str_to_charconst (cpp_reader *pfile, cpp_string str,
      sign- or zero-extend to the full width of cppchar_t.
      For single-character constants, the value is WIDTH bits wide.
      For multi-character constants, the value is INT_PRECISION bits wide.  */
-  if (i > 1)
-    width = CPP_OPTION (pfile, int_precision);
+  if (i > 2)	//3-4 char sequences are long, 2-char seq is short
+    width = 32;
+  else if (i > 1)
+    width = 16;
   if (width < BITS_PER_CPPCHAR_T)
     {
       mask = ((cppchar_t) 1 << width) - 1;
diff --git a/gcc-9.1.0/libgcc/Makefile.in b/gcc-9.1.0/libgcc/Makefile.in
index ea390a5bb..2b4eb8601 100644
--- 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 \
 		 -fbuilding-libgcc -fno-stack-protector \
-		 $(INHIBIT_LIBC_CFLAGS)
+		 -ffunction-sections \
+		 $(INHIBIT_LIBC_CFLAGS) -mpcrel -fpic
 
 # Additional options to use when compiling libgcc2.a.
 # Some targets override this to -isystem include
@@ -441,10 +442,13 @@ lib2funcs = _muldi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3 _cmpdi2 _ucmpdi2	   \
 	    _negvsi2 _negvdi2 _ctors _ffssi2 _ffsdi2 _clz _clzsi2 _clzdi2  \
 	    _ctzsi2 _ctzdi2 _popcount_tab _popcountsi2 _popcountdi2	   \
 	    _paritysi2 _paritydi2 _powisf2 _powidf2 _powixf2 _powitf2	   \
-	    _mulhc3 _mulsc3 _muldc3 _mulxc3 _multc3 _divhc3 _divsc3	   \
-	    _divdc3 _divxc3 _divtc3 _bswapsi2 _bswapdi2 _clrsbsi2	   \
+	     _bswapsi2 _bswapdi2 _clrsbsi2	   \
 	    _clrsbdi2
 
+# complex shit we do not support (gcc bugs cause compile failure)
+#lib2funcs += _mulhc3 _mulsc3 _muldc3 _mulxc3 _multc3 _divhc3 _divsc3	   \
+#	    _divdc3 _divxc3 _divtc3
+
 # 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/gcc-9.1.0/libgcc/config/m68k/lb1sf68.S b/gcc-9.1.0/libgcc/config/m68k/lb1sf68.S
index c38721122..2bd998c2e 100644
--- 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
-	jbsr	\addr
+	bsr	\addr
 	.endm
 
 	.macro PICJUMP addr
-	jmp	\addr
+	bra	\addr
 	.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
 	|
