Skip to content

Commit

Permalink
feat: update toolchain with new component versions (incl. gcc 10.2.0)
Browse files Browse the repository at this point in the history
See siderolabs/toolchain#15

As part of gcc 10.2 fixes:

* cpio updated to 2.14
* dtc updated to 1.6.0
* squashfs_tools updated to 4.4

Patches applied when required.

Signed-off-by: Andrey Smirnov <[email protected]>
  • Loading branch information
smira authored and talos-bot committed Sep 4, 2020
1 parent 66c4c43 commit 4231ebb
Show file tree
Hide file tree
Showing 11 changed files with 66 additions and 228 deletions.
3 changes: 2 additions & 1 deletion Pkgfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
format: v1alpha2

vars:
TOOLCHAIN_IMAGE: docker.io/autonomy/toolchain:v0.1.0-4-gaee36a0
TOOLCHAIN_IMAGE: docker.io/autonomy/toolchain:v0.1.0-6-gb80d728

1 change: 1 addition & 0 deletions cmake/pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ steps:
--parallel=$(nproc) \
-- -DCMAKE_BUILD_TYPE:STRING=Release \
-DCMAKE_INSTALL_RPATH=/toolchain/lib
build:
- |
make -j $(nproc)
install:
Expand Down
14 changes: 14 additions & 0 deletions cpio/patches/gcc-10.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/src/global.c b/src/global.c
index fb3abe9..acf92bc 100644
--- a/src/global.c
+++ b/src/global.c
@@ -184,9 +184,6 @@ unsigned int warn_option = 0;
/* Extract to standard output? */
bool to_stdout_option = false;

-/* The name this program was run with. */
-char *program_name;
-
/* A pointer to either lstat or stat, depending on whether
dereferencing of symlinks is done for input files. */
int (*xstat) ();
9 changes: 6 additions & 3 deletions cpio/pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ dependencies:
- stage: autoconf
steps:
- sources:
- url: https://ftp.gnu.org/gnu/cpio/cpio-2.12.tar.gz
- url: https://ftp.gnu.org/gnu/cpio/cpio-2.13.tar.gz
destination: cpio.tar.gz
sha256: 08a35e92deb3c85d269a0059a27d4140a9667a6369459299d08c17f713a92e73
sha512: 640a6980273b699dba147e7b656440d3bd09c1c3ac71650f218ca1e4b4309c04b391ff2a8569e12d7a95827dd2781ab369542de20cc3c26dab3431f2efbdc905
sha256: e87470d9c984317f658567c03bfefb6b0c829ff17dbf6b0de48d71a4c8f3db88
sha512: 1e1ca6b3e3e64f206f9d828a152d6b4f8f6974de7a953ff96e02698b1c3c2c777c2111450e6a71c0693e29ca8bc01c3dda9f5e829b8e3221f647414df49dff6a
prepare:
- |
tar -xzf cpio.tar.gz --strip-components=1
patch -p1 < /pkg/patches/gcc-10.patch
mkdir build
cd build
../configure \
Expand Down
6 changes: 3 additions & 3 deletions dtc/pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ dependencies:
- stage: pkg-config
steps:
- sources:
- url: https://mirrors.edge.kernel.org/pub/software/utils/dtc/dtc-1.5.0.tar.xz
- url: https://mirrors.edge.kernel.org/pub/software/utils/dtc/dtc-1.6.0.tar.xz
destination: dtc.tar.xz
sha256: c672e443c9f7e39f5a7c8e602da6777f9ad55ad70de87de300a43828c8050172
sha512: fd1e692a1b7bf7987f921ad17d9be6719f7b3aa7915873b45fa86f4ecb1398a0a62cdf53c1fddf98a0f7fed9bf34a79f684018bd01a2b5e88746b50879bf7102
sha256: 10503b0217e1b07933e29e8d347a00015b2431bea5f59afe0bed3af30340c82d
sha512: 15433b24f1d6b7ed1f8066d050bd1bcbf988731aa38147564e3dd04b5f69af8d69e03befdc621a768526c620425a9bdd24aad4f9ff135930d6a1eeb0625f7de3
prepare:
- |
tar -xJf dtc.tar.xz --strip-components=1
Expand Down

This file was deleted.

38 changes: 2 additions & 36 deletions squashfs-tools/patches/fix-compat.patch
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,10 @@
@@ -1905,6 +1905,9 @@
return 1;
}

+#ifndef FNM_EXTMATCH
+#define FNM_EXTMATCH 0
+#endif

TEST_FN(name, ACTION_ALL_LNK, \
return fnmatch(atom->argv[0], action_data->name,
--- squashfs4.3.orig/squashfs-tools/mksquashfs.c
+++ squashfs4.3/squashfs-tools/mksquashfs.c
@@ -4391,6 +4391,9 @@
return paths;
}

+#ifndef FNM_EXTMATCH
+#define FNM_EXTMATCH 0
+#endif

int excluded_match(char *name, struct pathname *path, struct pathnames **new)
{
--- squashfs4.3.orig/squashfs-tools/pseudo.c
+++ squashfs4.3/squashfs-tools/pseudo.c
@@ -32,6 +32,7 @@
#include <stdlib.h>
#include <sys/types.h>
#include <sys/wait.h>
+#include <sys/stat.h>
#include <ctype.h>

#include "pseudo.h"
--- squashfs4.3.orig/squashfs-tools/unsquashfs.c
+++ squashfs4.3/squashfs-tools/unsquashfs.c
@@ -1410,6 +1410,9 @@
free(paths);
}

+#ifndef FNM_EXTMATCH
+#define FNM_EXTMATCH 0
+#endif

int matches(struct pathnames *paths, char *name, struct pathnames **new)
{
33 changes: 33 additions & 0 deletions squashfs-tools/patches/fnocommon.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
From 17e8444a192debd21a0403e80e2072c81c73592f Mon Sep 17 00:00:00 2001
From: Jeroen Roovers <[email protected]>
Date: Mon, 27 Jan 2020 12:57:27 +0100
Subject: [PATCH] Fix compiling with -fno-common

GCC 10 will enable -fno-common by default[0], which causes the linker to fail like this [1]:

```
ld: read_fs.o:(.bss+0x0): multiple definition of `fwriter_buffer'; mksquashfs.o:(.bss+0x400c90): first defined here
ld: read_fs.o:(.bss+0x8): multiple definition of `bwriter_buffer'; mksquashfs.o:(.bss+0x400c98): first defined here
```

Fix this by declaring both variables as `extern` in the header file.

[0] https://gcc.gnu.org/gcc-10/porting_to.html#common
[1] https://bugs.gentoo.org/706456
---
squashfs-tools/mksquashfs.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/squashfs-tools/mksquashfs.h b/squashfs-tools/mksquashfs.h
index 1beefef7..b6503063 100644
--- a/squashfs-tools/mksquashfs.h
+++ b/squashfs-tools/mksquashfs.h
@@ -143,7 +143,7 @@ struct append_file {
#endif

extern struct cache *reader_buffer, *fragment_buffer, *reserve_cache;
-struct cache *bwriter_buffer, *fwriter_buffer;
+extern struct cache *bwriter_buffer, *fwriter_buffer;
extern struct queue *to_reader, *to_deflate, *to_writer, *from_writer,
*to_frag, *locked_fragment, *to_process_frag;
extern struct append_file **file_mapping;
25 changes: 0 additions & 25 deletions squashfs-tools/patches/squashfs-tools-4.3-sysmacros.patch

This file was deleted.

9 changes: 4 additions & 5 deletions squashfs-tools/pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@ dependencies:
- stage: patch
steps:
- sources:
- url: https://mirror.us.leaseweb.net/slackware/slackware64-14.2/source/ap/squashfs-tools/squashfs4.3.tar.gz
- url: https://github.com/plougher/squashfs-tools/archive/4.4.tar.gz
destination: squashfs.tar.gz
sha256: 0d605512437b1eb800b4736791559295ee5f60177e102e4d4ccd0ee241a5f3f6
sha512: 854ed7acc99920f24ecf11e0da807e5a2a162eeda55db971aba63a03f0da2c13b20ec0564a906c4b0e415bd8258b273a10208c7abc0704f2ceea773aa6148a79
sha256: a7fa4845e9908523c38d4acf92f8a41fdfcd19def41bd5090d7ad767a6dc75c3
sha512: 133ce437fb8c929933d52cff710b61dd9181f6f8be58250b0d6a59a7bb79a2b350f68f456b06a0e17c469409a71272d586802d570248273ddcd5dad088c00308
prepare:
- |
tar -xf squashfs.tar.gz --strip-components=1
patch -p1 </pkg/patches/fix-compat.patch
patch -p1 </pkg/patches/0003-mksquashfs.c-get-inline-functions-work-with-C99.patch
patch -p1 </pkg/patches/squashfs-tools-4.3-sysmacros.patch
patch -p1 </pkg/patches/fnocommon.patch
build:
- |
cd squashfs-tools
Expand Down
2 changes: 1 addition & 1 deletion xz/pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ dependencies:
- stage: base
steps:
- sources:
- url: https://downloads.sourceforge.net/project/lzmautils/xz-5.2.4.tar.xz
- url: http://deb.debian.org/debian/pool/main/x/xz-utils/xz-utils_5.2.4.orig.tar.xz
destination: xz.tar.xz
sha256: 9717ae363760dedf573dad241420c5fea86256b65bc21d2cf71b2b12f0544f4b
sha512: 00db7dd31a61541b1ce6946e0f21106f418dd1ac3f27cdb8682979cbc3bd777cd6dd1f04f9ba257a0a7e24041e15ca40d0dd5c130380dce62280af67a0beb97f
Expand Down

0 comments on commit 4231ebb

Please sign in to comment.