summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author Matteo Bernardini2020-12-06 14:02:29 +0100
committer Matteo Bernardini2021-04-10 15:45:27 +0200
commita67c96665a946c44d782b568b6da3aa2217bc9cc (patch)
treeedf49e8898592e53718e8e3974aeed165b2d03a4
parentcf65c072371dbcb73b7ea6d75de27bb6b96899f7 (diff)
downloadslackbuilds-pinfo.tar.gz
misc/pinfo: Fix building with gcc >= 10.x.pinfo
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
-rw-r--r--misc/pinfo/gcc10-stringop.diff28
-rw-r--r--misc/pinfo/pinfo.SlackBuild4
2 files changed, 31 insertions, 1 deletions
diff --git a/misc/pinfo/gcc10-stringop.diff b/misc/pinfo/gcc10-stringop.diff
new file mode 100644
index 0000000000..a57fa91d08
--- /dev/null
+++ b/misc/pinfo/gcc10-stringop.diff
@@ -0,0 +1,28 @@
+diff --git a/src/utils.c b/src/utils.c
+index cb2fe76..2e4139c 100644
+--- a/src/utils.c
++++ b/src/utils.c
+@@ -848,10 +848,9 @@ char *
+ make_tempfile()
+ {
+ char *filename;
+- size_t len;
+
+ /* TODO: fix hardcoded /tmp */
+- char tmpfile_template[] = "/tmp/pinfo.XXXXXX";
++ char tmpfile_template[32] = "/tmp/pinfo.XXXXXX";
+
+ /* create a tmpfile */
+ int fd = mkstemp(tmpfile_template);
+@@ -864,9 +863,8 @@ make_tempfile()
+ }
+
+ /* allocate a new string and copy the filename there */
+- len = strlen(tmpfile_template)+1;
+- filename = xmalloc(len+1); /* guarenteerd to be set to \0's */
+- strncpy(filename, tmpfile_template, len);
++ filename = xmalloc(33); /* guarenteerd to be set to \0's */
++ strncpy(filename, tmpfile_template, 32);
+
+ /* close the file */
+ close(fd);
diff --git a/misc/pinfo/pinfo.SlackBuild b/misc/pinfo/pinfo.SlackBuild
index 5b318d1b5a..779bf904ac 100644
--- a/misc/pinfo/pinfo.SlackBuild
+++ b/misc/pinfo/pinfo.SlackBuild
@@ -79,9 +79,11 @@ chown -R root:root .
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
+patch -p1 < $CWD/gcc10-stringop.diff
+
[ -e configure ] || sh autogen.sh
-CFLAGS="$SLKCFLAGS" \
+CFLAGS="$SLKCFLAGS -fcommon" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \