code:
--- btrfs-progs-v5.13.1/common/utils.c.orig	2021-07-30 11:14:58.000000000 -0300
+++ btrfs-progs-v5.13.1/common/utils.c	2021-08-03 22:21:04.639082657 -0300
@@ -24,7 +24,21 @@
 #include <sys/mount.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+
+#ifndef __GLIBC__
+/*
+ * linux/sysinfo.h (which gets indirectly included by other kernel headers)
+ * conflicts with sys/sysinfo.h on musl, so make sure it doesn't get expanded.
+ * We cannot do this unconditionally as E.G. glibc/uClibc rely on the
+ * linux/sysinfo.h definition.
+ * Musl provides no detection define, so instead detect that we are
+ * NOT on glibc/uClibc.
+ */
+#define _LINUX_SYSINFO_H
+#endif
+
 #include <sys/sysinfo.h>
+
 #include <uuid/uuid.h>
 #include <fcntl.h>
 #include <unistd.h>

repo_name: dustdfg/dragora

license: mit


code:
Submitted By:            Matthew Burgess <matthew@linuxfromscratch.org>
Date:                    2007-01-31
Initial Package Version: 1.0.4
Upstream Status:         Not submitted
Origin:                  Randy McMurchy & Steve Crosby
Description:             Installs pre-formatted documentation

diff -Naur bzip2-1.0.4.orig/Makefile bzip2-1.0.4/Makefile
--- bzip2-1.0.4.orig/Makefile	2007-01-03 03:49:21.000000000 +0000
+++ bzip2-1.0.4/Makefile	2007-01-26 20:00:01.000000000 +0000
@@ -25,7 +25,7 @@

 # Where you want it installed when you do 'make install'
 PREFIX=/usr/local
-
+DOCDIR=share/doc/$(DISTNAME)

 OBJS= blocksort.o  \
       huffman.o    \
@@ -74,6 +74,7 @@
 	if ( test ! -d $(PREFIX)/lib ) ; then mkdir -p $(PREFIX)/lib ; fi
 	if ( test ! -d $(PREFIX)/man ) ; then mkdir -p $(PREFIX)/man ; fi
 	if ( test ! -d $(PREFIX)/man/man1 ) ; then mkdir -p $(PREFIX)/man/man1 ; fi
+	if ( test ! -d $(PREFIX)/$(DOCDIR) ) ; then mkdir -p $(PREFIX)/$(DOCDIR); fi
 	if ( test ! -d $(PREFIX)/include ) ; then mkdir -p $(PREFIX)/include ; fi
 	cp -f bzip2 $(PREFIX)/bin/bzip2
 	cp -f bzip2 $(PREFIX)/bin/bunzip2
@@ -107,6 +108,14 @@
 	echo ".so man1/bzgrep.1" > $(PREFIX)/man/man1/bzfgrep.1
 	echo ".so man1/bzmore.1" > $(PREFIX)/man/man1/bzless.1
 	echo ".so man1/bzdiff.1" > $(PREFIX)/man/man1/bzcmp.1
+	cp -f manual.html $(PREFIX)/$(DOCDIR)
+	cp -f manual.pdf $(PREFIX)/$(DOCDIR)
+	cp -f manual.ps $(PREFIX)/$(DOCDIR)
+	cp -f bzip2.txt $(PREFIX)/$(DOCDIR)
+	chmod a+r $(PREFIX)/$(DOCDIR)/manual.html
+	chmod a+r $(PREFIX)/$(DOCDIR)/manual.pdf
+	chmod a+r $(PREFIX)/$(DOCDIR)/manual.ps
+	chmod a+r $(PREFIX)/$(DOCDIR)/bzip2.txt

 clean:
 	rm -f *.o libbz2.a bzip2 bzip2recover \


code:
musl does not implement res_ninit

--- a/gweb/gresolv.c
+++ b/gweb/gresolv.c
@@ -877,8 +877,6 @@
 	resolv->index = index;
 	resolv->nameserver_list = NULL;

-	res_ninit(&resolv->res);
-
 	return resolv;
 }

@@ -918,8 +916,6 @@

 	flush_nameservers(resolv);

-	res_nclose(&resolv->res);
-
 	g_free(resolv);
 }

@@ -1022,24 +1018,19 @@
 	debug(resolv, "hostname %s", hostname);

 	if (!resolv->nameserver_list) {
-		int i;
-
-		for (i = 0; i < resolv->res.nscount; i++) {
-			char buf[100];
-			int family = resolv->res.nsaddr_list[i].sin_family;
-			void *sa_addr = &resolv->res.nsaddr_list[i].sin_addr;
-
-			if (family != AF_INET &&
-					resolv->res._u._ext.nsaddrs[i]) {
-				family = AF_INET6;
-				sa_addr = &resolv->res._u._ext.nsaddrs[i]->sin6_addr;
+		FILE *f = fopen("/etc/resolv.conf", "r");
+		if (f) {
+			char line[256], *s;
+			int i;
+			while (fgets(line, sizeof(line), f)) {
+				if (strncmp(line, "nameserver", 10) || !isspace(line[10]))
+					continue;
+				for (s = &line[11]; isspace(s[0]); s++);
+				for (i = 0; s[i] && !isspace(s[i]); i++);
+				s[i] = 0;
+				g_resolv_add_nameserver(resolv, s, 53, 0);
 			}
-
-			if (family != AF_INET && family != AF_INET6)
-				continue;
-
-			if (inet_ntop(family, sa_addr, buf, sizeof(buf)))
-				g_resolv_add_nameserver(resolv, buf, 53, 0);
+			fclose(f);
 		}

 		if (!resolv->nameserver_list)


code:
diff --git a/src/chmod.c b/src/chmod.c
index 37b04f500..57ac47f33 100644
--- a/src/chmod.c
+++ b/src/chmod.c
@@ -44,8 +44,8 @@ struct change_status
   enum
     {
       CH_NO_STAT,
-      CH_NOT_APPLIED,
       CH_FAILED,
+      CH_NOT_APPLIED,
       CH_NO_CHANGE_REQUESTED,
       CH_SUCCEEDED
     }
@@ -322,7 +322,7 @@ process_file (FTS *fts, FTSENT *ent)
   if ( ! recurse)
     fts_set (fts, ent, FTS_SKIP);

-  return CH_NO_CHANGE_REQUESTED <= ch.status;
+  return CH_NOT_APPLIED <= ch.status;
 }


code:
--- configure.ac	2022-01-13 09:23:53.000000000 +0000
+++ configure.ac	2022-07-20 11:59:07.503797192 +0100
@@ -415,7 +415,7 @@

 dnl Check for libssh and argp for SSH plugin
 if test "x$enable_ssh_token" = "xyes"; then
-	PKG_CHECK_MODULES([LIBSSH], [libssh])
+	PKG_CHECK_MODULES([LIBSSH], [libssh2])
 	AC_CHECK_DECLS([ssh_session_is_known_server], [], [], [#include <libssh/libssh.h>])
 	AC_CHECK_HEADER([argp.h], [], AC_MSG_ERROR([You need argp library.]))
 	saved_LIBS=$LIBS


code:
--- src/histedit.c.orig	2014-09-30 07:57:27.000000000 -0300
+++ src/histedit.c	2016-11-21 16:07:16.000000000 -0300
@@ -39,6 +39,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
+#include <getopt.h>
 /*
  * Editline and history functions (and glue).
  */


code:
diff -Nur dbus-1.12.0.orig/bus/system.conf.in dbus-1.12.0/bus/system.conf.in
--- dbus-1.12.0.orig/bus/system.conf.in	2017-10-30 07:26:18.000000000 -0500
+++ dbus-1.12.0/bus/system.conf.in	2017-10-31 00:17:34.989634085 -0500
@@ -125,6 +125,14 @@
   <!-- <limit name="max_match_rules_per_connection">512</limit> -->
   <!-- <limit name="max_replies_per_connection">128</limit> -->

+  <!-- Allow root to do anything over the messagebus.
+       Don't whine about "security" - anyone with root privileges
+       can edit this file anyway, so -ENOHOLE here. -->
+  <policy user="root">
+    <allow send_destination="*"/>
+    <allow send_interface="*"/>
+  </policy>
+
   <!-- Config files are placed here that among other things, punch
        holes in the above policy for specific services. -->
   <includedir>system.d</includedir>


code:
Submitted By:            Bruce Dubbs <bdubbs at linuxfromscratch dot org>
Date:                    2018-01-01
Initial Package Version: 1.78.1
Upstream Status:         Unsure
Origin:                  Peter De Wachter <pdewacht@gmail.com>
Description: use EXSLT "replace" function when available
 A recursive implementation  of string.subst is problematic,
 long strings with many matches will cause stack overflows.
Author: Peter De Wachter <pdewacht@gmail.com>
Bug-Debian: https://bugs.debian.org/750593

Rediffed for 1.79.2 by Bruce Dubbs

diff -Naur docbook-xsl-1.79.2.orig/lib/lib.xsl docbook-xsl-1.79.2/lib/lib.xsl
--- docbook-xsl-1.79.2.orig/lib/lib.xsl	2016-12-09 16:41:39.000000000 -0600
+++ docbook-xsl-1.79.2/lib/lib.xsl	2018-01-01 12:54:52.507332514 -0600
@@ -6,7 +6,11 @@

      This module implements DTD-independent functions

-     ******************************************************************** --><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+     ******************************************************************** -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:str="http://exslt.org/strings"
+                exclude-result-prefixes="str"
+                version="1.0">

 <xsl:template name="dot.count">
   <!-- Returns the number of "." characters in a string -->
@@ -52,6 +56,9 @@
   <xsl:param name="replacement"/>

   <xsl:choose>
+    <xsl:when test="function-available('str:replace')">
+      <xsl:value-of select="str:replace($string, string($target), string($replacement))"/>
+    </xsl:when>
     <xsl:when test="contains($string, $target)">
       <xsl:variable name="rest">
         <xsl:call-template name="string.subst">


code:
--- config.def.h.orig	2018-09-06 15:46:50.000000000 -0300
+++ config.def.h	2019-01-03 18:42:25.438213598 -0300
@@ -5,8 +5,8 @@
 static const unsigned int snap      = 32;       /* snap pixel */
 static const int showbar            = 1;        /* 0 means no bar */
 static const int topbar             = 1;        /* 0 means bottom bar */
-static const char *fonts[]          = { "monospace:size=10" };
-static const char dmenufont[]       = "monospace:size=10";
+static const char *fonts[]          = { "monospace:size=14" };
+static const char dmenufont[]       = "monospace:size=14";
 static const char col_gray1[]       = "#222222";
 static const char col_gray2[]       = "#444444";
 static const char col_gray3[]       = "#bbbbbb";


code:
From 1f310c1814ab0dde06a1a66da847b6c75a1dab2e Mon Sep 17 00:00:00 2001
From: DustDFG <dfgdust@gmail.com>
Date: Mon, 28 Feb 2022 10:11:09 +0000
Subject: [PATCH] Use groff as 'MANDOC'

Signed-off-by: DustDFG <dfgdust@gmail.com>
---
 src/include/defaults.mk | 2 +-
 src/include/rules.mk    | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/include/defaults.mk b/src/include/defaults.mk
index 632b155..1c88da1 100644
--- a/src/include/defaults.mk
+++ b/src/include/defaults.mk
@@ -111,7 +111,7 @@ NM	:= $(CROSS_COMPILE)$(COMPILER)-nm
 RANLIB	:= $(CROSS_COMPILE)$(COMPILER)-ranlib
 ABIDW	:= abidw
 ABIDIFF := abidiff
-MANDOC	:= mandoc
+MANDOC	:= groff

 LDLIBS=$(foreach lib,$(LIBS),-l$(lib)) $(call pkg-config-ldlibs)

diff --git a/src/include/rules.mk b/src/include/rules.mk
index f309f86..a2f0cca 100644
--- a/src/include/rules.mk
+++ b/src/include/rules.mk
@@ -21,10 +21,10 @@ family = $(foreach FAMILY_SUFFIX,$(FAMILY_SUFFIXES),$($(1)_$(FAMILY_SUFFIX)))
 	$(AR) -cvqs $@ $^

 %.1 : %.1.mdoc
-	$(MANDOC) -mdoc -Tman -Ios=Linux $^ > $@
+	$(MANDOC) -mdoc -Tascii -Ios=Linux $^ > $@

 %.3 : %.3.mdoc
-	$(MANDOC) -mdoc -Tman -Ios=Linux $^ > $@
+	$(MANDOC) -mdoc -Tascii -Ios=Linux $^ > $@

 % : %.c

--
2.20.1


code:
--- a/libcpu/i386_disasm.c	2015-08-21 14:22:37.000000000 +0200
+++ b/libcpu/i386_disasm.c	2015-11-20 06:30:59.250629957 +0100
@@ -1,4 +1,4 @@
-/* Disassembler for x86.
+/* Disassembler for x86.
    Copyright (C) 2007, 2008, 2009, 2011 Red Hat, Inc.
    This file is part of elfutils.
    Written by Ulrich Drepper <drepper@redhat.com>, 2007.
@@ -710,6 +710,7 @@

 		case 'm':
 		  /* Mnemonic.  */
+		  str = mnebuf;

 		  if (unlikely (instrtab[cnt].mnemonic == MNE_INVALID))
 		    {


code:
--- a/backends/ppc_initreg.c	2019-11-26 23:48:42.000000000 +0100
+++ b/backends/ppc_initreg.c	2019-12-08 16:57:58.334872602 +0100
@@ -32,6 +32,7 @@

 #include <stdlib.h>
 #if defined(__powerpc__) && defined(__linux__)
+# include <asm/ptrace.h>
 # include <sys/ptrace.h>
 # include <sys/user.h>
 #endif


code:
--- src/arlib.h	2015-08-21 14:22:37.000000000 +0200
+++ src/arlib.h	2015-11-20 08:02:55.153199611 +0100
@@ -29,6 +29,16 @@
 #include <stdint.h>
 #include <sys/types.h>

+#if !defined(ACCESSPERMS)
+# define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) /* 0777 */
+#endif
+#if !defined(ALLPERMS)
+# define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) /* 07777 */
+#endif
+#if !defined(DEFFILEMODE)
+# define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)/* 0666*/
+#endif
+

 /* State of -D/-U flags.  */
 extern bool arlib_deterministic_output;
--- src/elfcompress.c.orig	2016-04-02 12:51:26.903848894 +0200
+++ src/elfcompress.c	2016-04-02 12:55:15.076996338 +0200
@@ -35,6 +35,14 @@
 #include <gelf.h>
 #include "system.h"

+#if !defined(FNM_EXTMATCH)
+# define FNM_EXTMATCH 0
+#endif
+
+#if !defined(ALLPERMS)
+# define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) /* 07777 */
+#endif
+
 /* Name and version of program.  */
 static void print_version (FILE *stream, struct argp_state *state);
 ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
--- src/strip.c.orig	2017-08-02 12:06:25.000000000 +0000
+++ src/strip.c	2017-08-05 01:58:01.523493062 +0000
@@ -47,6 +47,14 @@
 #include <system.h>
 #include <printversion.h>

+#if !defined(FNM_EXTMATCH)
+# define FNM_EXTMATCH 0
+#endif
+
+#if !defined(ACCESSPERMS)
+#define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO)
+#endif
+
 typedef uint8_t GElf_Byte;

 /* Name and version of program.  */


code:
--- src/unstrip.c.orig	2017-04-27 14:26:26.000000000 +0000
+++ src/unstrip.c	2017-05-05 15:51:33.515154220 +0000
@@ -56,6 +56,15 @@
 # define _(str) gettext (str)
 #endif

+#ifndef strndupa
+#define strndupa(s, n) \
+       (__extension__ ({const char *__in = (s);                    \
+                        size_t __len = strnlen (__in, (n)) + 1;    \
+                        char *__out = (char *) alloca (__len);     \
+                        __out[__len-1] = '\0';                     \
+                        (char *) memcpy (__out, __in, __len-1);}))
+#endif
+
 /* Name and version of program.  */
 ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;


code:
--- espeakup-0.80/Makefile.orig	2016-07-25 12:25:09.000000000 -0300
+++ espeakup-0.80/Makefile	2018-01-09 18:00:06.177544572 -0300
@@ -4,9 +4,9 @@

 DEPFLAGS = -MMD
 WARNFLAGS = -Wall
-CFLAGS += ${DEPFLAGS} ${WARNFLAGS}
+CFLAGS += ${DEPFLAGS} ${WARNFLAGS} ${EXTRA_CFLAGS}

-LDLIBS = -lespeak -lpthread
+LDLIBS = -lespeak -lpthread ${EXTRA_LDFLAGS}

 INSTALL = install
 BINMODE = 0755


code:
Submitted By:            Pierre Labastie <pierre dot labastie at neuf dot fr>
Date:                    2020-05-19
Initial Package Version: 3.2.1
Upstream Status:         Committed
Origin:                  Upstream https://sourceforge.net/p/freeglut/code/1863/
Description:             Fixes "multiple defition" issues

--- a/src/fg_gl2.c
+++ b/src/fg_gl2.c
@@ -26,6 +26,20 @@
 #include <GL/freeglut.h>
 #include "fg_internal.h"
 #include "fg_gl2.h"
+
+#ifndef GL_ES_VERSION_2_0
+/* GLES2 has the corresponding entry points built-in, and these fgh-prefixed
+ * names are defined in fg_gl2.h header to reference them, for any other case,
+ * define them as function pointers here.
+ */
+FGH_PFNGLGENBUFFERSPROC fghGenBuffers;
+FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers;
+FGH_PFNGLBINDBUFFERPROC fghBindBuffer;
+FGH_PFNGLBUFFERDATAPROC fghBufferData;
+FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray;
+FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray;
+FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer;
+#endif

 void FGAPIENTRY glutSetVertexAttribCoord3(GLint attrib) {
   if (fgStructure.CurrentWindow != NULL)
--- a/src/fg_gl2.h
+++ b/src/fg_gl2.h
@@ -67,13 +67,13 @@
 typedef void (APIENTRY *FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint);
 typedef void (APIENTRY *FGH_PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);

-FGH_PFNGLGENBUFFERSPROC fghGenBuffers;
-FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers;
-FGH_PFNGLBINDBUFFERPROC fghBindBuffer;
-FGH_PFNGLBUFFERDATAPROC fghBufferData;
-FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray;
-FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray;
-FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer;
+extern FGH_PFNGLGENBUFFERSPROC fghGenBuffers;
+extern FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers;
+extern FGH_PFNGLBINDBUFFERPROC fghBindBuffer;
+extern FGH_PFNGLBUFFERDATAPROC fghBufferData;
+extern FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray;
+extern FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray;
+extern FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer;

 #    endif


code:
From 4eb1b3849325b77c4cb66b675119299de35125bb Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:46:22 +0000
Subject: [PATCH] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC,
 ObjC++, if the optimization level is > 0

---
 gcc/c-family/c-cppbuiltin.c | 4 ++++
 gcc/doc/invoke.texi         | 6 ++++++
 2 files changed, 10 insertions(+)

diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c
index 11e015bdb87..de8b7bf246f 100644
--- a/gcc/c-family/c-cppbuiltin.c
+++ b/gcc/c-family/c-cppbuiltin.c
@@ -1427,6 +1427,10 @@ c_cpp_builtins (cpp_reader *pfile)
   builtin_define_with_value ("__REGISTER_PREFIX__", REGISTER_PREFIX, 0);
   builtin_define_with_value ("__USER_LABEL_PREFIX__", user_label_prefix, 0);

+  /* Fortify Source enabled by default for optimization levels > 0 */
+  if (optimize)
+    builtin_define_with_int_value ("_FORTIFY_SOURCE", 2);
+
   /* Misc.  */
   if (flag_gnu89_inline)
     cpp_define (pfile, "__GNUC_GNU_INLINE__");
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 485d2d6b742..164929f7583 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -10225,6 +10225,12 @@ also turns on the following optimization flags:
 Please note the warning under @option{-fgcse} about
 invoking @option{-O2} on programs that use computed gotos.

+NOTE: In Alpine Linux, @option{-D_FORTIFY_SOURCE=2} is
+set by default, and is activated when @option{-O} is set to 2 or higher.
+This enables additional compile-time and run-time checks for several libc
+functions.  To disable, specify either @option{-U_FORTIFY_SOURCE} or
+@option{-D_FORTIFY_SOURCE=0}.
+
 @item -O3
 @opindex O3
 Optimize yet more.  @option{-O3} turns on all optimizations specified
--
2.35.1


code:
From 8de5d46c530ceca9f4add46d5cae3cd52c38eba3 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:46:56 +0000
Subject: [PATCH] On linux targets pass --as-needed by default to the linker,
 but always link the sanitizer libraries with --no-as-needed.

---
 gcc/config/aarch64/aarch64-linux.h |  1 +
 gcc/config/alpha/linux-elf.h       |  2 +-
 gcc/config/arm/linux-elf.h         |  1 +
 gcc/config/gnu-user.h              |  6 +++---
 gcc/config/i386/gnu-user.h         |  2 +-
 gcc/config/i386/gnu-user64.h       |  1 +
 gcc/config/ia64/linux.h            |  2 +-
 gcc/config/mips/gnu-user.h         |  1 +
 gcc/config/riscv/linux.h           |  1 +
 gcc/config/rs6000/linux64.h        |  4 ++--
 gcc/config/rs6000/sysv4.h          |  2 +-
 gcc/config/s390/linux.h            |  2 +-
 gcc/config/sparc/linux.h           |  2 +-
 gcc/gcc.c                          | 28 ++++++++++++++++++++--------
 14 files changed, 36 insertions(+), 19 deletions(-)

diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h
index 7f2529a2a1d..b097e1688aa 100644
--- a/gcc/config/aarch64/aarch64-linux.h
+++ b/gcc/config/aarch64/aarch64-linux.h
@@ -35,6 +35,7 @@
 #define CPP_SPEC "%{pthread:-D_REENTRANT}"

 #define LINUX_TARGET_LINK_SPEC  "%{h*}		\
+   --as-needed					\
    %{static:-Bstatic}				\
    %{shared:-shared}				\
    %{symbolic:-Bsymbolic}			\
diff --git a/gcc/config/alpha/linux-elf.h b/gcc/config/alpha/linux-elf.h
index c1dae8ca2cf..a87dc740171 100644
--- a/gcc/config/alpha/linux-elf.h
+++ b/gcc/config/alpha/linux-elf.h
@@ -37,7 +37,7 @@ along with GCC; see the file COPYING3.  If not see

 #define ELF_DYNAMIC_LINKER	GNU_USER_DYNAMIC_LINKER

-#define LINK_SPEC "-m elf64alpha %{G*} %{relax:-relax}		\
+#define LINK_SPEC "-m elf64alpha --as-needed %{G*} %{relax:-relax}		\
   %{O*:-O3} %{!O*:-O1}						\
   %{shared:-shared}						\
   %{!shared:							\
diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h
index 0c1c4e70b6b..8b581afacdd 100644
--- a/gcc/config/arm/linux-elf.h
+++ b/gcc/config/arm/linux-elf.h
@@ -70,6 +70,7 @@
      %{rdynamic:-export-dynamic} \
      %{!shared:-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}} \
    -X \
+   --as-needed \
    %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
    SUBTARGET_EXTRA_LINK_SPEC

diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h
index 5ebbf42a13d..902378e1bad 100644
--- a/gcc/config/gnu-user.h
+++ b/gcc/config/gnu-user.h
@@ -136,7 +136,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #define LIBASAN_EARLY_SPEC "%{!shared:libasan_preinit%O%s} " \
   "%{static-libasan:%{!shared:" \
   LD_STATIC_OPTION " --whole-archive -lasan --no-whole-archive " \
-  LD_DYNAMIC_OPTION "}}%{!static-libasan:-lasan}"
+  LD_DYNAMIC_OPTION "}}%{!static-libasan:%{!fuse-ld=gold:--push-state} --no-as-needed -lasan %{fuse-ld=gold:--as-needed;:--pop-state}}"
 #undef LIBHWASAN_EARLY_SPEC
 #define LIBHWASAN_EARLY_SPEC "%{static-libhwasan:%{!shared:" \
   LD_STATIC_OPTION " --whole-archive -lhwasan --no-whole-archive " \
@@ -145,12 +145,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #define LIBTSAN_EARLY_SPEC "%{!shared:libtsan_preinit%O%s} " \
   "%{static-libtsan:%{!shared:" \
   LD_STATIC_OPTION " --whole-archive -ltsan --no-whole-archive " \
-  LD_DYNAMIC_OPTION "}}%{!static-libtsan:-ltsan}"
+  LD_DYNAMIC_OPTION "}}%{!static-libtsan:%{!fuse-ld=gold:--push-state} --no-as-needed -ltsan %{fuse-ld=gold:--as-needed;:--pop-state}}"
 #undef LIBLSAN_EARLY_SPEC
 #define LIBLSAN_EARLY_SPEC "%{!shared:liblsan_preinit%O%s} " \
   "%{static-liblsan:%{!shared:" \
   LD_STATIC_OPTION " --whole-archive -llsan --no-whole-archive " \
-  LD_DYNAMIC_OPTION "}}%{!static-liblsan:-llsan}"
+  LD_DYNAMIC_OPTION "}}%{!static-liblsan:%{!fuse-ld=gold:--push-state} --no-as-needed -llsan %{fuse-ld=gold:--as-needed;:--pop-state}}"
 #endif

 #undef TARGET_F951_OPTIONS
diff --git a/gcc/config/i386/gnu-user.h b/gcc/config/i386/gnu-user.h
index a23e7ab3eb7..12ac8cb93a9 100644
--- a/gcc/config/i386/gnu-user.h
+++ b/gcc/config/i386/gnu-user.h
@@ -68,7 +68,7 @@ along with GCC; see the file COPYING3.  If not see
   { "link_emulation", GNU_USER_LINK_EMULATION },\
   { "dynamic_linker", GNU_USER_DYNAMIC_LINKER }

-#define GNU_USER_TARGET_LINK_SPEC "-m %(link_emulation) %{shared:-shared} \
+#define GNU_USER_TARGET_LINK_SPEC "-m %(link_emulation) --as-needed %{shared:-shared} \
   %{!shared: \
     %{!static: \
       %{!static-pie: \
diff --git a/gcc/config/i386/gnu-user64.h b/gcc/config/i386/gnu-user64.h
index f3e25b1412a..712b0f1c30e 100644
--- a/gcc/config/i386/gnu-user64.h
+++ b/gcc/config/i386/gnu-user64.h
@@ -56,6 +56,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
                   "%{" SPEC_64 ":-m " GNU_USER_LINK_EMULATION64 "} \
                    %{" SPEC_32 ":-m " GNU_USER_LINK_EMULATION32 "} \
                    %{" SPEC_X32 ":-m " GNU_USER_LINK_EMULATIONX32 "} \
+  --as-needed \
   %{shared:-shared} \
   %{!shared: \
     %{!static: \
diff --git a/gcc/config/ia64/linux.h b/gcc/config/ia64/linux.h
index ac40c3dfd3f..6e19e25c35a 100644
--- a/gcc/config/ia64/linux.h
+++ b/gcc/config/ia64/linux.h
@@ -58,7 +58,7 @@ do {						\
 #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-ia64.so.2"

 #undef LINK_SPEC
-#define LINK_SPEC "\
+#define LINK_SPEC " --as-needed \
   %{shared:-shared} \
   %{!shared: \
     %{!static: \
diff --git a/gcc/config/mips/gnu-user.h b/gcc/config/mips/gnu-user.h
index a390bcece83..be0ee289367 100644
--- a/gcc/config/mips/gnu-user.h
+++ b/gcc/config/mips/gnu-user.h
@@ -55,6 +55,7 @@ along with GCC; see the file COPYING3.  If not see
 #undef GNU_USER_TARGET_LINK_SPEC
 #define GNU_USER_TARGET_LINK_SPEC "\
   %{G*} %{EB} %{EL} %{mips*} %{shared} \
+ -as-needed \
   %{!shared: \
     %{!static: \
       %{rdynamic:-export-dynamic} \
diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h
index fce5b896e6e..ee29979dd34 100644
--- a/gcc/config/riscv/linux.h
+++ b/gcc/config/riscv/linux.h
@@ -58,6 +58,7 @@ along with GCC; see the file COPYING3.  If not see
   "%{mabi=ilp32:_ilp32}"

 #define LINK_SPEC "\
+-as-needed \
 -melf" XLEN_SPEC DEFAULT_ENDIAN_SPEC "riscv" LD_EMUL_SUFFIX " \
 %{mno-relax:--no-relax} \
 %{mbig-endian:-EB} \
diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
index e3f2cd254f6..43499ed29cf 100644
--- a/gcc/config/rs6000/linux64.h
+++ b/gcc/config/rs6000/linux64.h
@@ -374,13 +374,13 @@ extern int dot_symbols;
 					   " -m elf64ppc")
 #endif

-#define LINK_OS_LINUX_SPEC32 LINK_OS_LINUX_EMUL32 " %{!shared: %{!static: \
+#define LINK_OS_LINUX_SPEC32 LINK_OS_LINUX_EMUL32 " --as-needed %{!shared: %{!static: \
   %{!static-pie: \
     %{rdynamic:-export-dynamic} \
     -dynamic-linker " GNU_USER_DYNAMIC_LINKER32 "}}} \
   %(link_os_extra_spec32)"

-#define LINK_OS_LINUX_SPEC64 LINK_OS_LINUX_EMUL64 " %{!shared: %{!static: \
+#define LINK_OS_LINUX_SPEC64 LINK_OS_LINUX_EMUL64 " --as-needed %{!shared: %{!static: \
   %{!static-pie: \
     %{rdynamic:-export-dynamic} \
     -dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "}}} \
diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
index 510abe169c5..3c1f3a8ec5d 100644
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -789,7 +789,7 @@ GNU_USER_TARGET_CC1_SPEC
 #define GNU_USER_DYNAMIC_LINKER GLIBC_DYNAMIC_LINKER
 #endif

-#define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
+#define LINK_OS_LINUX_SPEC "-m elf32ppclinux --as-needed %{!shared: %{!static: \
   %{rdynamic:-export-dynamic} \
   -dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}"

diff --git a/gcc/config/s390/linux.h b/gcc/config/s390/linux.h
index daa48fdfc2b..2fcfc5d770f 100644
--- a/gcc/config/s390/linux.h
+++ b/gcc/config/s390/linux.h
@@ -82,7 +82,7 @@ along with GCC; see the file COPYING3.  If not see

 #undef  LINK_SPEC
 #define LINK_SPEC \
-  "%{m31:-m elf_s390}%{m64:-m elf64_s390} \
+  "%{m31:-m elf_s390}%{m64:-m elf64_s390} --as-needed \
    %{shared:-shared} \
    %{!shared: \
       %{static:-static} \
diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h
index 2550d7ee8f0..7596d0b2757 100644
--- a/gcc/config/sparc/linux.h
+++ b/gcc/config/sparc/linux.h
@@ -81,7 +81,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
 #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"

 #undef  LINK_SPEC
-#define LINK_SPEC "-m elf32_sparc %{shared:-shared} \
+#define LINK_SPEC "-m elf32_sparc --as-needed %{shared:-shared} \
   %{!mno-relax:%{!r:-relax}} \
   %{!shared: \
     %{!static: \
diff --git a/gcc/gcc.c b/gcc/gcc.c
index faf9ce76b3d..1ad5da6d769 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -737,8 +737,11 @@ proper position among the other output files.  */
 #ifdef LIBASAN_EARLY_SPEC
 #define LIBASAN_SPEC STATIC_LIBASAN_LIBS
 #elif defined(HAVE_LD_STATIC_DYNAMIC)
-#define LIBASAN_SPEC "%{static-libasan:" LD_STATIC_OPTION \
-		     "} -lasan %{static-libasan:" LD_DYNAMIC_OPTION "}" \
+#define LIBASAN_SPEC "%{static-libasan:" LD_STATIC_OPTION "}" \
+		     " %{!static-libasan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
+		     " -lasan " \
+		     " %{static-libasan:" LD_DYNAMIC_OPTION "}" \
+		     " %{!static-libasan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
 		     STATIC_LIBASAN_LIBS
 #else
 #define LIBASAN_SPEC "-lasan" STATIC_LIBASAN_LIBS
@@ -773,8 +776,11 @@ proper position among the other output files.  */
 #ifdef LIBTSAN_EARLY_SPEC
 #define LIBTSAN_SPEC STATIC_LIBTSAN_LIBS
 #elif defined(HAVE_LD_STATIC_DYNAMIC)
-#define LIBTSAN_SPEC "%{static-libtsan:" LD_STATIC_OPTION \
-		     "} -ltsan %{static-libtsan:" LD_DYNAMIC_OPTION "}" \
+#define LIBTSAN_SPEC "%{static-libtsan:" LD_STATIC_OPTION "}" \
+		     " %{!static-libtsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
+		     " -ltsan " \
+		     " %{static-libtsan:" LD_DYNAMIC_OPTION "}" \
+		     " %{!static-libtsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
 		     STATIC_LIBTSAN_LIBS
 #else
 #define LIBTSAN_SPEC "-ltsan" STATIC_LIBTSAN_LIBS
@@ -791,8 +797,11 @@ proper position among the other output files.  */
 #ifdef LIBLSAN_EARLY_SPEC
 #define LIBLSAN_SPEC STATIC_LIBLSAN_LIBS
 #elif defined(HAVE_LD_STATIC_DYNAMIC)
-#define LIBLSAN_SPEC "%{static-liblsan:" LD_STATIC_OPTION \
-		     "} -llsan %{static-liblsan:" LD_DYNAMIC_OPTION "}" \
+#define LIBLSAN_SPEC "%{static-liblsan:" LD_STATIC_OPTION "}" \
+		     " %{!static-liblsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
+		     " -llsan " \
+		     " %{static-liblsan:" LD_DYNAMIC_OPTION "}" \
+		     " %{!static-liblsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
 		     STATIC_LIBLSAN_LIBS
 #else
 #define LIBLSAN_SPEC "-llsan" STATIC_LIBLSAN_LIBS
@@ -807,8 +816,11 @@ proper position among the other output files.  */
 #define STATIC_LIBUBSAN_LIBS \
   " %{static-libubsan|static:%:include(libsanitizer.spec)%(link_libubsan)}"
 #ifdef HAVE_LD_STATIC_DYNAMIC
-#define LIBUBSAN_SPEC "%{static-libubsan:" LD_STATIC_OPTION \
-		     "} -lubsan %{static-libubsan:" LD_DYNAMIC_OPTION "}" \
+#define LIBUBSAN_SPEC "%{static-libubsan:" LD_STATIC_OPTION "}" \
+		     " %{!static-libubsan:%{!fuse-ld=gold:--push-state }--no-as-needed}" \
+		     " -lubsan " \
+		     " %{static-libubsan:" LD_DYNAMIC_OPTION "}" \
+		     " %{!static-libubsan:%{fuse-ld=gold:--as-needed;:--pop-state}}" \
 		     STATIC_LIBUBSAN_LIBS
 #else
 #define LIBUBSAN_SPEC "-lubsan" STATIC_LIBUBSAN_LIBS
--
2.35.1


code:
From 85e12e3d32a44c3fd10b5327edd542972a179eec Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:47:43 +0000
Subject: [PATCH] Enable -Wformat and -Wformat-security by default.

---
 gcc/c-family/c.opt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
index 2005b783c68..c5c6af427cc 100644
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -637,7 +637,7 @@ Warn about function calls with format strings that write past the end
 of the destination region.  Same as -Wformat-overflow=1.

 Wformat-security
-C ObjC C++ ObjC++ Var(warn_format_security) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0)
+C ObjC C++ ObjC++ Var(warn_format_security) Init(1) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0)
 Warn about possible security problems with format functions.

 Wformat-signedness
@@ -658,7 +658,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++
 Warn about zero-length formats.

 Wformat=
-C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0) IntegerRange(0, 2)
+C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Init(1) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0) IntegerRange(0, 2)
 Warn about printf/scanf/strftime/strfmon format string anomalies.

 Wformat-overflow=
--
2.35.1


code:
From f1e92f5f3576779776c9f3d6aeef76e1569e719a Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:48:24 +0000
Subject: [PATCH] Enable -Wtrampolines by default.

---
 gcc/common.opt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/common.opt b/gcc/common.opt
index d15105a73f3..29f9504cb68 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -775,7 +775,7 @@ Common Var(warn_system_headers) Warning
 Do not suppress warnings from system headers.

 Wtrampolines
-Common Var(warn_trampolines) Warning
+Common Var(warn_trampolines) Init(1) Warning
 Warn whenever a trampoline is generated.

 Wtype-limits
--
2.35.1


code:
From 3503fd734a33b67ec6a9fdc2c52bb8310864b119 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:49:40 +0000
Subject: [PATCH] Disable ssp on -nostdlib, -nodefaultlibs and -ffreestanding
 Change the buffer size.

---
 gcc/gcc.c      | 8 +++++++-
 gcc/params.opt | 2 +-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/gcc/gcc.c b/gcc/gcc.c
index 1ad5da6d769..99314032ec2 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -989,6 +989,12 @@ proper position among the other output files.  */
 #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
 #endif

+#ifdef ENABLE_DEFAULT_SSP
+#define NO_SSP_SPEC "%{nostdlib|nodefaultlibs|ffreestanding:-fno-stack-protector} "
+#else
+#define NO_SSP_SPEC ""
+#endif
+
 #ifndef LINK_SSP_SPEC
 #ifdef TARGET_LIBC_PROVIDES_SSP
 #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
@@ -1288,7 +1294,7 @@ static const char *cc1_options =
  %{-version:--version}\
  %{-help=*:--help=%*}\
  %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}}\
- %{fsyntax-only:-o %j} %{-param*}\
+ %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
  %{coverage:-fprofile-arcs -ftest-coverage}\
  %{fprofile-arcs|fprofile-generate*|coverage:\
    %{!fprofile-update=single:\
diff --git a/gcc/params.opt b/gcc/params.opt
index 8ba281b4cfa..bab39cdf8a2 100644
--- a/gcc/params.opt
+++ b/gcc/params.opt
@@ -946,7 +946,7 @@ Common Joined UInteger Var(param_ssa_name_def_chain_limit) Init(512) Param Optim
 The maximum number of SSA_NAME assignments to follow in determining a value.

 -param=ssp-buffer-size=
-Common Joined UInteger Var(param_ssp_buffer_size) Init(8) IntegerRange(1, 65536) Param Optimization
+Common Joined UInteger Var(param_ssp_buffer_size) Init(4) IntegerRange(1, 65536) Param Optimization
 The lower bound for a buffer to be considered for stack smashing protection.

 -param=stack-clash-protection-guard-size=
--
2.35.1


code:
From 18d44a7f8d801cc6926a73e2dda2f0ce859dc561 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 07:01:06 +0000
Subject: [PATCH] add fortify-headers paths

---
 gcc/config/linux.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/config/linux.h b/gcc/config/linux.h
index 4e1db60fced..7fcf402b416 100644
--- a/gcc/config/linux.h
+++ b/gcc/config/linux.h
@@ -167,6 +167,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see

 #ifdef NATIVE_SYSTEM_HEADER_DIR
 #define INCLUDE_DEFAULTS_MUSL_NATIVE			\
+    { NATIVE_SYSTEM_HEADER_DIR "/fortify", 0, 0, 0, 1, 2 },	\
+    { NATIVE_SYSTEM_HEADER_DIR "/fortify", 0, 0, 0, 1, 0 },	\
     { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 },	\
     { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 },
 #else
--
2.35.1


code:
From ba7401783edf0dd9e5503c934b58e1b4fb4595f1 Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Fri, 26 Jan 2018 20:32:50 +0000
Subject: [PATCH 2/5] posix_memalign

---
 gcc/config/i386/pmm_malloc.h | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/gcc/config/i386/pmm_malloc.h b/gcc/config/i386/pmm_malloc.h
index 1b0bfe37852..d7b2b19bb3c 100644
--- a/gcc/config/i386/pmm_malloc.h
+++ b/gcc/config/i386/pmm_malloc.h
@@ -27,12 +27,13 @@
 #include <stdlib.h>

 /* We can't depend on <stdlib.h> since the prototype of posix_memalign
-   may not be visible.  */
+   may not be visible and we can't pollute the namespace either.  */
 #ifndef __cplusplus
-extern int posix_memalign (void **, size_t, size_t);
+extern int _mm_posix_memalign (void **, size_t, size_t)
 #else
-extern "C" int posix_memalign (void **, size_t, size_t) throw ();
+extern "C" int _mm_posix_memalign (void **, size_t, size_t) throw ()
 #endif
+__asm__("posix_memalign");

 static __inline void *
 _mm_malloc (size_t __size, size_t __alignment)
@@ -42,7 +43,7 @@ _mm_malloc (size_t __size, size_t __alignment)
     return malloc (__size);
   if (__alignment == 2 || (sizeof (void *) == 8 && __alignment == 4))
     __alignment = sizeof (void *);
-  if (posix_memalign (&__ptr, __alignment, __size) == 0)
+  if (_mm_posix_memalign (&__ptr, __alignment, __size) == 0)
     return __ptr;
   else
     return NULL;
--
2.31.1


code:
From 8155bf9547c6a40a053799f4e4158bc5621ce7a0 Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Fri, 26 Jan 2018 20:29:56 +0000
Subject: [PATCH 3/5] j2

---
 gcc/config.gcc        | 26 ++++++++++++---------
 gcc/config/sh/sh.c    |  7 ++++++
 gcc/config/sh/sh.h    | 15 +++++++++---
 gcc/config/sh/sh.opt  |  4 ++++
 gcc/config/sh/sync.md | 54 +++++++++++++++++++++++++++++++++++++++++++
 gcc/config/sh/t-sh    | 10 ++++----
 6 files changed, 98 insertions(+), 18 deletions(-)

diff --git a/gcc/config.gcc b/gcc/config.gcc
index 357b0bed067..528add999f2 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -556,7 +556,7 @@ s390*-*-*)
 	extra_headers="s390intrin.h htmintrin.h htmxlintrin.h vecintrin.h"
 	;;
 # Note the 'l'; we need to be able to match e.g. "shle" or "shl".
-sh[123456789lbe]*-*-* | sh-*-*)
+sh[123456789lbej]*-*-* | sh-*-*)
 	cpu_type=sh
 	extra_options="${extra_options} fused-madd.opt"
 	extra_objs="${extra_objs} sh_treg_combine.o sh-mem.o sh_optimize_sett_clrt.o"
@@ -3202,18 +3202,18 @@ s390x-ibm-tpf*)
 	extra_options="${extra_options} s390/tpf.opt"
 	tmake_file="${tmake_file} s390/t-s390"
 	;;
-sh-*-elf* | sh[12346l]*-*-elf* | \
-  sh-*-linux* | sh[2346lbe]*-*-linux* | \
+sh-*-elf* | sh[12346lj]*-*-elf* | \
+  sh-*-linux* | sh[2346lbej]*-*-linux* | \
   sh-*-netbsdelf* | shl*-*-netbsdelf*)
 	tmake_file="${tmake_file} sh/t-sh sh/t-elf"
 	if test x${with_endian} = x; then
 		case ${target} in
-		sh[1234]*be-*-* | sh[1234]*eb-*-*) with_endian=big ;;
+		sh[j1234]*be-*-* | sh[j1234]*eb-*-*) with_endian=big ;;
 		shbe-*-* | sheb-*-*)		   with_endian=big,little ;;
 		sh[1234]l* | sh[34]*-*-linux*)	   with_endian=little ;;
 		shl* | sh*-*-linux* | \
 		  sh-superh-elf)		   with_endian=little,big ;;
-		sh[1234]*-*-*)			   with_endian=big ;;
+		sh[j1234]*-*-*)			   with_endian=big ;;
 		*)				   with_endian=big,little ;;
 		esac
 	fi
@@ -3280,6 +3280,7 @@ sh-*-elf* | sh[12346l]*-*-elf* | \
 	sh2a_nofpu*)		sh_cpu_target=sh2a-nofpu ;;
 	sh2a*)			sh_cpu_target=sh2a ;;
 	sh2e*)			sh_cpu_target=sh2e ;;
+	shj2*)			sh_cpu_target=shj2;;
 	sh2*)			sh_cpu_target=sh2 ;;
 	*)			sh_cpu_target=sh1 ;;
 	esac
@@ -3301,7 +3302,7 @@ sh-*-elf* | sh[12346l]*-*-elf* | \
 	  sh2a-single-only | sh2a-single | sh2a-nofpu | sh2a | \
 	  sh4a-single-only | sh4a-single | sh4a-nofpu | sh4a | sh4al | \
 	  sh4-single-only | sh4-single | sh4-nofpu | sh4 | sh4-300 | \
-	  sh3e | sh3 | sh2e | sh2 | sh1) ;;
+	  sh3e | sh3 | sh2e | sh2 | sh1 | shj2) ;;
 	"")	sh_cpu_default=${sh_cpu_target} ;;
 	*)	echo "with_cpu=$with_cpu not supported"; exit 1 ;;
 	esac
@@ -3310,9 +3311,9 @@ sh-*-elf* | sh[12346l]*-*-elf* | \
 		case ${target} in
 		sh[1234]*)	sh_multilibs=${sh_cpu_target} ;;
 		sh-superh-*)	sh_multilibs=m4,m4-single,m4-single-only,m4-nofpu ;;
-		sh*-*-linux*)	sh_multilibs=m1,m2,m2a,m3e,m4 ;;
+		sh*-*-linux*)	sh_multilibs=m1,m2,m2a,m3e,m4,mj2 ;;
 		sh*-*-netbsd*)	sh_multilibs=m3,m3e,m4 ;;
-		*) sh_multilibs=m1,m2,m2e,m4,m4-single,m4-single-only,m2a,m2a-single ;;
+		*) sh_multilibs=m1,m2,m2e,m4,m4-single,m4-single-only,m2a,m2a-single,mj2 ;;
 		esac
 		if test x$with_fp = xno; then
 			sh_multilibs="`echo $sh_multilibs|sed -e s/m4/sh4-nofpu/ -e s/,m4-[^,]*//g -e s/,m[23]e// -e s/m2a,m2a-single/m2a-nofpu/ -e s/m5-..m....,//g`"
@@ -3327,7 +3328,8 @@ sh-*-elf* | sh[12346l]*-*-elf* | \
 		m1 | m2 | m2e | m3 | m3e | \
 		m4 | m4-single | m4-single-only | m4-nofpu | m4-300 |\
 		m4a | m4a-single | m4a-single-only | m4a-nofpu | m4al | \
-		m2a | m2a-single | m2a-single-only | m2a-nofpu)
+		m2a | m2a-single | m2a-single-only | m2a-nofpu | \
+		mj2)
 			# TM_MULTILIB_CONFIG is used by t-sh for the non-endian multilib definition
 			# It is passed to MULTIILIB_OPTIONS verbatim.
 			TM_MULTILIB_CONFIG="${TM_MULTILIB_CONFIG}/${sh_multilib}"
@@ -3344,7 +3346,7 @@ sh-*-elf* | sh[12346l]*-*-elf* | \
 	done
 	TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's:^/::'`
 	if test x${enable_incomplete_targets} = xyes ; then
-		tm_defines="$tm_defines SUPPORT_SH1=1 SUPPORT_SH2E=1 SUPPORT_SH4=1 SUPPORT_SH4_SINGLE=1 SUPPORT_SH2A=1 SUPPORT_SH2A_SINGLE=1"
+		tm_defines="$tm_defines SUPPORT_SH1=1 SUPPORT_SH2E=1 SUPPORT_SH4=1 SUPPORT_SH4_SINGLE=1 SUPPORT_SH2A=1 SUPPORT_SH2A_SINGLE=1 SUPPORT_SHJ2=1"
 	fi
 	tm_file="$tm_file ./sysroot-suffix.h"
 	tmake_file="$tmake_file t-sysroot-suffix"
@@ -5175,6 +5177,8 @@ case "${target}" in
 			;;
 		m4a | m4a-single | m4a-single-only | m4a-nofpu | m4al)
 		        ;;
+		mj2)
+			;;
 		*)
 			echo "Unknown CPU used in --with-cpu=$with_cpu, known values:"  1>&2
 			echo "m1 m2 m2e m3 m3e m4 m4-single m4-single-only m4-nofpu" 1>&2
@@ -5385,7 +5389,7 @@ case ${target} in
 		tmake_file="${cpu_type}/t-${cpu_type} ${tmake_file}"
 		;;

-	sh[123456ble]*-*-* | sh-*-*)
+	sh[123456blej]*-*-* | sh-*-*)
 		c_target_objs="${c_target_objs} sh-c.o"
 		cxx_target_objs="${cxx_target_objs} sh-c.o"
 		;;
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 1564109c942..798c1c1c1a3 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -686,6 +686,7 @@ parse_validate_atomic_model_option (const char* str)
   model_names[sh_atomic_model::hard_llcs] = "hard-llcs";
   model_names[sh_atomic_model::soft_tcb] = "soft-tcb";
   model_names[sh_atomic_model::soft_imask] = "soft-imask";
+  model_names[sh_atomic_model::hard_cas] = "hard-cas";

   const char* model_cdef_names[sh_atomic_model::num_models];
   model_cdef_names[sh_atomic_model::none] = "NONE";
@@ -693,6 +694,7 @@ parse_validate_atomic_model_option (const char* str)
   model_cdef_names[sh_atomic_model::hard_llcs] = "HARD_LLCS";
   model_cdef_names[sh_atomic_model::soft_tcb] = "SOFT_TCB";
   model_cdef_names[sh_atomic_model::soft_imask] = "SOFT_IMASK";
+  model_cdef_names[sh_atomic_model::hard_cas] = "HARD_CAS";

   sh_atomic_model ret;
   ret.type = sh_atomic_model::none;
@@ -771,6 +773,9 @@ got_mode_name:;
   if (ret.type == sh_atomic_model::soft_imask && TARGET_USERMODE)
     err_ret ("cannot use atomic model %s in user mode", ret.name);

+  if (ret.type == sh_atomic_model::hard_cas && !TARGET_SHJ2)
+    err_ret ("atomic model %s is only available J2 targets", ret.name);
+
   return ret;

 #undef err_ret
@@ -827,6 +832,8 @@ sh_option_override (void)
     sh_cpu = PROCESSOR_SH2E;
   if (TARGET_SH2A)
     sh_cpu = PROCESSOR_SH2A;
+  if (TARGET_SHJ2)
+    sh_cpu = PROCESSOR_SHJ2;
   if (TARGET_SH3)
     sh_cpu = PROCESSOR_SH3;
   if (TARGET_SH3E)
diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h
index d2280e2ffe6..3a54a896721 100644
--- a/gcc/config/sh/sh.h
+++ b/gcc/config/sh/sh.h
@@ -85,6 +85,7 @@ extern int code_for_indirect_jump_scratch;
 #define SUPPORT_SH4_SINGLE 1
 #define SUPPORT_SH2A 1
 #define SUPPORT_SH2A_SINGLE 1
+#define SUPPORT_SHJ2 1
 #endif

 #define TARGET_DIVIDE_CALL_DIV1 (sh_div_strategy == SH_DIV_CALL_DIV1)
@@ -117,6 +118,7 @@ extern int code_for_indirect_jump_scratch;
 #define SELECT_SH4A_SINGLE_ONLY  (MASK_SH4A | SELECT_SH4_SINGLE_ONLY)
 #define SELECT_SH4A		 (MASK_SH4A | SELECT_SH4)
 #define SELECT_SH4A_SINGLE	 (MASK_SH4A | SELECT_SH4_SINGLE)
+#define SELECT_SHJ2		 (MASK_SHJ2 | SELECT_SH2)

 #if SUPPORT_SH1
 #define SUPPORT_SH2 1
@@ -124,6 +126,7 @@ extern int code_for_indirect_jump_scratch;
 #if SUPPORT_SH2
 #define SUPPORT_SH3 1
 #define SUPPORT_SH2A_NOFPU 1
+#define SUPPORT_SHJ2 1
 #endif
 #if SUPPORT_SH3
 #define SUPPORT_SH4_NOFPU 1
@@ -156,7 +159,7 @@ extern int code_for_indirect_jump_scratch;
 #define MASK_ARCH (MASK_SH1 | MASK_SH2 | MASK_SH3 | MASK_SH_E | MASK_SH4 \
 		   | MASK_HARD_SH2A | MASK_HARD_SH2A_DOUBLE | MASK_SH4A \
 		   | MASK_HARD_SH4 | MASK_FPU_SINGLE \
-		   | MASK_FPU_SINGLE_ONLY)
+		   | MASK_FPU_SINGLE_ONLY | MASK_SHJ2)

 /* This defaults us to big-endian.  */
 #ifndef TARGET_ENDIAN_DEFAULT
@@ -231,7 +234,8 @@ extern int code_for_indirect_jump_scratch;
 %{m2a-single:--isa=sh2a} \
 %{m2a-single-only:--isa=sh2a} \
 %{m2a-nofpu:--isa=sh2a-nofpu} \
-%{m4al:-dsp}"
+%{m4al:-dsp} \
+%{mj2:-isa=j2}"

 #define ASM_SPEC SH_ASM_SPEC

@@ -347,6 +351,7 @@ struct sh_atomic_model
     hard_llcs,
     soft_tcb,
     soft_imask,
+    hard_cas,

     num_models
   };
@@ -390,6 +395,9 @@ extern const sh_atomic_model& selected_atomic_model (void);
 #define TARGET_ATOMIC_SOFT_IMASK \
   (selected_atomic_model ().type == sh_atomic_model::soft_imask)

+#define TARGET_ATOMIC_HARD_CAS \
+  (selected_atomic_model ().type == sh_atomic_model::hard_cas)
+
 #endif // __cplusplus

 #define SUBTARGET_OVERRIDE_OPTIONS (void) 0
@@ -1484,7 +1492,7 @@ extern bool current_function_interrupt;

 /* Nonzero if the target supports dynamic shift instructions
    like shad and shld.  */
-#define TARGET_DYNSHIFT (TARGET_SH3 || TARGET_SH2A)
+#define TARGET_DYNSHIFT (TARGET_SH3 || TARGET_SH2A || TARGET_SHJ2)

 /* The cost of using the dynamic shift insns (shad, shld) are the same
    if they are available.  If they are not available a library function will
@@ -1747,6 +1755,7 @@ enum processor_type {
   PROCESSOR_SH2,
   PROCESSOR_SH2E,
   PROCESSOR_SH2A,
+  PROCESSOR_SHJ2,
   PROCESSOR_SH3,
   PROCESSOR_SH3E,
   PROCESSOR_SH4,
diff --git a/gcc/config/sh/sh.opt b/gcc/config/sh/sh.opt
index b4755a812f3..0989a1c18da 100644
--- a/gcc/config/sh/sh.opt
+++ b/gcc/config/sh/sh.opt
@@ -65,6 +65,10 @@ m2e
 Target RejectNegative Condition(SUPPORT_SH2E)
 Generate SH2e code.

+mj2
+Target RejectNegative Mask(SHJ2) Condition(SUPPORT_SHJ2)
+Generate J2 code.
+
 m3
 Target RejectNegative Mask(SH3) Condition(SUPPORT_SH3)
 Generate SH3 code.
diff --git a/gcc/config/sh/sync.md b/gcc/config/sh/sync.md
index 2b43f8edb86..118fc5d06db 100644
--- a/gcc/config/sh/sync.md
+++ b/gcc/config/sh/sync.md
@@ -240,6 +240,9 @@
       || (TARGET_SH4A && <MODE>mode == SImode && !TARGET_ATOMIC_STRICT))
     atomic_insn = gen_atomic_compare_and_swap<mode>_hard (old_val, mem,
 							  exp_val, new_val);
+  else if (TARGET_ATOMIC_HARD_CAS && <MODE>mode == SImode)
+    atomic_insn = gen_atomic_compare_and_swap<mode>_cas (old_val, mem,
+							 exp_val, new_val);
   else if (TARGET_ATOMIC_SOFT_GUSA)
     atomic_insn = gen_atomic_compare_and_swap<mode>_soft_gusa (old_val, mem,
 		      exp_val, new_val);
@@ -306,6 +309,57 @@
 }
   [(set_attr "length" "14")])

+(define_expand "atomic_compare_and_swapsi_cas"
+  [(set (match_operand:SI 0 "register_operand" "=r")
+	(unspec_volatile:SI
+	  [(match_operand:SI 1 "atomic_mem_operand_0" "=Sra")
+	   (match_operand:SI 2 "register_operand" "r")
+	   (match_operand:SI 3 "register_operand" "r")]
+	  UNSPECV_CMPXCHG_1))]
+  "TARGET_ATOMIC_HARD_CAS"
+{
+  rtx mem = gen_rtx_REG (SImode, 0);
+  emit_move_insn (mem, force_reg (SImode, XEXP (operands[1], 0)));
+  emit_insn (gen_shj2_cas (operands[0], mem, operands[2], operands[3]));
+  DONE;
+})
+
+(define_insn "shj2_cas"
+  [(set (match_operand:SI 0 "register_operand" "=&r")
+  (unspec_volatile:SI
+   [(match_operand:SI 1 "register_operand" "=r")
+   (match_operand:SI 2 "register_operand" "r")
+   (match_operand:SI 3 "register_operand" "0")]
+   UNSPECV_CMPXCHG_1))
+   (set (reg:SI T_REG)
+	(unspec_volatile:SI [(const_int 0)] UNSPECV_CMPXCHG_3))]
+  "TARGET_ATOMIC_HARD_CAS"
+  "cas.l	%2,%0,@%1"
+  [(set_attr "length" "2")]
+)
+
+(define_expand "atomic_compare_and_swapqi_cas"
+  [(set (match_operand:SI 0 "arith_reg_dest" "=&r")
+	(unspec_volatile:SI
+	  [(match_operand:SI 1 "atomic_mem_operand_0" "=Sra")
+	   (match_operand:SI 2 "arith_operand" "rI08")
+	   (match_operand:SI 3 "arith_operand" "rI08")]
+	  UNSPECV_CMPXCHG_1))]
+  "TARGET_ATOMIC_HARD_CAS"
+{FAIL;}
+)
+
+(define_expand "atomic_compare_and_swaphi_cas"
+  [(set (match_operand:SI 0 "arith_reg_dest" "=&r")
+	(unspec_volatile:SI
+	  [(match_operand:SI 1 "atomic_mem_operand_0" "=Sra")
+	   (match_operand:SI 2 "arith_operand" "rI08")
+	   (match_operand:SI 3 "arith_operand" "rI08")]
+	  UNSPECV_CMPXCHG_1))]
+  "TARGET_ATOMIC_HARD_CAS"
+{FAIL;}
+)
+
 ;; The QIHImode llcs patterns modify the address register of the memory
 ;; operand.  In order to express that, we have to open code the memory
 ;; operand.  Initially the insn is expanded like every other atomic insn
diff --git a/gcc/config/sh/t-sh b/gcc/config/sh/t-sh
index 888f8ff7f25..29fd6ae45fd 100644
--- a/gcc/config/sh/t-sh
+++ b/gcc/config/sh/t-sh
@@ -50,7 +50,8 @@ MULTILIB_MATCHES = $(shell \
              m2e,m3e,m4-single-only,m4-100-single-only,m4-200-single-only,m4-300-single-only,m4a-single-only \
              m2a-single,m2a-single-only \
              m4-single,m4-100-single,m4-200-single,m4-300-single,m4a-single \
-             m4,m4-100,m4-200,m4-300,m4a; do \
+             m4,m4-100,m4-200,m4-300,m4a \
+             mj2; do \
     subst= ; \
     for lib in `echo $$abi|tr , ' '` ; do \
       if test "`echo $$multilibs|sed s/$$lib//`" != "$$multilibs"; then \
@@ -63,9 +64,9 @@ MULTILIB_MATCHES = $(shell \

 # SH1 and SH2A support big endian only.
 ifeq ($(DEFAULT_ENDIAN),ml)
-MULTILIB_EXCEPTIONS = m1 ml/m1 m2a* ml/m2a* $(TM_MULTILIB_EXCEPTIONS_CONFIG)
+MULTILIB_EXCEPTIONS = m1 ml/m1 m2a* ml/m2a* ml/mj2 $(TM_MULTILIB_EXCEPTIONS_CONFIG)
 else
-MULTILIB_EXCEPTIONS = ml/m1 ml/m2a* $(TM_MULTILIB_EXCEPTIONS_CONFIG)
+MULTILIB_EXCEPTIONS = ml/m1 ml/m2a* ml/mj2 $(TM_MULTILIB_EXCEPTIONS_CONFIG)
 endif

 MULTILIB_OSDIRNAMES = \
@@ -87,7 +88,8 @@ MULTILIB_OSDIRNAMES = \
 	m4a-single-only=!m4a-single-only $(OTHER_ENDIAN)/m4a-single-only=!$(OTHER_ENDIAN)/m4a-single-only \
 	m4a-single=!m4a-single $(OTHER_ENDIAN)/m4a-single=!$(OTHER_ENDIAN)/m4a-single \
 	m4a=!m4a $(OTHER_ENDIAN)/m4a=!$(OTHER_ENDIAN)/m4a \
-	m4al=!m4al $(OTHER_ENDIAN)/m4al=!$(OTHER_ENDIAN)/m4al
+	m4al=!m4al $(OTHER_ENDIAN)/m4al=!$(OTHER_ENDIAN)/m4al \
+	mj2=!j2

 $(out_object_file): gt-sh.h
 gt-sh.h : s-gtype ; @true
--
2.31.1


code:
From f2dc7594a780d945fc5b1532ab9609cf1d735457 Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Sat, 18 Aug 2018 23:58:45 +0000
Subject: [PATCH 4/5] static-pie

in gcc-8 -static means static non-pie, even if -pie or -static-pie
are specified, -static-pie can be used to build static pie.

in musl toolchains -static -pie always meant static pie, so this
patch fixes the link specs accordingly, the new -static-pie is just
an alias to -static -pie.
---
 gcc/common.opt        |  4 ++--
 gcc/config/gnu-user.h | 17 ++++++++---------
 gcc/gcc.c             |  6 +++---
 3 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/gcc/common.opt b/gcc/common.opt
index a75b44ee47e..7c564818b49 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -3473,11 +3473,11 @@ Driver

 no-pie
 Driver RejectNegative Negative(shared)
-Don't create a dynamically linked position independent executable.
+Don't create a position independent executable.

 pie
 Driver RejectNegative Negative(no-pie)
-Create a dynamically linked position independent executable.
+Create a position independent executable.

 static-pie
 Driver RejectNegative Negative(pie)
diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h
index 5ebbf42a13d..bb907d8e89a 100644
--- a/gcc/config/gnu-user.h
+++ b/gcc/config/gnu-user.h
@@ -51,13 +51,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #define GNU_USER_TARGET_STARTFILE_SPEC \
   "%{shared:; \
      pg|p|profile:%{static-pie:grcrt1.o%s;:gcrt1.o%s}; \
-     static:crt1.o%s; \
-     static-pie:rcrt1.o%s; \
+     static|static-pie:%{" PIE_SPEC ":rcrt1.o%s;:crt1.o%s}; \
      " PIE_SPEC ":Scrt1.o%s; \
      :crt1.o%s} " \
    GNU_USER_TARGET_CRTI " \
-   %{static:crtbeginT.o%s; \
-     shared|static-pie|" PIE_SPEC ":crtbeginS.o%s; \
+   %{shared|" PIE_SPEC ":crtbeginS.o%s; \
+     static:crtbeginT.o%s; \
      :crtbegin.o%s} \
    %{fvtable-verify=none:%s; \
      fvtable-verify=preinit:vtv_start_preinit.o%s; \
@@ -73,11 +72,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
    GNU userspace "finalizer" file, `crtn.o'.  */

 #define GNU_USER_TARGET_ENDFILE_SPEC \
-  "%{!static:%{fvtable-verify=none:%s; \
+  "%{static|static-pie:; \
+     fvtable-verify=none:%s; \
      fvtable-verify=preinit:vtv_end_preinit.o%s; \
-     fvtable-verify=std:vtv_end.o%s}} \
-   %{static:crtend.o%s; \
-     shared|static-pie|" PIE_SPEC ":crtendS.o%s; \
+     fvtable-verify=std:vtv_end.o%s} \
+   %{shared|" PIE_SPEC ":crtendS.o%s; \
      :crtend.o%s} " \
    GNU_USER_TARGET_CRTN " " \
    CRTOFFLOADEND
@@ -106,7 +105,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #define LIB_SPEC GNU_USER_TARGET_LIB_SPEC

 #if defined(HAVE_LD_EH_FRAME_HDR)
-#define LINK_EH_SPEC "%{!static|static-pie:--eh-frame-hdr} "
+#define LINK_EH_SPEC "%{!static|" PIE_SPEC ":--eh-frame-hdr} "
 #endif

 #define GNU_USER_TARGET_LINK_GCC_C_SEQUENCE_SPEC \
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 3c81c5798d8..cd96eac5d12 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -1010,7 +1010,7 @@ proper position among the other output files.  */
 #define NO_FPIE_AND_FPIC_SPEC	NO_FPIE_SPEC "|" NO_FPIC_SPEC
 #define FPIE_OR_FPIC_SPEC	NO_FPIE_AND_FPIC_SPEC ":;"
 #else
-#define PIE_SPEC		"pie"
+#define PIE_SPEC		"pie|static-pie"
 #define FPIE1_SPEC		"fpie"
 #define NO_FPIE1_SPEC		FPIE1_SPEC ":;"
 #define FPIE2_SPEC		"fPIE"
@@ -1034,12 +1034,12 @@ proper position among the other output files.  */
 #ifndef LINK_PIE_SPEC
 #ifdef HAVE_LD_PIE
 #ifndef LD_PIE_SPEC
-#define LD_PIE_SPEC "-pie"
+#define LD_PIE_SPEC "-pie %{static|static-pie:--no-dynamic-linker -z text -Bsymbolic}"
 #endif
 #else
 #define LD_PIE_SPEC ""
 #endif
-#define LINK_PIE_SPEC "%{static|shared|r:;" PIE_SPEC ":" LD_PIE_SPEC "} "
+#define LINK_PIE_SPEC "%{shared|r:;" PIE_SPEC ":" LD_PIE_SPEC "} "
 #endif

 #ifndef LINK_BUILDID_SPEC
--
2.31.1


code:
From a0d8a166ceb234bbee2d5f97dff2c54c378c4b56 Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Mon, 24 May 2021 19:54:11 +0000
Subject: [PATCH 5/5] m68k sqrt

---
 gcc/config/m68k/m68k.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md
index 59a456cd496..dbfddea41bd 100644
--- a/gcc/config/m68k/m68k.md
+++ b/gcc/config/m68k/m68k.md
@@ -4174,13 +4174,13 @@
 (define_expand "sqrt<mode>2"
   [(set (match_operand:FP 0 "nonimmediate_operand" "")
 	(sqrt:FP (match_operand:FP 1 "general_operand" "")))]
-  "TARGET_HARD_FLOAT"
+  "(TARGET_68881 && TARGET_68040) || TARGET_COLDFIRE_FPU"
   "")

 (define_insn "sqrt<mode>2_68881"
   [(set (match_operand:FP 0 "nonimmediate_operand" "=f")
 	(sqrt:FP (match_operand:FP 1 "general_operand" "f<FP:dreg>m")))]
-  "TARGET_68881"
+  "TARGET_68881 && TARGET_68040"
 {
   if (FP_REG_P (operands[1]))
     return "f<FP:round>sqrt%.x %1,%0";
--
2.31.1


code:
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -876,7 +876,9 @@ proper position among the other output f
 #endif

 #ifndef LINK_SSP_SPEC
-#ifdef TARGET_LIBC_PROVIDES_SSP
+#if DEFAULT_LIBC == LIBC_MUSL
+#define LINK_SSP_SPEC "-lssp_nonshared"
+#elif defined(TARGET_LIBC_PROVIDES_SSP)
 #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
 		       "|fstack-protector-strong|fstack-protector-explicit:}"
 #else


code:
Description: Add gifsponge docs
Author: David Suárez <david.sephirot@gmail.com>
Origin: vendor
Bug: https://sourceforge.net/p/giflib/bugs/155/
Last-Update: 2020-12-20

--- a/Makefile
+++ b/Makefile
@@ -71,6 +71,7 @@
 	doc/giffix.1 \
 	doc/gifinto.1 \
 	doc/giflib.1 \
+	doc/gifsponge.1 \
 	doc/giftext.1 \
 	doc/giftool.1

--- a/doc/Makefile
+++ b/doc/Makefile
@@ -26,6 +26,7 @@
 	giffix.xml \
 	gifinto.xml \
 	giflib.xml \
+	gifsponge.xml \
 	giftext.xml \
 	giftool.xml
 XMLINTERNAL = \
--- /dev/null
+++ b/doc/gifsponge.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE refentry PUBLIC
+   "-//OASIS//DTD DocBook XML V4.1.2//EN"
+   "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
+<!ENTITY email         "david.sephirot@gmail.com">
+]>
+<refentry id='gifsponge.1'>
+<refentryinfo><date>20 Dec 2020</date></refentryinfo>
+<refmeta>
+<refentrytitle>gifsponge</refentrytitle>
+<manvolnum>1</manvolnum>
+<refmiscinfo class="source">GIFLIB</refmiscinfo>
+<refmiscinfo class="manual">GIFLIB Documentation</refmiscinfo>
+</refmeta>
+<refnamediv id='name'>
+<refname>gifsponge</refname>
+<refpurpose>expensive GIF copy, a model for slurp utilities</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv id='synopsis'>
+
+<cmdsynopsis>
+  <command>gifsponge</command>
+</cmdsynopsis>
+</refsynopsisdiv>
+
+<refsect1><title>Description</title>
+
+<para>Slurp a GIF into core, operate on it, spew it out again.
+This is an expensive way to copy a GIF.  The source is included
+as a skeleton for more sophisticated slurp utilities.  See the source in the
+util directory for details.</para>
+
+</refsect1>
+<refsect1><title>Author</title>
+
+<para>David Suárez <email>&email;</email></para>
+
+</refsect1>
+</refentry>


code:
Description: Fix segmentation faults due to non correct checking for args
Author: David Suárez <david.sephirot@gmail.com>
Origin: vendor
Bug: https://sourceforge.net/p/giflib/bugs/153/
Bug-Debian: https://bugs.debian.org/715963
Bug-Debian: https://bugs.debian.org/715964
Bug-Debian: https://bugs.debian.org/715967
Last-Update: 2020-12-20

--- a/getarg.c
+++ b/getarg.c
@@ -305,6 +305,12 @@
     int i = 0, ScanRes;

     while (!(ISSPACE(CtrlStrCopy[i]))) {
+
+        if ((*argv) == argv_end) {
+            GAErrorToken = Option;
+            return CMD_ERR_NumRead;
+        }
+
         switch (CtrlStrCopy[i + 1]) {
           case 'd':    /* Get signed integers. */
               ScanRes = sscanf(*((*argv)++), "%d",


code:
Description: Fix some typos on the html documentation and man pages
Author: David Suárez <david.sephirot@gmail.com>
Origin: vendor
Bug: https://sourceforge.net/p/giflib/bugs/152/
Bug-Debian: https://bugs.debian.org/857609
Last-Update: 2020-12-20

--- a/doc/gif_lib.xml
+++ b/doc/gif_lib.xml
@@ -280,7 +280,7 @@
 <para>Create the union of two given color maps and return it.  If the result
 won't fit into 256 colors, NULL is returned, the allocated union
 otherwise.  ColorIn1 is copied as it to ColorUnion, while colors from
-ColorIn2 are copied iff they didn't exist before.  ColorTransIn2 maps
+ColorIn2 are copied if they didn't exist before.  ColorTransIn2 maps
 the old ColorIn2 into ColorUnion color map table.</para>

 <programlisting id="GifAttachImage">
--- a/doc/gifinto.xml
+++ b/doc/gifinto.xml
@@ -28,7 +28,7 @@

 <refsect1><title>Description</title>

-<para>A program to save stdin into a file with given name, iff the
+<para>A program to save stdin into a file with given name, if the
 result file has size bigger than specified (see below).  This can be
 used to save a result under the same filename we started with in a
 chain of pipes.</para>


code:
Description: Only install the manuals for installed binaries
Author: David Suárez <david.sephirot@gmail.com>
Origin: vendor
Bug: https://sourceforge.net/p/giflib/bugs/145/
Last-Update: 2019-11-25

--- a/Makefile
+++ b/Makefile
@@ -62,6 +62,17 @@

 LDLIBS=libgif.a -lm

+MANUAL_PAGES = \
+	doc/gif2rgb.1 \
+	doc/gifbuild.1 \
+	doc/gifclrmp.1 \
+	doc/gifecho.1 \
+	doc/giffix.1 \
+	doc/gifinto.1 \
+	doc/giflib.1 \
+	doc/giftext.1 \
+	doc/giftool.1
+
 all: libgif.so libgif.a libutil.so libutil.a $(UTILS)
 	$(MAKE) -C doc

@@ -105,7 +116,7 @@
 	ln -sf libgif.so.$(LIBMAJOR) "$(DESTDIR)$(LIBDIR)/libgif.so"
 install-man:
 	$(INSTALL) -d "$(DESTDIR)$(MANDIR)/man1"
-	$(INSTALL) -m 644 doc/*.1 "$(DESTDIR)$(MANDIR)/man1"
+	$(INSTALL) -m 644 $(MANUAL_PAGES) "$(DESTDIR)$(MANDIR)/man1"
 uninstall: uninstall-man uninstall-include uninstall-lib uninstall-bin
 uninstall-bin:
 	cd "$(DESTDIR)$(BINDIR)" && rm -f $(INSTALLABLE)


code:
Description: Recover the giffilter manual page
Author: David Suárez <david.sephirot@gmail.com>
Origin: vendor
Bug: https://sourceforge.net/p/giflib/bugs/154/
Last-Update: 2020-12-20

--- /dev/null
+++ b/doc/giffilter.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE refentry PUBLIC
+   "-//OASIS//DTD DocBook XML V4.1.2//EN"
+   "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
+<!ENTITY email         "esr@thyrsus.com">
+]>
+<refentry id='giffilter.1'>
+<refentryinfo><date>2 May 2012</date></refentryinfo>
+<refmeta>
+<refentrytitle>giffilter</refentrytitle>
+<manvolnum>1</manvolnum>
+<refmiscinfo class="source">GIFLIB</refmiscinfo>
+<refmiscinfo class="manual">GIFLIB Documentation</refmiscinfo>
+</refmeta>
+<refnamediv id='name'>
+<refname>giffilter</refname>
+<refpurpose>expensive GIF copy, a model for filter utilities</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv id='synopsis'>
+
+<cmdsynopsis>
+  <command>giffilter</command>
+</cmdsynopsis>
+</refsynopsisdiv>
+
+<refsect1><title>Description</title>
+
+<para>This is an expensive way to copy a GIF.  The source is included
+as a skeleton for more sophisticated filters.  See the source in the
+util directory for details.</para>
+
+<para>Also has some utility as a test of the sequential GIF record I/O
+routines.  The output should be bytewise identical to the input.</para>
+
+</refsect1>
+<refsect1><title>Author</title>
+
+<para>Eric S. Raymond <email>&email;</email></para>
+
+</refsect1>
+</refentry>
--- a/Makefile
+++ b/Makefile
@@ -67,6 +67,7 @@
 	doc/gifbuild.1 \
 	doc/gifclrmp.1 \
 	doc/gifecho.1 \
+	doc/giffilter.1 \
 	doc/giffix.1 \
 	doc/gifinto.1 \
 	doc/giflib.1 \
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -22,6 +22,7 @@
 	gifbuild.xml \
 	gifclrmp.xml \
 	gifecho.xml \
+	giffilter.xml \
 	giffix.xml \
 	gifinto.xml \
 	giflib.xml \


code:
Description: Revert the remove of GifQuantizeBuffer symbol from the main lib.
 It is needed for some applications (exactimage, mplayer-gui, mplayer, qutemol and xplanet).
 .
 This patch is temporary to allow switch to the new ABI, the change
 is trivial, the symbol is moved to libutil, so the packages will
 need to links against it.
Author: David Suárez <david.sephirot@gmail.com>
Origin: vendor
Last-Update: 2019-12-07

--- a/Makefile
+++ b/Makefile
@@ -29,11 +29,11 @@
 LIBVER=$(LIBMAJOR).$(LIBMINOR).$(LIBPOINT)

 SOURCES = dgif_lib.c egif_lib.c gifalloc.c gif_err.c gif_font.c \
-	gif_hash.c openbsd-reallocarray.c
+	gif_hash.c openbsd-reallocarray.c quantize.c
 HEADERS = gif_hash.h  gif_lib.h  gif_lib_private.h
 OBJECTS = $(SOURCES:.c=.o)

-USOURCES = qprintf.c quantize.c getarg.c
+USOURCES = qprintf.c getarg.c
 UHEADERS = getarg.h
 UOBJECTS = $(USOURCES:.c=.o)


code:
Submitted By:            Bruce Dubbs <bdubbs@linuxfromscratch.org>
Rediffed By:             Douglas R. Reno <renodr at linuxfromscratch dot org>
Date:                    2017-10-15
Rediffed Date:           2021-04-01
Initial Package Version: 2.54.0
Upstream Status:         Not submitted
Origin:                  Self
Description:             Adds a capabiility to skip printing warning messages using
                         an environment variable: GLIB_LOG_LEVEL.  The value
                         of the variable is a digit that correponds to:
                         1  Alert
                         2  Critical
                         3  Error
                         4  Warning
                         5  Notice

                         For instance GLIB_LOG_LEVEL=4 will skip output of Warning and
                         Notice messages (and Info/Debug messages if they are turned on).

                         Rediffed for 2.68.0 to reduce the fuzz warnings.

diff -Naurp glib-2.68.0.orig/glib/gmessages.c glib-2.68.0/glib/gmessages.c
--- glib-2.68.0.orig/glib/gmessages.c	2021-03-18 08:28:31.909625000 -0500
+++ glib-2.68.0/glib/gmessages.c	2021-04-01 20:32:23.517596280 -0500
@@ -528,6 +528,34 @@ static GDestroyNotify log_writer_user_da

 /* --- functions --- */

+/* skip_message
+ *
+ * This internal function queries an optional environment variable,
+ * GLIB_LOG_LEVEL and converts it to a value consistent
+ * with the type GLogLevelFlags. If the value is equal to
+ * or greater than the integer equivalent of the log_level,
+ * then the function returns a boolean that indicates that
+ * logging the output should be skipped.
+ */
+
+static gboolean skip_message( GLogLevelFlags log_level);
+
+static gboolean skip_message( GLogLevelFlags log_level)
+{
+   char*    user_log_level;
+   int      user_log_int;
+   gboolean skip = FALSE;
+
+   user_log_level = getenv( "GLIB_LOG_LEVEL" );
+
+   user_log_int = ( user_log_level != NULL ) ? atoi( user_log_level ) : 0;
+   user_log_int = ( user_log_level != 0 ) ? 1 << user_log_int         : 0;
+
+   if ( user_log_int >= log_level ) skip = TRUE;
+
+   return skip;
+}
+
 static void _g_log_abort (gboolean breakpoint);

 static void
@@ -2591,6 +2619,9 @@ g_log_writer_standard_streams (GLogLevel
   g_return_val_if_fail (fields != NULL, G_LOG_WRITER_UNHANDLED);
   g_return_val_if_fail (n_fields > 0, G_LOG_WRITER_UNHANDLED);

+  /* If the user does not want this message level, just return */
+  if ( skip_message( log_level) ) return G_LOG_WRITER_HANDLED;
+
   stream = log_level_to_file (log_level);
   if (!stream || fileno (stream) < 0)
     return G_LOG_WRITER_UNHANDLED;
@@ -2818,6 +2849,9 @@ _g_log_writer_fallback (GLogLevelFlags
   FILE *stream;
   gsize i;

+  /* If the user does not want this message level, just return */
+  if ( skip_message( log_level) ) return G_LOG_WRITER_HANDLED;
+
   /* we cannot call _any_ GLib functions in this fallback handler,
    * which is why we skip UTF-8 conversion, etc.
    * since we either recursed or ran out of memory, we're in a pretty


code:
Submitted By:            Pierre Labastie <pierre dot labastie at neuf dot fr>
Date:                    2022-01-15
Initial Package Version: 1.70.0
Origin:                  Upstream
Upstream Status:         Committed
Description:             Fix building with meson-0.61+

From effb1e09dee263cdac4ec593e8caf316e6f01fe2 Mon Sep 17 00:00:00 2001
From: Emmanuele Bassi <ebassi@gnome.org>
Date: Tue, 11 Jan 2022 15:51:10 +0000
Subject: [PATCH] build: Avoid the doctemplates hack
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The hack that copies the doctemplates directory into the build
directory has stopped working with newer versions of Meson; while it's
possible to copy files, custom_target() cannot depend on a directory.
Additionally, the dependency has always been broken.

Instead, we enumerate the template files—after all, it's not like they
change a lot—and then we list them as dependencies for the test targets.

Fixes: #414
---
 giscanner/doctemplates/devdocs/meson.build | 19 +++++++
 giscanner/doctemplates/mallard/meson.build | 63 ++++++++++++++++++++++
 giscanner/meson.build                      | 14 ++---
 tests/scanner/meson.build                  | 24 +++++----
 4 files changed, 98 insertions(+), 22 deletions(-)
 create mode 100644 giscanner/doctemplates/devdocs/meson.build
 create mode 100644 giscanner/doctemplates/mallard/meson.build

diff --git a/giscanner/doctemplates/devdocs/meson.build b/giscanner/doctemplates/devdocs/meson.build
new file mode 100644
index 00000000..2037182a
--- /dev/null
+++ b/giscanner/doctemplates/devdocs/meson.build
@@ -0,0 +1,19 @@
+doc_templates += files([
+  'Gjs/_doc.tmpl',
+  'Gjs/_index.tmpl',
+  'Gjs/_method.tmpl',
+  'Gjs/_methods.tmpl',
+  'Gjs/_properties.tmpl',
+  'Gjs/_signals.tmpl',
+  'Gjs/_staticmethods.tmpl',
+  'Gjs/_vfuncs.tmpl',
+  'Gjs/base.tmpl',
+  'Gjs/callback.tmpl',
+  'Gjs/class.tmpl',
+  'Gjs/default.tmpl',
+  'Gjs/enum.tmpl',
+  'Gjs/function.tmpl',
+  'Gjs/interface.tmpl',
+  'Gjs/method.tmpl',
+  'Gjs/namespace.tmpl',
+])
diff --git a/giscanner/doctemplates/mallard/meson.build b/giscanner/doctemplates/mallard/meson.build
new file mode 100644
index 00000000..5fe4e2af
--- /dev/null
+++ b/giscanner/doctemplates/mallard/meson.build
@@ -0,0 +1,63 @@
+base_templates = files([
+  'base.tmpl',
+  'class.tmpl',
+  'namespace.tmpl',
+])
+
+c_templates = files([
+  'C/callback.tmpl',
+  'C/class.tmpl',
+  'C/constructor.tmpl',
+  'C/default.tmpl',
+  'C/enum.tmpl',
+  'C/field.tmpl',
+  'C/function.tmpl',
+  'C/interface.tmpl',
+  'C/method.tmpl',
+  'C/namespace.tmpl',
+  'C/property.tmpl',
+  'C/record.tmpl',
+  'C/signal.tmpl',
+  'C/vfunc.tmpl',
+])
+
+gjs_templates = files([
+  'Gjs/callback.tmpl',
+  'Gjs/class.tmpl',
+  'Gjs/constructor.tmpl',
+  'Gjs/default.tmpl',
+  'Gjs/enum.tmpl',
+  'Gjs/field.tmpl',
+  'Gjs/function.tmpl',
+  'Gjs/interface.tmpl',
+  'Gjs/method.tmpl',
+  'Gjs/namespace.tmpl',
+  'Gjs/property.tmpl',
+  'Gjs/record.tmpl',
+  'Gjs/signal.tmpl',
+  'Gjs/vfunc.tmpl',
+])
+
+py_templates = files([
+  'Python/callback.tmpl',
+  'Python/class.tmpl',
+  'Python/constructor.tmpl',
+  'Python/default.tmpl',
+  'Python/enum.tmpl',
+  'Python/field.tmpl',
+  'Python/function.tmpl',
+  'Python/interface.tmpl',
+  'Python/method.tmpl',
+  'Python/namespace.tmpl',
+  'Python/property.tmpl',
+  'Python/record.tmpl',
+  'Python/signal.tmpl',
+  'Python/vfunc.tmpl',
+])
+
+doc_templates += [
+  base_templates,
+  c_templates,
+  gjs_templates,
+  py_templates,
+]
diff --git a/giscanner/meson.build b/giscanner/meson.build
index 41edcd44..3d7dc678 100644
--- a/giscanner/meson.build
+++ b/giscanner/meson.build
@@ -53,17 +53,9 @@ configure_file(input : '../girepository/gdump.c',

 install_subdir('doctemplates', install_dir: giscannerdir)

-# XXX: this doesn't track the input, but there is nothing to copy many files
-# in meson.
-doc_templates = custom_target('copy-templates',
-  input : 'doctemplates',
-  output : 'doctemplates',
-  command : [
-    python, '-c',
-      'import sys, shutil;' +
-      'shutil.rmtree(sys.argv[2], ignore_errors=True);' +
-      'shutil.copytree(sys.argv[1], sys.argv[2])',
-    '@INPUT@', '@OUTPUT@'])
+doc_templates = []
+subdir('doctemplates/devdocs')
+subdir('doctemplates/mallard')

 flex = find_program('flex', 'win_flex')
 bison = find_program('bison', 'win_bison')
diff --git a/tests/scanner/meson.build b/tests/scanner/meson.build
index 5176b957..b81b3fd5 100644
--- a/tests/scanner/meson.build
+++ b/tests/scanner/meson.build
@@ -525,19 +525,26 @@ foreach gir : test_girs
 endforeach

 if has_girdoctool and glib_dep.type_name() == 'pkgconfig'
+  doctool_env = environment()
+  doctool_env.set('srcdir', meson.current_source_dir())
+  doctool_env.set('builddir', meson.current_build_dir())
+
   foreach language : ['C', 'Python', 'Gjs']
     regress_docs = custom_target(
       'generate-docs-' + language,
       input: regress_gir,
-      depends: [doc_templates],
+      depend_files: doc_templates,
       build_by_default: not cairo_deps_found,
+      env: doctool_env,
       output: 'Regress-1.0-' + language,
       command: [
         python, girdoctool,
         '--add-include-path=' + join_paths(build_root, 'gir'),
         '--add-include-path=' + meson.current_build_dir(),
         '--language', language,
-        '@INPUT@', '-o', '@OUTPUT@'],
+        '--templates-dir=' + join_paths(meson.current_source_dir(), '../../giscanner/doctemplates'),
+        '@INPUT@', '-o', '@OUTPUT@',
+      ],
     )

     if cairo_deps_found
@@ -546,10 +553,7 @@ if has_girdoctool and glib_dep.type_name() == 'pkgconfig'
         python,
         args: [gi_tester, 'Regress-1.0-' + language],
         depends: [regress_docs],
-        env: [
-          'srcdir=' + meson.current_source_dir(),
-          'builddir=' + meson.current_build_dir(),
-        ],
+        env: doctool_env,
       )
     endif
   endforeach
@@ -557,9 +561,10 @@ if has_girdoctool and glib_dep.type_name() == 'pkgconfig'
   regress_sections = custom_target(
     'generate-docs-sections',
     input: regress_gir,
-    depends: [doc_templates],
+    depend_files: [doc_templates],
     build_by_default: not cairo_deps_found,
     output: 'Regress-1.0-sections.txt',
+    env: doctool_env,
     command: [
       python, girdoctool,
       '--add-include-path=' + join_paths(build_root, 'gir'),
@@ -574,10 +579,7 @@ if has_girdoctool and glib_dep.type_name() == 'pkgconfig'
       python,
       args: [gi_tester, 'Regress-1.0-sections.txt'],
       depends: [regress_sections],
-      env: [
-        'srcdir=' + meson.current_source_dir(),
-        'builddir=' + meson.current_build_dir(),
-      ],
+      env: doctool_env,
     )
   endif
 endif
--
GitLab


code:
--- gptfdisk-1.0.9/Makefile.orig	2022-05-04 20:20:23.101863901 +0000
+++ gptfdisk-1.0.9/Makefile	2022-05-04 20:20:53.010045295 +0000
@@ -68,7 +68,7 @@
 #CXXFLAGS+=-O2 -Wall -D_FILE_OFFSET_BITS=64 -D USE_UTF16
 CXXFLAGS+=-O2 -Wall -D_FILE_OFFSET_BITS=64
 LDFLAGS+=
-LDLIBS+=-luuid #-licuio -licuuc
+LDLIBS+=-luuid -licuio -licuuc
 FATBINFLAGS=
 THINBINFLAGS=
 SGDISK_LDLIBS=-lpopt


code:
Submitted By:            Bruce Dubbs <bdubbs_at_linuxfromscratch_dot_org>
Date:                    2015-10-19
Initial Package Version: 1.0.1
Upstream Status:         None.  BLFS specific.
Origin:                  BLFS
Description:             Updates Makefile enabling parameter passing.
                         Rediffed for version 1.0.1
Updates:                 Rediffed for version 1.0.3 (P. Labastie)
                         Patch version 2 for version 1.0.3: Removed ICU
                         and POPT switches, keeping only the
                         install target (P. Labastie)

diff -Naur gptfdisk-1.0.3.old/Makefile gptfdisk-1.0.3.new/Makefile
--- gptfdisk-1.0.3.old/Makefile	2017-07-28 03:41:20.000000000 +0200
+++ gptfdisk-1.0.3.new/Makefile	2018-04-20 10:04:18.896802047 +0200
@@ -37,6 +37,11 @@
 clean:	#no pre-reqs
 	rm -f core *.o *~ gdisk sgdisk cgdisk fixparts

+install: gdisk cgdisk sgdisk fixparts
+	install -dm 755 $(DESTDIR)/sbin $(DESTDIR)/usr/share/man/man8
+	install -m755 gdisk cgdisk sgdisk fixparts $(DESTDIR)/sbin
+	install -m644 *.8 $(DESTDIR)/usr/share/man/man8
+
 # what are the source dependencies
 depend: $(SRCS)
 	$(DEPEND) $(SRCS)


code:
From 127e40dcc2d62ad693cb4e03e1182d0a227d85e1 Mon Sep 17 00:00:00 2001
From: Evangelos Foutras <evangelos@foutrelis.com>
Date: Sat, 16 Apr 2022 08:24:58 +0300
Subject: [PATCH] Fix uuid/uuid.h detection with util-linux 2.38

util-linux commit 10f5f79485964ab52272ebe79c3b0047b1f84d82 changed the
header guard in uuid/uuid.h from _UUID_UUID_H to _UL_LIBUUID_UUID_H as
the former was too generic; fix guid.cc to also look for the new name.
---
 guid.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/guid.cc b/guid.cc
index 1e73ab7..d3e4fd5 100644
--- a/guid.cc
+++ b/guid.cc
@@ -141,7 +141,7 @@ void GUIDData::Zero(void) {
 void GUIDData::Randomize(void) {
    int i, uuidGenerated = 0;

-#ifdef _UUID_UUID_H
+#if defined (_UUID_UUID_H) || defined (_UL_LIBUUID_UUID_H)
    uuid_generate(uuidData);
    ReverseBytes(&uuidData[0], 4);
    ReverseBytes(&uuidData[4], 2);


code:
--- Makefile.dist.orig	2017-01-31 16:09:25.000000000 -0300
+++ Makefile.dist	2017-02-01 09:21:14.000000000 -0300
@@ -30,8 +30,8 @@
 # number of ways. See the man page and the documentation in
 # doc/graft.{html,pdf,ps,txt}.

-PACKAGEDIR	= /usr/local/pkgs
-TARGETDIR	= /usr/local
+PACKAGEDIR	= /usr/pkg
+TARGETDIR	= /

 # You should only need to change the value of TOP to reflect the
 # installation directory for graft if it is different from your default
@@ -55,7 +55,7 @@
 #
 #	#!/usr/bin/perl -w

-PERL		= /usr/bin/perl
+PERL		= /tools/bin/perl

 # The location of the perl executable used to build the graft
 # executable. You'll need to change this only if you do not have a fixed


code:
--- grub-2.06/util/grub-mkconfig.in.orig	2021-03-10 10:42:22.000000000 -0300
+++ grub-2.06/util/grub-mkconfig.in	2021-09-13 16:48:03.060695839 -0300
@@ -141,7 +141,7 @@
 GRUB_DEVICE_BOOT_UUID="`${grub_probe} --device ${GRUB_DEVICE_BOOT} --target=fs_uuid 2> /dev/null`" || true

 # Disable os-prober by default due to security reasons.
-GRUB_DISABLE_OS_PROBER="true"
+GRUB_DISABLE_OS_PROBER="false"

 # Filesystem for the device containing our userland.  Used for stuff like
 # choosing Hurd filesystem module.


code:
--- grub-2.06/util/grub.d/10_linux.in.orig	2020-12-22 20:24:17.000000000 -0300
+++ grub-2.06/util/grub.d/10_linux.in	2021-09-09 09:23:53.809125172 -0300
@@ -218,7 +218,8 @@
 	   "initramfs-genkernel-${version}" \
 	   "initramfs-genkernel-${alt_version}" \
 	   "initramfs-genkernel-${GENKERNEL_ARCH}-${version}" \
-	   "initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}"; do
+	   "initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}" \
+	   "initrd.gz" "initrd.lz"; do
     if test -e "${dirname}/${i}" ; then
       initrd_real="${i}"
       break


code:
--- icewm-1.5.5/src/CMakeLists.txt	2019-06-06 22:42:37.452717291 +0000
+++ icewm-1.5.5-b/src/CMakeLists.txt	2019-06-29 10:27:45.121315710 +0000
@@ -503,7 +503,7 @@

 ADD_EXECUTABLE(icesh${EXEEXT} icesh.cc misc.cc mstring.cc ref.cc yarray.cc)
 SET_TARGET_PROPERTIES(icesh${EXEEXT} PROPERTIES COMPILE_FLAGS "${CXXFLAGS_COMMON} ${icewm_pc_flags}")
-TARGET_LINK_LIBRARIES(icesh${EXEEXT} ${xext_LDFLAGS} ${x11_LDFLAGS} ${nls_LIBS} ${EXTRA_LIBS})
+TARGET_LINK_LIBRARIES(icesh${EXEEXT} ${xext_LDFLAGS} ${x11_LDFLAGS} ${nls_LIBS} ${EXTRA_LIBS} ${xrandr_LDFLAGS} ${xinerama_LDFLAGS})

 ADD_EXECUTABLE(icewmbg${EXEEXT} icewmbg.cc ref.cc ${ICE_COMMON_SRCS})
 SET_TARGET_PROPERTIES(icewmbg${EXEEXT} PROPERTIES COMPILE_FLAGS "${CXXFLAGS_COMMON} ${icewm_pc_flags}")


code:
diff -up icon-naming-utils-0.8.7/icon-naming-utils.pc.in.paths icon-naming-utils-0.8.7/icon-naming-utils.pc.in
--- icon-naming-utils-0.8.7/icon-naming-utils.pc.in.paths	2006-01-20 12:33:01.000000000 -0500
+++ icon-naming-utils-0.8.7/icon-naming-utils.pc.in	2008-07-22 01:00:43.000000000 -0400
@@ -1,6 +1,6 @@
 prefix=@prefix@
 exec_prefix=@exec_prefix@
-program_path=@libexecdir@
+program_path=/usr/bin

 Name: icon-naming-utils
 Description: Utilities for mapping legacy GNOME and KDE icon names to the new Icon Naming Specification
diff -up icon-naming-utils-0.8.7/Makefile.am.paths icon-naming-utils-0.8.7/Makefile.am
--- icon-naming-utils-0.8.7/Makefile.am.paths	2007-08-18 08:24:39.000000000 -0400
+++ icon-naming-utils-0.8.7/Makefile.am	2008-07-22 01:03:30.000000000 -0400
@@ -1,5 +1,5 @@

-libexec_SCRIPTS = icon-name-mapping
+bin_SCRIPTS = icon-name-mapping

 %: %.pl.in
 	sed -e "s#\@PERL\@#$(PERL)#g"		\
@@ -11,10 +11,9 @@ pkgconfig_in_files =				\
 pkgconfigdir = $(datadir)/pkgconfig
 pkgconfig_DATA = $(pkgconfig_in_files:.pc.in=.pc)

-dtddir = $(datadir)/dtds
-dtd_DATA = legacy-icon-mapping.dtd
-
-pkgdata_DATA = legacy-icon-mapping.xml
+pkgdata_DATA =  			\
+	legacy-icon-mapping.xml 	\
+	legacy-icon-mapping.dtd

 EXTRA_DIST =				\
 	icon-name-mapping.pl.in		\
@@ -24,7 +23,7 @@ EXTRA_DIST =				\
 	icon-naming-utils-uninstalled.pc.in

 CLEANFILES =				\
-	$(libexec_SCRIPTS)
+	$(bin_SCRIPTS)

 DISTCLEANFILES =			\
 	$(pkgconfig_DATA)		\


code:
--- isapnptools-1.27/include/isapnp/iopl.h.orig	2001-05-15 17:37:05.000000000 -0300
+++ isapnptools-1.27/include/isapnp/iopl.h	2020-09-04 20:16:25.018829194 -0300
@@ -58,7 +58,7 @@
 #    ifdef _AXP_
 #       include <sys/io.h>
 #    else
-#       include <asm/io.h>
+#       include <sys/io.h>
 #    endif
 #  endif	      	   /* __GLIBC__ */
 #else
--- isapnptools-1.27/src/callbacks.c.orig	2001-05-15 17:37:04.000000000 -0300
+++ isapnptools-1.27/src/callbacks.c	2020-09-04 20:16:50.906948798 -0300
@@ -49,6 +49,7 @@
 #include <isapnp/callbacks.h>
 #endif
 #include <stdio.h>
+#include <stdlib.h>
 #include <errno.h>
 #include <string.h>

--- isapnptools-1.27/src/pnp-select.c.orig	2001-05-15 17:37:04.000000000 -0300
+++ isapnptools-1.27/src/pnp-select.c	2020-09-04 20:17:23.791306819 -0300
@@ -17,6 +17,7 @@

 #include <isapnp/resource.h>
 #include <isapnp/pnp.h>
+#include <stddef.h>

 #define ASSERT(condition)	/* as nothing */


code:
diff -up kbd-2.3.0/docs/man/man1/showkey.1.orig kbd-2.3.0/docs/man/man1/showkey.1
--- kbd-2.3.0/docs/man/man1/showkey.1.orig	2020-07-08 19:25:47.000000000 +0200
+++ kbd-2.3.0/docs/man/man1/showkey.1	2020-07-16 08:56:15.970254183 +0200
@@ -84,6 +84,19 @@ corresponds to what the keyboard hardwar
 to know the scan codes sent by various keys it is better to boot a
 2.4 kernel. Since 2.6.9 there also is the boot option atkbd.softraw=0
 that tells the 2.6 kernel to return the actual scan codes.
+
+.SH NOTES
+The raw scan codes are available only on AT and PS/2 keyboards,
+and even then they are disabled unless the
+.B atkbd.softraw=0
+kernel parameter is used.
+When the raw scan codes are not available, the kernel uses a fixed built-in
+table to produce scan codes from keycodes.  Thus,
+.BR setkeycodes (8)
+can affect the output of
+.B showkey
+in scan code dump mode.
+
 .SH "SEE ALSO"
 .BR loadkeys (1),
 .BR dumpkeys (1),
diff -up kbd-2.3.0/docs/man/man8/setkeycodes.8.orig kbd-2.3.0/docs/man/man8/setkeycodes.8
--- kbd-2.3.0/docs/man/man8/setkeycodes.8.orig	2020-07-08 19:35:35.000000000 +0200
+++ kbd-2.3.0/docs/man/man8/setkeycodes.8	2020-07-16 08:57:52.293900997 +0200
@@ -42,6 +42,10 @@ the command
 will assign the keycode 112 to it, and then
 .BR loadkeys (1)
 can be used to define the function of this key.
+
+USB keyboards have standardized keycodes and
+.B setkeycodes
+doesn't affect them at all.
 .LP
 Some older kernels might hardwire a low scancode range to the
 equivalent keycodes; setkeycodes will fail when you try to remap
@@ -60,6 +64,14 @@ None.
 .SH BUGS
 The keycodes of X have nothing to do with those of Linux.
 Unusual keys can be made visible under Linux, but not under X.
+
+.B setkeycodes
+affects only the "first" input device
+that has modifiable scancode-to-keycode mapping.
+If there is more than one such device,
+.B setkeycodes
+cannot change the mapping of other devices than the "first" one.
+
 .SH "SEE ALSO"
 .BR dumpkeys (1),
 .BR loadkeys (1),


code:
diff -up kbd-1.15.2/src/unicode_start.orig kbd-1.15.2/src/unicode_start
--- kbd-1.15.2/src/unicode_start.orig	2011-01-05 13:28:22.079662644 +0100
+++ kbd-1.15.2/src/unicode_start	2011-01-05 13:29:01.327353698 +0100
@@ -72,6 +72,9 @@ stty iutf8
 # have a Unicode map attached, or explicitly specified, e.g.,
 # by giving `def.uni' as a second argument.

+DEFAULT_UNICODE_FONT=latarcyrheb-sun16
+# Also drdos8x16 is a good candidate.
+
 case "$#" in
 	2)
 		setfont "$1" -u "$2"
@@ -80,6 +83,7 @@ case "$#" in
 		setfont "$1"
 		;;
 	0)
+		setfont $DEFAULT_UNICODE_FONT
 		;;
 	*)
 		echo "usage: unicode_start [font [unicode map]]"


code:
diff -up kbd-2.3.0/src/libkfont/kdmapop.c.orig kbd-2.3.0/src/libkfont/kdmapop.c
--- kbd-2.3.0/src/libkfont/kdmapop.c.orig	2020-04-27 17:53:01.000000000 +0200
+++ kbd-2.3.0/src/libkfont/kdmapop.c	2020-07-16 09:06:45.246742724 +0200
@@ -166,6 +166,7 @@ kfont_get_unicodemap(struct kfont_contex

 		if (ioctl(fd, GIO_UNIMAP, &ud)) {
 			KFONT_ERR(ctx, "ioctl(GIO_UNIMAP): %m");
+			free(ud.entries);
 			return -1;
 		}
 		if (ct != ud.entry_ct)


code:
Submitted By: Matt Burgess
Date: 2008-12-06
Initial Package Version: 1.15
Upstream Status: Not submitted, possibly incomplete
Description: Makes Backspace and Delete keys consistent in all i386 keymaps.
Makes the Backspace key send character code 127, and Delete send a well known
escape sequence. Obsoletes the /etc/kbd/bs-sends-del file for i386.

Original patch for 1.12 by Alexander Patrakov.
Updated for 1.13 (drop ru.map, the change is upstream, and add ru_win.map,
ru-cp1251.map) by Ken Moffat <ken at linuxfromscratch dot org>.
Re-diffed against 1.15 by Matt Burgess <matthew at linuxfromscratch.org>.

diff -Naur kbd-1.15.orig/data/keymaps/i386/dvorak/dvorak-l.map kbd-1.15/data/keymaps/i386/dvorak/dvorak-l.map
--- kbd-1.15.orig/data/keymaps/i386/dvorak/dvorak-l.map	2008-06-20 12:36:01.000000000 +0100
+++ kbd-1.15/data/keymaps/i386/dvorak/dvorak-l.map	2008-12-03 22:27:55.000000000 +0000
@@ -43,7 +43,7 @@
 		keycode  11 = three		numbersign
 		keycode  12 = two		at
 		keycode  13 = one		exclam
-		keycode  14 = BackSpace		Delete
+		keycode  14 = Delete		Delete
 ! --------------------------------------------------------------------------
 ! Row 3
 ! --------------------------------------------------------------------------
diff -Naur kbd-1.15.orig/data/keymaps/i386/dvorak/dvorak-r.map kbd-1.15/data/keymaps/i386/dvorak/dvorak-r.map
--- kbd-1.15.orig/data/keymaps/i386/dvorak/dvorak-r.map	2008-06-20 12:36:01.000000000 +0100
+++ kbd-1.15/data/keymaps/i386/dvorak/dvorak-r.map	2008-12-03 22:28:13.000000000 +0000
@@ -43,7 +43,7 @@
 		keycode  11 = slash		question
 		keycode  12 = bracketleft	braceleft
 		keycode  13 = bracketright	braceright
-		keycode  14 = BackSpace		Delete
+		keycode  14 = Delete		Delete
 ! --------------------------------------------------------------------------
 ! Row 3
 ! --------------------------------------------------------------------------
diff -Naur kbd-1.15.orig/data/keymaps/i386/fgGIod/tr_f-latin5.map kbd-1.15/data/keymaps/i386/fgGIod/tr_f-latin5.map
--- kbd-1.15.orig/data/keymaps/i386/fgGIod/tr_f-latin5.map	2008-10-23 20:03:58.000000000 +0100
+++ kbd-1.15/data/keymaps/i386/fgGIod/tr_f-latin5.map	2008-12-03 22:40:32.000000000 +0000
@@ -51,7 +51,7 @@
 	alt     keycode  12 = Meta_minus
 keycode  13 = minus            underscore
 	alt     keycode  13 = Meta_equal
-keycode  14 = BackSpace           Delete
+keycode  14 = Delete           Delete
 	alt     keycode  14 = Meta_Delete
 keycode  15 = Tab              Meta_Tab
 	alt     keycode  15 = Meta_Tab
diff -Naur kbd-1.15.orig/data/keymaps/i386/qwerty/lt.l4.map kbd-1.15/data/keymaps/i386/qwerty/lt.l4.map
--- kbd-1.15.orig/data/keymaps/i386/qwerty/lt.l4.map	2008-10-23 20:03:59.000000000 +0100
+++ kbd-1.15/data/keymaps/i386/qwerty/lt.l4.map	2008-12-03 22:42:14.000000000 +0000
@@ -205,7 +205,7 @@
 #	edit this if you want the key above <Enter> to delete symbols above
 # cursor, not before.
 keycode  14 = \
-	      BackSpace	       BackSpace	BackSpace	 BackSpace  \
+	      Delete	       Delete		Delete		 Delete	     \
 	      Delete	       Delete		Delete		 Delete	     \
 	      Meta_BackSpace   Meta_BackSpace	Meta_BackSpace Meta_BackSpace \
 	      Meta_Delete      Meta_Delete	Meta_Delete	 Meta_Delete
@@ -506,7 +506,7 @@

 # Edit this if you want strict VT100 emulation.
 string F111 = "\033[3$"
-keycode 111 = Delete	       F111		Delete		 F111	   \
+keycode 111 = Remove	       F111		Remove		 F111	   \
 	      Remove	       Remove		Remove		 Remove	    \
 	      Meta_Delete      Meta_Delete	Meta_Delete	 Meta_Delete \
 	      Boot	       Boot		Boot		 Boot
diff -Naur kbd-1.15.orig/data/keymaps/i386/qwerty/lt.map kbd-1.15/data/keymaps/i386/qwerty/lt.map
--- kbd-1.15.orig/data/keymaps/i386/qwerty/lt.map	2008-10-23 20:03:59.000000000 +0100
+++ kbd-1.15/data/keymaps/i386/qwerty/lt.map	2008-12-03 22:42:58.000000000 +0000
@@ -204,7 +204,7 @@
 #	edit this if you want the key above <Enter> to delete symbols above
 # cursor, not before.
 keycode  14 = \
-	      BackSpace	       BackSpace	BackSpace	 BackSpace  \
+	      Delete	       Delete		Delete		 Delete	     \
 	      Delete	       Delete		Delete		 Delete	     \
 	      Meta_BackSpace   Meta_BackSpace	Meta_BackSpace Meta_BackSpace \
 	      Meta_Delete      Meta_Delete	Meta_Delete	 Meta_Delete
@@ -505,7 +505,7 @@

 # Edit this if you want strict VT100 emulation.
 string F111 = "\033[3$"
-keycode 111 = Delete	       F111		Delete		 F111	   \
+keycode 111 = Remove	       F111		Remove		 F111	   \
 	      Remove	       Remove		Remove		 Remove	    \
 	      Meta_Delete      Meta_Delete	Meta_Delete	 Meta_Delete \
 	      Boot	       Boot		Boot		 Boot
diff -Naur kbd-1.15.orig/data/keymaps/i386/qwerty/no-latin1.map kbd-1.15/data/keymaps/i386/qwerty/no-latin1.map
--- kbd-1.15.orig/data/keymaps/i386/qwerty/no-latin1.map	2008-06-20 12:36:00.000000000 +0100
+++ kbd-1.15/data/keymaps/i386/qwerty/no-latin1.map	2008-12-03 22:44:25.000000000 +0000
@@ -3,7 +3,7 @@
 # Send comments to Kjetil T. Homme <kjetilho@ifi.uio.no>
 include "linux-with-alt-and-altgr"
 	plain keycode  83 = KP_Comma
-	plain keycode 111 = Delete		# "Remove" originally, weird...
+	plain keycode 111 = Remove
 strings as usual

 	keycode   1 = Escape
diff -Naur kbd-1.15.orig/data/keymaps/i386/qwerty/ru1.map kbd-1.15/data/keymaps/i386/qwerty/ru1.map
--- kbd-1.15.orig/data/keymaps/i386/qwerty/ru1.map	2008-10-23 20:03:59.000000000 +0100
+++ kbd-1.15/data/keymaps/i386/qwerty/ru1.map	2008-12-03 22:45:32.000000000 +0000
@@ -143,8 +143,8 @@

 # The keycode "0xFF" is too dangerous for many programs (including emacs).
 # So let it be bracket instead of Hard Sign.
-# altgr		keycode  27 = 	+0xDF
-# altgr	shift 	keycode  27 = 	+0xFF
+altgr		keycode  27 = 	+0xDF
+altgr	shift 	keycode  27 = 	+0xFF
 	control	keycode  27 =	Control_bracketright
 altgr	control	keycode  27 =	Control_bracketright
 	alt	keycode  27 =	Meta_bracketright
diff -Naur kbd-1.15.orig/data/keymaps/i386/qwerty/ru2.map kbd-1.15/data/keymaps/i386/qwerty/ru2.map
--- kbd-1.15.orig/data/keymaps/i386/qwerty/ru2.map	2008-10-23 20:03:59.000000000 +0100
+++ kbd-1.15/data/keymaps/i386/qwerty/ru2.map	2008-12-03 22:46:15.000000000 +0000
@@ -46,7 +46,7 @@
 	alt	keycode  12 =	Meta_minus
 		keycode  13 =	equal	plus		equal	plus
 	alt	keycode  13 =	Meta_equal
-		keycode  14 =	BackSpace BackSpace	BackSpace BackSpace
+		keycode  14 =	Delete Delete	Delete Delete
 	alt	keycode  14 =	Meta_Delete
 		keycode  15 =	Tab	Tab		Tab	Tab
 	alt	keycode  15 =	Meta_Tab
diff -Naur kbd-1.15.orig/data/keymaps/i386/qwerty/ru-cp1251.map kbd-1.15/data/keymaps/i386/qwerty/ru-cp1251.map
--- kbd-1.15.orig/data/keymaps/i386/qwerty/ru-cp1251.map	2008-10-23 20:03:59.000000000 +0100
+++ kbd-1.15/data/keymaps/i386/qwerty/ru-cp1251.map	2008-12-03 22:47:12.000000000 +0000
@@ -39,7 +39,7 @@
 	alt	keycode  12 =	Meta_minus
 		keycode  13 =	equal	plus		equal	plus
 	alt	keycode  13 =	Meta_equal
-		keycode  14 =	BackSpace
+		keycode  14 =	Delete
 	alt	keycode  14 =	Meta_Delete
 		keycode  15 =	Tab
 	alt	keycode  15 =	Meta_Tab
diff -Naur kbd-1.15.orig/data/keymaps/i386/qwerty/ru-ms.map kbd-1.15/data/keymaps/i386/qwerty/ru-ms.map
--- kbd-1.15.orig/data/keymaps/i386/qwerty/ru-ms.map	2008-10-23 20:03:59.000000000 +0100
+++ kbd-1.15/data/keymaps/i386/qwerty/ru-ms.map	2008-12-03 22:48:10.000000000 +0000
@@ -89,8 +89,8 @@
 altgr	alt     keycode  13 =    Meta_equal
 	shift alt keycode  13 = 	Meta_plus
 altgr	shift alt keycode  13 = 	Meta_plus
-		keycode  14 = 	BackSpace  BackSpace  BackSpace  BackSpace
-#		keycode  14 = 	Delete  Delete  Delete  Delete
+#		keycode  14 = 	BackSpace  BackSpace  BackSpace  BackSpace
+		keycode  14 = 	Delete  Delete  Delete  Delete
 	alt	keycode  14 =	Meta_Delete
 altgr	alt     keycode  14 = 	Meta_Delete
 		keycode  15 =	Tab	Tab		Tab	Tab
diff -Naur kbd-1.15.orig/data/keymaps/i386/qwerty/ru_win.map kbd-1.15/data/keymaps/i386/qwerty/ru_win.map
--- kbd-1.15.orig/data/keymaps/i386/qwerty/ru_win.map	2008-10-23 20:03:59.000000000 +0100
+++ kbd-1.15/data/keymaps/i386/qwerty/ru_win.map	2008-12-03 22:49:17.000000000 +0000
@@ -42,7 +42,7 @@
 	alt	keycode  12 =	Meta_minus
 		keycode  13 =	equal	plus		equal	plus
 	alt	keycode  13 =	Meta_equal
-		keycode  14 =	BackSpace BackSpace	BackSpace BackSpace
+		keycode  14 =	Delete Delete	Delete Delete
 	alt	keycode  14 =	Meta_Delete
 		keycode  15 =	Tab	Tab		Tab	Tab
 	alt	keycode  15 =	Meta_Tab
diff -Naur kbd-1.15.orig/data/keymaps/i386/qwerty/se-ir209.map kbd-1.15/data/keymaps/i386/qwerty/se-ir209.map
--- kbd-1.15.orig/data/keymaps/i386/qwerty/se-ir209.map	2008-10-23 20:03:59.000000000 +0100
+++ kbd-1.15/data/keymaps/i386/qwerty/se-ir209.map	2008-12-03 22:50:18.000000000 +0000
@@ -345,7 +345,7 @@
 	keycode 109 = Next	Scroll_Forward
 	keycode 110 = Insert

-	keycode 111 = Delete		# "Remove" originally, weird...
+	keycode 111 = Remove
 control alt	keycode 111 = Boot
 control altgr	keycode 111 = Boot

diff -Naur kbd-1.15.orig/data/keymaps/i386/qwerty/se-lat6.map kbd-1.15/data/keymaps/i386/qwerty/se-lat6.map
--- kbd-1.15.orig/data/keymaps/i386/qwerty/se-lat6.map	2008-10-23 20:03:59.000000000 +0100
+++ kbd-1.15/data/keymaps/i386/qwerty/se-lat6.map	2008-12-03 22:50:44.000000000 +0000
@@ -374,6 +374,6 @@
 	keycode 109 = Next	Scroll_Forward
 	keycode 110 = Insert

-	keycode 111 = Delete		# "Remove" originally, weird...
+	keycode 111 = Remove
 control alt	keycode 111 = Boot
 control altgr	keycode 111 = Boot
diff -Naur kbd-1.15.orig/data/keymaps/i386/qwerty/tr_q-latin5.map kbd-1.15/data/keymaps/i386/qwerty/tr_q-latin5.map
--- kbd-1.15.orig/data/keymaps/i386/qwerty/tr_q-latin5.map	2008-10-23 20:03:59.000000000 +0100
+++ kbd-1.15/data/keymaps/i386/qwerty/tr_q-latin5.map	2008-12-03 22:52:09.000000000 +0000
@@ -49,7 +49,7 @@
 	alt     keycode  12 = Meta_minus
 keycode  13 = minus            underscore
 	alt     keycode  13 = Meta_equal
-keycode  14 = BackSpace           Delete
+keycode  14 = Delete           Delete
 	alt     keycode  14 = Meta_Delete
 keycode  15 = Tab              Meta_Tab
 	alt     keycode  15 = Meta_Tab
diff -Naur kbd-1.15.orig/data/keymaps/i386/qwerty/ua.map kbd-1.15/data/keymaps/i386/qwerty/ua.map
--- kbd-1.15.orig/data/keymaps/i386/qwerty/ua.map	2008-10-23 20:03:59.000000000 +0100
+++ kbd-1.15/data/keymaps/i386/qwerty/ua.map	2008-12-03 22:52:52.000000000 +0000
@@ -249,7 +249,7 @@
 	shift ctrll ctrlr keycode  13 = plus
 	alt ctrll ctrlr keycode  13 = Meta_equal
 	shift alt ctrll ctrlr keycode  13 = Meta_plus
-keycode  14 = BackSpace           Delete
+keycode  14 = Delete           Delete
 	control	keycode  14 = BackSpace
 	alt	keycode  14 = Meta_Delete
 	ctrlr	keycode  14 = BackSpace
diff -Naur kbd-1.15.orig/data/keymaps/i386/qwerty/ua-utf.map kbd-1.15/data/keymaps/i386/qwerty/ua-utf.map
--- kbd-1.15.orig/data/keymaps/i386/qwerty/ua-utf.map	2008-10-23 20:03:59.000000000 +0100
+++ kbd-1.15/data/keymaps/i386/qwerty/ua-utf.map	2008-12-03 22:53:36.000000000 +0000
@@ -250,7 +250,7 @@
 	shift ctrll ctrlr keycode  13 = plus
 	alt ctrll ctrlr keycode  13 = Meta_equal
 	shift alt ctrll ctrlr keycode  13 = Meta_plus
-keycode  14 = BackSpace           Delete
+keycode  14 = Delete           Delete
 	control	keycode  14 = BackSpace
 	alt	keycode  14 = Meta_Delete
 	ctrlr	keycode  14 = BackSpace
diff -Naur kbd-1.15.orig/data/keymaps/i386/qwerty/ua-utf-ws.map kbd-1.15/data/keymaps/i386/qwerty/ua-utf-ws.map
--- kbd-1.15.orig/data/keymaps/i386/qwerty/ua-utf-ws.map	2008-10-23 20:03:59.000000000 +0100
+++ kbd-1.15/data/keymaps/i386/qwerty/ua-utf-ws.map	2008-12-03 22:54:06.000000000 +0000
@@ -260,7 +260,7 @@
 	shift ctrll ctrlr keycode  13 = plus
 	alt ctrll ctrlr keycode  13 = Meta_equal
 	shift alt ctrll ctrlr keycode  13 = Meta_plus
-keycode  14 = BackSpace           Delete
+keycode  14 = Delete           Delete
 	control	keycode  14 = BackSpace
 	alt	keycode  14 = Meta_Delete
 	ctrlr	keycode  14 = BackSpace
diff -Naur kbd-1.15.orig/data/keymaps/i386/qwerty/ua-ws.map kbd-1.15/data/keymaps/i386/qwerty/ua-ws.map
--- kbd-1.15.orig/data/keymaps/i386/qwerty/ua-ws.map	2008-10-23 20:03:59.000000000 +0100
+++ kbd-1.15/data/keymaps/i386/qwerty/ua-ws.map	2008-12-03 22:54:23.000000000 +0000
@@ -260,7 +260,7 @@
 	shift ctrll ctrlr keycode  13 = plus
 	alt ctrll ctrlr keycode  13 = Meta_equal
 	shift alt ctrll ctrlr keycode  13 = Meta_plus
-keycode  14 = BackSpace           Delete
+keycode  14 = Delete           Delete
 	control	keycode  14 = BackSpace
 	alt	keycode  14 = Meta_Delete
 	ctrlr	keycode  14 = BackSpace