diff options
42 files changed, 1513 insertions, 236 deletions
diff --git a/config/comp_libs/picolibc.in b/config/comp_libs/picolibc.in index 99f0e452..4b283aec 100644 --- a/config/comp_libs/picolibc.in +++ b/config/comp_libs/picolibc.in @@ -1,6 +1,9 @@ -# picolibc options +# picolibc companion library options +## no-package ## depends on BARE_METAL && CONFIGURE_has_meson && CONFIGURE_has_ninja +## depends on !LIBC_PICOLIBC +## select LIBC_PICOLIBC_SHOW ## help This option adds Picolibc to an existing configuration which may have ## help a C library, allowing you to install both and select between them @@ -9,124 +12,21 @@ ## help Picolibc is a C library intended for use on embedded systems. It is a ## help conglomeration of several library parts, all under BSD-compatible software ## help licenses that make them easily usable on embedded products. +## help +## help Configuration for picolibc can be found under: +## help -> C-library +## help -> picolibc config LIBC_PICOLIBC_GCC_LIBSTDCXX bool - prompt "Compile libstdc++ picolibc variant" + prompt "Compile companion libstdc++ picolibc variant" default y depends on CC_LANG_CXX help This option compiles an additional target libstdc++ for use with - picolibc. This version is linked when "--specs=picolibcpp.specs" - is specified. + the picolibc companion library. This version is linked when + "--specs=picolibcpp.specs" is specified. -config LIBC_PICOLIBC_CXA_ATEXIT - def_bool y - select LIBC_PROVIDES_CXA_ATEXIT - -config LIBC_PICOLIBC_TARGET_CFLAGS - string - prompt "Target CFLAGS for picolibc" - default "" - help - Used to add specific options when compiling the target libraries - (eg. -ffunction-sections -fdata-sections), which can't be defined - in global TARGET_CFLAGS, because they shall be not used for the - gcc target libraries. - Note: Both TARGET_CFLAGS and LIBC_PICOLIBC_TARGET_CFLAGS are used - to compile the libraries. - - Leave blank if you don't know better. - -config LIBC_PICOLIBC_IO_C99FMT - bool - prompt "Enable IOs on C99 formats" - default y - help - Enable support for IOs on C99 formats. - -config LIBC_PICOLIBC_REGISTER_FINI - bool - prompt "Enable finalization function registration using atexit" - help - Enable finalization function registration using atexit. - -config LIBC_PICOLIBC_ATEXIT_DYNAMIC_ALLOC - bool - prompt "Enable dynamic allocation of atexit entries" - help - Enable dynamic allocation of atexit entries. - -config LIBC_PICOLIBC_GLOBAL_ATEXIT - bool - prompt "Enable atexit data structure as global variable" - help - Enable atexit data structure as global variable, instead - of being thread-local. - -config LIBC_PICOLIBC_LITE_EXIT - bool - prompt "Enable lite exit" - default y - help - Enable lite exit, a size-reduced implementation of exit that doesn't - invoke clean-up functions such as _fini or global destructors. - -config LIBC_PICOLIBC_MULTITHREAD - bool - prompt "Enable support for multiple threads" - default y - help - Enable support for multiple threads. - -config LIBC_PICOLIBC_RETARGETABLE_LOCKING - bool - prompt "Enable retargetable locking" - default y - help - Enable retargetable locking to allow the operating system to override - the dummy lock functions defined within picolibc. - -config LIBC_PICOLIBC_EXTRA_SECTIONS - bool - prompt "Place each function & data element in their own section" - help - Place each function & data symbol in their own section. This allows - the linker to garbage collect unused symbols at link time. - -config LIBC_PICOLIBC_ENABLE_TARGET_OPTSPACE - bool - prompt "Optimize picolibc for size" - default y - help - Pass --enable-target-optspace to picolibc configure. - - This will compile picolibc with -Os. - -config LIBC_PICOLIBC_LTO - bool - prompt "Enable Link Time Optimization" - depends on CC_GCC_USE_LTO - help - Builds the libraries with -flto to enable more aggressive link time - optimization. You will need to add -flto-partition=one to your - application's link line to keep the RETURN assembler macro together - with it's consumers. - -config LIBC_PICOLIBC_NANO_MALLOC - bool - prompt "Enable Nano Malloc" - default y - help - PICOLIBC has two implementations of malloc family's functions, one in - `mallocr.c' and the other one in `nano-mallocr.c'. This options - enables the nano-malloc implementation, which is for small systems - with very limited memory. Note that this implementation does not - support `--enable-malloc-debugging' any more. - -config LIBC_PICOLIBC_EXTRA_CONFIG_ARRAY - string - prompt "Extra config for picolibc" - default "" - help - Extra flags to pass to meson when configuring picolibc. +comment "Configuration for picolibc can be found under" +comment "* -> C-library" +comment "* -> picolibc" diff --git a/config/libc/picolibc.in b/config/libc/picolibc.in new file mode 100644 index 00000000..cd6da1ed --- /dev/null +++ b/config/libc/picolibc.in @@ -0,0 +1,125 @@ +# picolibc options + +## depends on BARE_METAL && CONFIGURE_has_meson && CONFIGURE_has_ninja +## select CC_CORE_NEEDED +## select LIBC_SUPPORT_THREADS_NATIVE + +## help Picolibc is a C library intended for use on embedded systems. It is a +## help conglomeration of several library parts, all under BSD-compatible software +## help licenses that make them easily usable on embedded products. +## help +## help This requres GCC with picolibc support which is only available +## help for GCC version 12.2.0 or later. A crosstool-ng dependency conflict +## help prevents that from being managed automatically. +## + +config LIBC_PICOLIBC_CXA_ATEXIT + def_bool y + select LIBC_PROVIDES_CXA_ATEXIT + +config LIBC_PICOLIBC_TARGET_CFLAGS + string + prompt "Target CFLAGS for picolibc" + default "" + help + Used to add specific options when compiling the target libraries + (eg. -ffunction-sections -fdata-sections), which can't be defined + in global TARGET_CFLAGS, because they shall be not used for the + gcc target libraries. + Note: Both TARGET_CFLAGS and LIBC_PICOLIBC_TARGET_CFLAGS are used + to compile the libraries. + + Leave blank if you don't know better. + +config LIBC_PICOLIBC_IO_C99FMT + bool + prompt "Enable IOs on C99 formats" + default y + help + Enable support for IOs on C99 formats. + +config LIBC_PICOLIBC_REGISTER_FINI + bool + prompt "Enable finalization function registration using atexit" + help + Enable finalization function registration using atexit. + +config LIBC_PICOLIBC_ATEXIT_DYNAMIC_ALLOC + bool + prompt "Enable dynamic allocation of atexit entries" + help + Enable dynamic allocation of atexit entries. + +config LIBC_PICOLIBC_GLOBAL_ATEXIT + bool + prompt "Enable atexit data structure as global variable" + help + Enable atexit data structure as global variable, instead + of being thread-local. + +config LIBC_PICOLIBC_LITE_EXIT + bool + prompt "Enable lite exit" + default y + help + Enable lite exit, a size-reduced implementation of exit that doesn't + invoke clean-up functions such as _fini or global destructors. + +config LIBC_PICOLIBC_MULTITHREAD + bool + prompt "Enable support for multiple threads" + default y + help + Enable support for multiple threads. + +config LIBC_PICOLIBC_RETARGETABLE_LOCKING + bool + prompt "Enable retargetable locking" + default y + help + Enable retargetable locking to allow the operating system to override + the dummy lock functions defined within picolibc. + +config LIBC_PICOLIBC_EXTRA_SECTIONS + bool + prompt "Place each function & data element in their own section" + help + Place each function & data symbol in their own section. This allows + the linker to garbage collect unused symbols at link time. + +config LIBC_PICOLIBC_ENABLE_TARGET_OPTSPACE + bool + prompt "Optimize picolibc for size" + default y + help + Pass --enable-target-optspace to picolibc configure. + + This will compile picolibc with -Os. + +config LIBC_PICOLIBC_LTO + bool + prompt "Enable Link Time Optimization" + depends on CC_GCC_USE_LTO + help + Builds the libraries with -flto to enable more aggressive link time + optimization. You will need to add -flto-partition=one to your + application's link line to keep the RETURN assembler macro together + with it's consumers. + +config LIBC_PICOLIBC_NANO_MALLOC + bool + prompt "Enable Nano Malloc" + default y + help + PICOLIBC has two implementations of malloc family's functions, one in + `mallocr.c' and the other one in `nano-mallocr.c'. This options + enables the nano-malloc implementation, which is for small systems + with very limited memory. Note that this implementation does not + support `--enable-malloc-debugging' any more. + +config LIBC_PICOLIBC_EXTRA_CONFIG_ARRAY + string + prompt "Extra config for picolibc" + default "" + help + Extra flags to pass to meson when configuring picolibc. diff --git a/debian/control b/debian/control index 02be6379..fa6a5f1e 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,8 @@ Priority: optional Maintainer: Multiple Candidates <open@example.com> Build-Depends: debhelper (>= 9), autoconf, automake, autotools-dev, libncursesw5-dev, libncurses5-dev, bison, flex, curl, wget, - texinfo, help2man, gawk, git, subversion, bzip2, libtool-bin + texinfo, help2man, gawk, git, subversion, bzip2, libtool-bin, + unzip, python3-dev Standards-Version: 3.9.8 Homepage: http://crosstool-ng.org/ diff --git a/packages/binutils/2.40/0000-sh-conf.patch b/packages/binutils/2.40/0000-sh-conf.patch new file mode 100644 index 00000000..ec80bc14 --- /dev/null +++ b/packages/binutils/2.40/0000-sh-conf.patch @@ -0,0 +1,32 @@ +From a405e63e51c45b85b6a5432bdef8fda3aae66b9c Mon Sep 17 00:00:00 2001 +From: Chris Packham <judge.packham@gmail.com> +Date: Mon, 8 Aug 2022 20:31:10 +1200 +Subject: [PATCH] sh conf + +--- + configure | 2 +- + configure.ac | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/configure ++++ b/configure +@@ -4067,7 +4067,7 @@ + nvptx*-*-*) + noconfigdirs="$noconfigdirs target-libssp target-libstdc++-v3 target-libobjc" + ;; +- sh-*-*) ++ sh*-*-*) + case "${target}" in + sh*-*-elf) + ;; +--- a/configure.ac ++++ b/configure.ac +@@ -1300,7 +1300,7 @@ + nvptx*-*-*) + noconfigdirs="$noconfigdirs target-libssp target-libstdc++-v3 target-libobjc" + ;; +- sh-*-*) ++ sh*-*-*) + case "${target}" in + sh*-*-elf) + ;; diff --git a/packages/binutils/2.40/0001-check_ldrunpath_length.patch b/packages/binutils/2.40/0001-check_ldrunpath_length.patch new file mode 100644 index 00000000..2f7964f1 --- /dev/null +++ b/packages/binutils/2.40/0001-check_ldrunpath_length.patch @@ -0,0 +1,29 @@ +From 4498a395b3f16cb54fe352322a471c029c2f2b9c Mon Sep 17 00:00:00 2001 +From: Chris Packham <judge.packham@gmail.com> +Date: Mon, 8 Aug 2022 20:36:31 +1200 +Subject: [PATCH] check_ldrunpath_length + +--- + ld/ldelf.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/ld/ldelf.c ++++ b/ld/ldelf.c +@@ -1127,6 +1127,8 @@ + && command_line.rpath == NULL) + { + path = (const char *) getenv ("LD_RUN_PATH"); ++ if (path && *path == '\0') ++ path = NULL; + if (path + && ldelf_search_needed (path, &n, force, + is_linux, elfsize)) +@@ -1801,6 +1803,8 @@ + rpath = command_line.rpath; + if (rpath == NULL) + rpath = (const char *) getenv ("LD_RUN_PATH"); ++ if (rpath && *rpath == '\0') ++ rpath = NULL; + + for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next) + if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) diff --git a/packages/binutils/2.40/0002-MinGW-w64-winpthreads-doesn-t-have-pthread_mutexattr.patch b/packages/binutils/2.40/0002-MinGW-w64-winpthreads-doesn-t-have-pthread_mutexattr.patch new file mode 100644 index 00000000..f6c580bc --- /dev/null +++ b/packages/binutils/2.40/0002-MinGW-w64-winpthreads-doesn-t-have-pthread_mutexattr.patch @@ -0,0 +1,21 @@ +From a2b138ef038df238dcaedda15c47f047f5d96e53 Mon Sep 17 00:00:00 2001 +From: Chris Packham <judge.packham@gmail.com> +Date: Mon, 8 Aug 2022 20:37:03 +1200 +Subject: [PATCH] MinGW w64 winpthreads doesn't have + pthread_mutexattr_settype + +--- + gold/gold-threads.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/gold/gold-threads.cc ++++ b/gold/gold-threads.cc +@@ -101,7 +101,7 @@ + int err = pthread_mutexattr_init(&attr); + if (err != 0) + gold_fatal(_("pthead_mutexattr_init failed: %s"), strerror(err)); +-#ifdef PTHREAD_MUTEX_ADAPTIVE_NP ++#if defined(PTHREAD_MUTEX_ADAPTIVE_NP) && !defined(_WIN32) + err = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ADAPTIVE_NP); + if (err != 0) + gold_fatal(_("pthread_mutexattr_settype failed: %s"), strerror(err)); diff --git a/packages/binutils/2.40/0003-Don-t-link-to-libfl-as-it-s-unnecessary.patch b/packages/binutils/2.40/0003-Don-t-link-to-libfl-as-it-s-unnecessary.patch new file mode 100644 index 00000000..f31d21c8 --- /dev/null +++ b/packages/binutils/2.40/0003-Don-t-link-to-libfl-as-it-s-unnecessary.patch @@ -0,0 +1,110 @@ +From 5b3a08b2835a91742b9f0ab3fa52eceec0b342af Mon Sep 17 00:00:00 2001 +From: Chris Packham <judge.packham@gmail.com> +Date: Mon, 8 Aug 2022 20:37:24 +1200 +Subject: [PATCH] Don't link to libfl as it's unnecessary + +--- + binutils/configure | 3 +++ + binutils/configure.ac | 3 +++ + gas/configure | 3 +++ + gas/configure.ac | 3 +++ + ld/configure | 3 +++ + ld/configure.ac | 3 +++ + 6 files changed, 18 insertions(+) + +--- a/binutils/configure ++++ b/binutils/configure +@@ -12159,6 +12159,7 @@ + done + test -n "$YACC" || YACC="yacc" + ++save_LIBS=$LIBS + for ac_prog in flex lex + do + # Extract the first word of "$ac_prog", so it can be a program name with args. +@@ -12322,6 +12323,8 @@ + if test "$LEX" = :; then + LEX=${am_missing_run}flex + fi ++LIBS=$save_LIBS ++LEXLIB= + + ALL_LINGUAS="bg ca da es fi fr hr id it ja pt ro ru rw sk sr sv tr uk vi zh_CN zh_TW" + # If we haven't got the data from the intl directory, +--- a/binutils/configure.ac ++++ b/binutils/configure.ac +@@ -152,7 +152,10 @@ + fi + + AC_PROG_YACC ++save_LIBS=$LIBS + AM_PROG_LEX ++LIBS=$save_LIBS ++LEXLIB= + + ALL_LINGUAS="bg ca da es fi fr hr id it ja pt ro ru rw sk sr sv tr uk vi zh_CN zh_TW" + ZW_GNU_GETTEXT_SISTER_DIR +--- a/gas/configure ++++ b/gas/configure +@@ -12989,6 +12989,7 @@ + done + test -n "$YACC" || YACC="yacc" + ++save_LIBS=$LIBS + for ac_prog in flex lex + do + # Extract the first word of "$ac_prog", so it can be a program name with args. +@@ -13152,6 +13153,8 @@ + if test "$LEX" = :; then + LEX=${am_missing_run}flex + fi ++LIBS=$save_LIBS ++LEXLIB= + + ALL_LINGUAS="es fi fr id ja ru rw sv tr uk zh_CN" + # If we haven't got the data from the intl directory, +--- a/gas/configure.ac ++++ b/gas/configure.ac +@@ -945,7 +945,10 @@ + AC_DEFINE_UNQUOTED(TARGET_OS, "${target_os}", [Target OS.]) + + AC_PROG_YACC ++save_LIBS=$LIBS + AM_PROG_LEX ++LIBS=$save_LIBS ++LEXLIB= + + ALL_LINGUAS="es fi fr id ja ru rw sv tr uk zh_CN" + ZW_GNU_GETTEXT_SISTER_DIR +--- a/ld/configure ++++ b/ld/configure +@@ -16478,6 +16478,7 @@ + done + test -n "$YACC" || YACC="yacc" + ++save_LIBS=$LIBS + for ac_prog in flex lex + do + # Extract the first word of "$ac_prog", so it can be a program name with args. +@@ -16641,6 +16642,8 @@ + if test "$LEX" = :; then + LEX=${am_missing_run}flex + fi ++LIBS=$save_LIBS ++LEXLIB= + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 +--- a/ld/configure.ac ++++ b/ld/configure.ac +@@ -347,7 +347,10 @@ + AC_EXEEXT + + AC_PROG_YACC ++save_LIBS=$LIBS + AM_PROG_LEX ++LIBS=$save_LIBS ++LEXLIB= + + AM_MAINTAINER_MODE + AM_CONDITIONAL(GENINSRC_NEVER, false) diff --git a/packages/binutils/2.40/0004-Darwin-gold-binary-cc-include-string-not-cstring.patch b/packages/binutils/2.40/0004-Darwin-gold-binary-cc-include-string-not-cstring.patch new file mode 100644 index 00000000..6b93144a --- /dev/null +++ b/packages/binutils/2.40/0004-Darwin-gold-binary-cc-include-string-not-cstring.patch @@ -0,0 +1,20 @@ +From 5437b55508908fc26e8757007206a69160c382a9 Mon Sep 17 00:00:00 2001 +From: Chris Packham <judge.packham@gmail.com> +Date: Mon, 8 Aug 2022 20:37:47 +1200 +Subject: [PATCH] Darwin gold binary cc include string not cstring + +--- + gold/binary.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/gold/binary.cc ++++ b/gold/binary.cc +@@ -23,7 +23,7 @@ + #include "gold.h" + + #include <cerrno> +-#include <cstring> ++#include <string> + + #include "elfcpp.h" + #include "stringpool.h" diff --git a/packages/binutils/2.40/0005-Fix-darwin-build.patch b/packages/binutils/2.40/0005-Fix-darwin-build.patch new file mode 100644 index 00000000..84ef726f --- /dev/null +++ b/packages/binutils/2.40/0005-Fix-darwin-build.patch @@ -0,0 +1,70 @@ +From 3a39115dbbfe31b013d033191fb637e8f76288a8 Mon Sep 17 00:00:00 2001 +From: Andrew Hsieh <andrewhsieh@google.com> +Date: Wed, 18 Mar 2015 10:57:24 +0800 +Subject: [PATCH] Fix darwin build + +1. In Drawin PTHREAD_ONCE_INIT is {0x30B1BCBA, {0}} and the GCC < 4.4 + doesn't support ended initializer list +2. wcsncasecmp doesn't exist in MacSDK10.6.x + +Change-Id: I69204a72f853f5263dffedc448379d75ed4eca2e +--- + bfd/peXXigen.c | 22 ++++++++++++++++++++++ + gold/gold-threads.cc | 15 ++++++++++++--- + 2 files changed, 34 insertions(+), 3 deletions(-) + +--- a/bfd/peXXigen.c ++++ b/bfd/peXXigen.c +@@ -3647,6 +3647,28 @@ + } + #endif /* not Cygwin/Mingw */ + ++#if defined __APPLE__ && __DARWIN_C_LEVEL < 200809L ++/* wcsncasecmp isn't always defined in Mac SDK */ ++static int ++wcsncasecmp(const wchar_t *s1, const wchar_t *s2, size_t n) ++{ ++ wchar_t c1, c2; ++ ++ if (n == 0) ++ return (0); ++ for (; *s1; s1++, s2++) ++ { ++ c1 = towlower(*s1); ++ c2 = towlower(*s2); ++ if (c1 != c2) ++ return ((int)c1 - c2); ++ if (--n == 0) ++ return (0); ++ } ++ return (-*s2); ++} ++#endif ++ + /* Perform a comparison of two entries. */ + static signed int + rsrc_cmp (bool is_name, rsrc_entry * a, rsrc_entry * b) +--- a/gold/gold-threads.cc ++++ b/gold/gold-threads.cc +@@ -284,9 +284,18 @@ + class Once_initialize + { + public: +- Once_initialize() +- : once_(PTHREAD_ONCE_INIT) +- { } ++ Once_initialize() ++#if !defined(__APPLE__) ++ : once_(PTHREAD_ONCE_INIT) ++ { } ++#else ++// In Drawin PTHREAD_ONCE_INIT is {0x30B1BCBA, {0}} and the GCC < 4.4 doesn't support ++// extended initializer list as above */ ++ { ++ pthread_once_t once_2 = PTHREAD_ONCE_INIT; ++ once_ = once_2; ++ } ++#endif + + // Return a pointer to the pthread_once_t variable. + pthread_once_t* diff --git a/packages/binutils/2.40/0006-sysroot.patch b/packages/binutils/2.40/0006-sysroot.patch new file mode 100644 index 00000000..93e39d41 --- /dev/null +++ b/packages/binutils/2.40/0006-sysroot.patch @@ -0,0 +1,45 @@ +From e008d409dcffed0a46ae4fb94c6975b3e60656cc Mon Sep 17 00:00:00 2001 +From: Sven Rebhan <odinshorse@googlemail.com> +Date: Mon, 8 Aug 2022 20:46:29 +1200 +Subject: [PATCH] sysroot + +Always try to prepend the sysroot prefix to absolute filenames first. + +http://bugs.gentoo.org/275666 +http://sourceware.org/bugzilla/show_bug.cgi?id=10340 + +Signed-off-by: Sven Rebhan <odinshorse@googlemail.com> +--- + ld/ldfile.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +--- a/ld/ldfile.c ++++ b/ld/ldfile.c +@@ -340,18 +340,25 @@ + directory first. */ + if (!entry->flags.maybe_archive) + { +- if (entry->flags.sysrooted && IS_ABSOLUTE_PATH (entry->filename)) ++ /* For absolute pathnames, try to always open the file in the ++ sysroot first. If this fails, try to open the file at the ++ given location. */ ++ entry->flags.sysrooted = is_sysrooted_pathname (entry->filename); ++ if (!entry->flags.sysrooted && IS_ABSOLUTE_PATH (entry->filename) ++ && ld_sysroot) + { + char *name = concat (ld_sysroot, entry->filename, + (const char *) NULL); + if (ldfile_try_open_bfd (name, entry)) + { + entry->filename = name; ++ entry->flags.sysrooted = true; + return true; + } + free (name); + } +- else if (ldfile_try_open_bfd (entry->filename, entry)) ++ ++ if (ldfile_try_open_bfd (entry->filename, entry)) + return true; + + if (IS_ABSOLUTE_PATH (entry->filename)) diff --git a/packages/binutils/2.40/0007-poison-system-directories.patch b/packages/binutils/2.40/0007-poison-system-directories.patch new file mode 100644 index 00000000..a7299a20 --- /dev/null +++ b/packages/binutils/2.40/0007-poison-system-directories.patch @@ -0,0 +1,283 @@ +From bc4775985c053b5eb9c5f0cea53ba74376ad1ac3 Mon Sep 17 00:00:00 2001 +From: Scott Garman <scott.a.garman@intel.com> +Date: Mon, 8 Aug 2022 20:48:32 +1200 +Subject: [PATCH] poison system directories + +Patch adapted to binutils 2.23.2 and extended to use +BR_COMPILER_PARANOID_UNSAFE_PATH by Thomas Petazzoni. + +[Gustavo: adapt to binutils 2.25] +Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> +Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> + +Upstream-Status: Inappropriate [distribution: codesourcery] + +Patch originally created by Mark Hatle, forward-ported to +binutils 2.21 by Scott Garman. + +purpose: warn for uses of system directories when cross linking + +Code Merged from Sourcery G++ binutils 2.19 - 4.4-277 + +2008-07-02 Joseph Myers <joseph@codesourcery.com> + + ld/ + * ld.h (args_type): Add error_poison_system_directories. + * ld.texinfo (--error-poison-system-directories): Document. + * ldfile.c (ldfile_add_library_path): Check + command_line.error_poison_system_directories. + * ldmain.c (main): Initialize + command_line.error_poison_system_directories. + * lexsup.c (enum option_values): Add + OPTION_ERROR_POISON_SYSTEM_DIRECTORIES. + (ld_options): Add --error-poison-system-directories. + (parse_args): Handle new option. + +2007-06-13 Joseph Myers <joseph@codesourcery.com> + + ld/ + * config.in: Regenerate. + * ld.h (args_type): Add poison_system_directories. + * ld.texinfo (--no-poison-system-directories): Document. + * ldfile.c (ldfile_add_library_path): Check + command_line.poison_system_directories. + * ldmain.c (main): Initialize + command_line.poison_system_directories. + * lexsup.c (enum option_values): Add + OPTION_NO_POISON_SYSTEM_DIRECTORIES. + (ld_options): Add --no-poison-system-directories. + (parse_args): Handle new option. + +2007-04-20 Joseph Myers <joseph@codesourcery.com> + + Merge from Sourcery G++ binutils 2.17: + + 2007-03-20 Joseph Myers <joseph@codesourcery.com> + Based on patch by Mark Hatle <mark.hatle@windriver.com>. + ld/ + * configure.ac (--enable-poison-system-directories): New option. + * configure, config.in: Regenerate. + * ldfile.c (ldfile_add_library_path): If + ENABLE_POISON_SYSTEM_DIRECTORIES defined, warn for use of /lib, + /usr/lib, /usr/local/lib or /usr/X11R6/lib. + +Signed-off-by: Mark Hatle <mark.hatle@windriver.com> +Signed-off-by: Scott Garman <scott.a.garman@intel.com> +--- + ld/config.in | 3 +++ + ld/configure | 14 ++++++++++++++ + ld/configure.ac | 10 ++++++++++ + ld/ld.h | 8 ++++++++ + ld/ld.texi | 12 ++++++++++++ + ld/ldfile.c | 17 +++++++++++++++++ + ld/ldlex.h | 2 ++ + ld/ldmain.c | 2 ++ + ld/lexsup.c | 21 +++++++++++++++++++++ + 9 files changed, 89 insertions(+) + +--- a/ld/config.in ++++ b/ld/config.in +@@ -58,6 +58,9 @@ + language is requested. */ + #undef ENABLE_NLS + ++/* Define to warn for use of native system library directories */ ++#undef ENABLE_POISON_SYSTEM_DIRECTORIES ++ + /* Additional extension a shared object might have. */ + #undef EXTRA_SHLIB_EXTENSION + +--- a/ld/configure ++++ b/ld/configure +@@ -839,6 +839,7 @@ + enable_targets + enable_64_bit_bfd + with_sysroot ++enable_poison_system_directories + enable_gold + enable_got + enable_compressed_debug_sections +@@ -1521,6 +1522,8 @@ + --enable-checking enable run-time checks + --enable-targets alternative target configurations + --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes) ++ --enable-poison-system-directories ++ warn for use of native system library directories + --enable-gold[=ARG] build gold [ARG={default,yes,no}] + --enable-got=<type> GOT handling scheme (target, single, negative, + multigot) +@@ -15504,7 +15507,18 @@ + fi + + ++# Check whether --enable-poison-system-directories was given. ++if test "${enable_poison_system_directories+set}" = set; then : ++ enableval=$enable_poison_system_directories; ++else ++ enable_poison_system_directories=no ++fi ++ ++if test "x${enable_poison_system_directories}" = "xyes"; then + ++$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h ++ ++fi + + # Check whether --enable-got was given. + if test "${enable_got+set}" = set; then : +--- a/ld/configure.ac ++++ b/ld/configure.ac +@@ -103,6 +103,16 @@ + AC_SUBST(TARGET_SYSTEM_ROOT) + AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE) + ++AC_ARG_ENABLE([poison-system-directories], ++ AS_HELP_STRING([--enable-poison-system-directories], ++ [warn for use of native system library directories]),, ++ [enable_poison_system_directories=no]) ++if test "x${enable_poison_system_directories}" = "xyes"; then ++ AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES], ++ [1], ++ [Define to warn for use of native system library directories]) ++fi ++ + dnl Use --enable-gold to decide if this linker should be the default. + dnl "install_as_default" is set to false if gold is the default linker. + dnl "installed_linker" is the installed BFD linker name. +--- a/ld/ld.h ++++ b/ld/ld.h +@@ -158,6 +158,14 @@ + /* If set, display the target memory usage (per memory region). */ + bool print_memory_usage; + ++ /* If TRUE (the default) warn for uses of system directories when ++ cross linking. */ ++ bool poison_system_directories; ++ ++ /* If TRUE (default FALSE) give an error for uses of system ++ directories when cross linking instead of a warning. */ ++ bool error_poison_system_directories; ++ + /* Should we force section groups to be resolved? Controlled with + --force-group-allocation on the command line or FORCE_GROUP_ALLOCATION + in the linker script. */ +--- a/ld/ld.texi ++++ b/ld/ld.texi +@@ -2960,6 +2960,18 @@ + occurrence of the --package-metdata option. + If the linker has been built with libjansson, then the JSON string + will be validated. ++ ++@kindex --no-poison-system-directories ++@item --no-poison-system-directories ++Do not warn for @option{-L} options using system directories such as ++@file{/usr/lib} when cross linking. This option is intended for use ++in chroot environments when such directories contain the correct ++libraries for the target system rather than the host. ++ ++@kindex --error-poison-system-directories ++@item --error-poison-system-directories ++Give an error instead of a warning for @option{-L} options using ++system directories when cross linking. + @end table + + @c man end +--- a/ld/ldfile.c ++++ b/ld/ldfile.c +@@ -117,6 +117,23 @@ + new_dirs->name = concat (ld_sysroot, name + strlen ("$SYSROOT"), (const char *) NULL); + else + new_dirs->name = xstrdup (name); ++ ++#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES ++ if (command_line.poison_system_directories ++ && ((!strncmp (name, "/lib", 4)) ++ || (!strncmp (name, "/usr/lib", 8)) ++ || (!strncmp (name, "/usr/local/lib", 14)) ++ || (!strncmp (name, "/usr/X11R6/lib", 14)))) ++ { ++ if (command_line.error_poison_system_directories) ++ einfo (_("%X%P: error: library search path \"%s\" is unsafe for " ++ "cross-compilation\n"), name); ++ else ++ einfo (_("%P: warning: library search path \"%s\" is unsafe for " ++ "cross-compilation\n"), name); ++ } ++#endif ++ + } + + /* Try to open a BFD for a lang_input_statement. */ +--- a/ld/ldlex.h ++++ b/ld/ldlex.h +@@ -170,6 +170,8 @@ + OPTION_NO_WARN_EXECSTACK, + OPTION_WARN_RWX_SEGMENTS, + OPTION_NO_WARN_RWX_SEGMENTS, ++ OPTION_NO_POISON_SYSTEM_DIRECTORIES, ++ OPTION_ERROR_POISON_SYSTEM_DIRECTORIES, + }; + + /* The initial parser states. */ +--- a/ld/ldmain.c ++++ b/ld/ldmain.c +@@ -321,6 +321,8 @@ + command_line.warn_mismatch = true; + command_line.warn_search_mismatch = true; + command_line.check_section_addresses = -1; ++ command_line.poison_system_directories = true; ++ command_line.error_poison_system_directories = true; + + /* We initialize DEMANGLING based on the environment variable + COLLECT_NO_DEMANGLE. The gcc collect2 program will demangle the +--- a/ld/lexsup.c ++++ b/ld/lexsup.c +@@ -613,6 +613,14 @@ + " <method> is: share-unconflicted (default),\n" + " share-duplicated"), + TWO_DASHES }, ++ { {"no-poison-system-directories", no_argument, NULL, ++ OPTION_NO_POISON_SYSTEM_DIRECTORIES}, ++ '\0', NULL, N_("Do not warn for -L options using system directories"), ++ TWO_DASHES }, ++ { {"error-poison-system-directories", no_argument, NULL, ++ OPTION_ERROR_POISON_SYSTEM_DIRECTORIES}, ++ '\0', NULL, N_("Give an error for -L options using system directories"), ++ TWO_DASHES }, + }; + + #define OPTION_COUNT ARRAY_SIZE (ld_options) +@@ -625,6 +633,7 @@ + int ingroup = 0; + char *default_dirlist = NULL; + char *shortopts; ++ char *BR_paranoid_env; + struct option *longopts; + struct option *really_longopts; + int last_optind; +@@ -1692,6 +1701,14 @@ + } + break; + ++ case OPTION_NO_POISON_SYSTEM_DIRECTORIES: ++ command_line.poison_system_directories = false; ++ break; ++ ++ case OPTION_ERROR_POISON_SYSTEM_DIRECTORIES: ++ command_line.error_poison_system_directories = true; ++ break; ++ + case OPTION_PUSH_STATE: + input_flags.pushed = xmemdup (&input_flags, + sizeof (input_flags), +@@ -1837,6 +1854,10 @@ + command_line.soname = NULL; + } + ++ BR_paranoid_env = getenv("BR_COMPILER_PARANOID_UNSAFE_PATH"); ++ if (BR_paranoid_env && strlen(BR_paranoid_env) > 0) ++ command_line.error_poison_system_directories = true; ++ + while (ingroup) + { + einfo (_("%P: missing --end-group; added as last command line option\n")); diff --git a/packages/binutils/2.40/chksum b/packages/binutils/2.40/chksum new file mode 100644 index 00000000..f476829b --- /dev/null +++ b/packages/binutils/2.40/chksum @@ -0,0 +1,12 @@ +md5 binutils-2.40.tar.xz 007b59bd908a737c06e5a8d3d2c737eb +sha1 binutils-2.40.tar.xz fee4fbef9d632afc1988dd631d7f75d4394b7f8d +sha256 binutils-2.40.tar.xz 0f8a4c272d7f17f369ded10a4aca28b8e304828e95526da482b0ccc4dfc9d8e1 +sha512 binutils-2.40.tar.xz a37e042523bc46494d99d5637c3f3d8f9956d9477b748b3b1f6d7dfbb8d968ed52c932e88a4e946c6f77b8f48f1e1b360ca54c3d298f17193f3b4963472f6925 +md5 binutils-2.40.tar.bz2 fe10027c8de77b643ae72bd6de3f7996 +sha1 binutils-2.40.tar.bz2 887d24c3799e9fe02646e04e73b5ac2cc3e7188f +sha256 binutils-2.40.tar.bz2 f8298eb153a4b37d112e945aa5cb2850040bcf26a3ea65b5a715c83afe05e48a +sha512 binutils-2.40.tar.bz2 30256362945184329c994730f60d8493292547e0e5de5f49d57490d8d9b1a0a18393bf7f70934ba5061ee2001ec4cbf5f206d310df9512a7fb3625a362e358f9 +md5 binutils-2.40.tar.gz b200db2cdd2f49019ced4016e1f9bfe7 +sha1 binutils-2.40.tar.gz 51cf8aac159473418688c62ec52f3653d1b8e0a7 +sha256 binutils-2.40.tar.gz d7f82c4047decf43a6f769ac32456a92ddb6932409a585c633cdd4e9df23d956 +sha512 binutils-2.40.tar.gz 2f141fb842f4cf73f1d161a24aac416aa0383d784b67cfe54d79e3b7ab7b932d0717e3a0d12e88babc1e854d83285ad9af26fe97c3ade32b49f20a86849d5b65 diff --git a/packages/linux/4.14.301/version.desc b/packages/binutils/2.40/version.desc index e69de29b..e69de29b 100644 --- a/packages/linux/4.14.301/version.desc +++ b/packages/binutils/2.40/version.desc diff --git a/packages/elf2flt/git-453398f9/0001-elf2flt-Use-PRIx64-instead-of-BFD_VMA_FMT-x.patch b/packages/elf2flt/git-453398f9/0001-elf2flt-Use-PRIx64-instead-of-BFD_VMA_FMT-x.patch new file mode 100644 index 00000000..6836b180 --- /dev/null +++ b/packages/elf2flt/git-453398f9/0001-elf2flt-Use-PRIx64-instead-of-BFD_VMA_FMT-x.patch @@ -0,0 +1,142 @@ +From 50c80021f3351596f75f8dfc06ec45f8a598eb7e Mon Sep 17 00:00:00 2001 +From: Chris Packham <judge.packham@gmail.com> +Date: Mon, 27 Feb 2023 20:47:04 +1300 +Subject: [PATCH] elf2flt: Use PRIx64 instead of BFD_VMA_FMT"x + +As of binutils 2.40 bfd.h no longer defines BFD_VMA_FMT. Use PRIx64 +instead. + +Signed-off-by: Chris Packham <judge.packham@gmail.com> +--- + elf2flt.c | 36 ++++++++++++++++++------------------ + 1 file changed, 18 insertions(+), 18 deletions(-) + +diff --git a/elf2flt.c b/elf2flt.c +index 8dbd9b2..4ec4103 100644 +--- a/elf2flt.c ++++ b/elf2flt.c +@@ -216,7 +216,7 @@ dump_symbols(asymbol **symbol_table, long number_of_symbols) + long i; + printf("SYMBOL TABLE:\n"); + for (i=0; i<number_of_symbols; i++) { +- printf(" NAME=%s VALUE=0x%"BFD_VMA_FMT"x\n", ++ printf(" NAME=%s VALUE=0x%"PRIx64"\n", + symbol_table[i]->name, symbol_table[i]->value); + } + printf("\n"); +@@ -452,7 +452,7 @@ output_relocs ( + if (r == NULL) + continue; + if (verbose) +- printf(" RELOCS: %s [%p]: flags=0x%x vma=0x%"BFD_VMA_FMT"x\n", ++ printf(" RELOCS: %s [%p]: flags=0x%x vma=0x%"PRIx64"\n", + r->name, r, r->flags, elf2flt_bfd_section_vma(abs_bfd, r)); + if ((r->flags & SEC_RELOC) == 0) + continue; +@@ -879,8 +879,8 @@ output_relocs ( + if (verbose) + fprintf(stderr, + "%s vma=0x%x, " +- "value=0x%"BFD_VMA_FMT"x, " +- "address=0x%"BFD_VMA_FMT"x " ++ "value=0x%"PRIx64", " ++ "address=0x%"PRIx64" " + "sym_addr=0x%x rs=0x%x, opcode=0x%x\n", + "ABS32", + sym_vma, (*(q->sym_ptr_ptr))->value, +@@ -898,8 +898,8 @@ output_relocs ( + if (verbose) + fprintf(stderr, + "%s vma=0x%x, " +- "value=0x%"BFD_VMA_FMT"x, " +- "address=0x%"BFD_VMA_FMT"x " ++ "value=0x%"PRIx64", " ++ "address=0x%"PRIx64" " + "sym_addr=0x%x rs=0x%x, opcode=0x%x\n", + "PLT32", + sym_vma, (*(q->sym_ptr_ptr))->value, +@@ -921,7 +921,7 @@ output_relocs ( + case R_V850_ZDA_16_16_OFFSET: + case R_V850_ZDA_16_16_SPLIT_OFFSET: + /* Can't support zero-relocations. */ +- printf ("ERROR: %s+0x%"BFD_VMA_FMT"x: zero relocations not supported\n", ++ printf ("ERROR: %s+0x%"PRIx64": zero relocations not supported\n", + sym_name, q->addend); + continue; + #endif /* TARGET_v850 */ +@@ -1014,15 +1014,15 @@ output_relocs ( + sprintf(&addstr[0], "+0x%ld", sym_addr - (*(q->sym_ptr_ptr))->value - + elf2flt_bfd_section_vma(abs_bfd, sym_section)); + if (verbose) +- printf(" RELOC[%d]: offset=0x%"BFD_VMA_FMT"x symbol=%s%s " ++ printf(" RELOC[%d]: offset=0x%"PRIx64" symbol=%s%s " + "section=%s size=%d " +- "fixup=0x%x (reloc=0x%"BFD_VMA_FMT"x)\n", ++ "fixup=0x%x (reloc=0x%"PRIx64")\n", + flat_reloc_count, + q->address, sym_name, addstr, + section_name, sym_reloc_size, + sym_addr, section_vma + q->address); + if (verbose) +- printf("reloc[%d] = 0x%"BFD_VMA_FMT"x\n", ++ printf("reloc[%d] = 0x%"PRIx64"\n", + flat_reloc_count, section_vma + q->address); + + continue; +@@ -1139,9 +1139,9 @@ output_relocs ( + temp |= (exist_val & 0x3f); + *(unsigned long *)r_mem = htoniosl(temp); + if (verbose) +- printf("omit: offset=0x%"BFD_VMA_FMT"x symbol=%s%s " ++ printf("omit: offset=0x%"PRIx64" symbol=%s%s " + "section=%s size=%d " +- "fixup=0x%x (reloc=0x%"BFD_VMA_FMT"x) GPREL\n", ++ "fixup=0x%x (reloc=0x%"PRIx64") GPREL\n", + q->address, sym_name, addstr, + section_name, sym_reloc_size, + sym_addr, section_vma + q->address); +@@ -1159,9 +1159,9 @@ output_relocs ( + exist_val |= ((sym_addr & 0xFFFF) << 6); + *(unsigned long *)r_mem = htoniosl(exist_val); + if (verbose) +- printf("omit: offset=0x%"BFD_VMA_FMT"x symbol=%s%s " ++ printf("omit: offset=0x%"PRIx64" symbol=%s%s " + "section=%s size=%d " +- "fixup=0x%x (reloc=0x%"BFD_VMA_FMT"x) PCREL\n", ++ "fixup=0x%x (reloc=0x%"PRIx64") PCREL\n", + q->address, sym_name, addstr, + section_name, sym_reloc_size, + sym_addr, section_vma + q->address); +@@ -1176,7 +1176,7 @@ output_relocs ( + && (p[-1]->sym_ptr_ptr == p[0]->sym_ptr_ptr) + && (p[-1]->addend == p[0]->addend)) { + if (verbose) +- printf("omit: offset=0x%"BFD_VMA_FMT"x symbol=%s%s " ++ printf("omit: offset=0x%"PRIx64" symbol=%s%s " + "section=%s size=%d LO16\n", + q->address, sym_name, addstr, + section_name, sym_reloc_size); +@@ -1586,9 +1586,9 @@ DIS29_RELOCATION: + } + + if (verbose) +- printf(" RELOC[%d]: offset=0x%"BFD_VMA_FMT"x symbol=%s%s " ++ printf(" RELOC[%d]: offset=0x%"PRIx64" symbol=%s%s " + "section=%s size=%d " +- "fixup=0x%x (reloc=0x%"BFD_VMA_FMT"x)\n", ++ "fixup=0x%x (reloc=0x%"PRIx64")\n", + flat_reloc_count, + q->address, sym_name, addstr, + section_name, sym_reloc_size, +@@ -1606,7 +1606,7 @@ DIS29_RELOCATION: + (section_vma + q->address); + + if (verbose) +- printf("reloc[%d] = 0x%"BFD_VMA_FMT"x\n", ++ printf("reloc[%d] = 0x%"PRIx64"\n", + flat_reloc_count, section_vma + q->address); + #else + switch ((*p)->howto->type) { +-- +2.39.1 + diff --git a/packages/gcc/12.2.0/0005-Allow-default-libc-to-be-specified-to-configure.patch b/packages/gcc/12.2.0/0005-Allow-default-libc-to-be-specified-to-configure.patch new file mode 100644 index 00000000..4f155f61 --- /dev/null +++ b/packages/gcc/12.2.0/0005-Allow-default-libc-to-be-specified-to-configure.patch @@ -0,0 +1,141 @@ +From e55524baedbf2dc94b5159373c2b71049bdde1a8 Mon Sep 17 00:00:00 2001 +From: Keith Packard <keithp@keithp.com> +Date: Fri, 2 Sep 2022 23:07:05 -0700 +Subject: [PATCH 5/9] Allow default libc to be specified to configure + +The default C library is normally computed based on the target +triplet. However, for embedded systems, it can be useful to leave the +triplet alone while changing which C library is used by default. Other +C libraries may still be available on the system so the compiler and +can be used by specifying suitable include and library paths at build +time. + +If an unknown --with-default-libc= value is provided, emit an error +and stop. + +Signed-off-by: Keith Packard <keithp@keithp.com> +--- + gcc/config.gcc | 48 ++++++++++++++++++++++++++++++++++++++++-------- + gcc/configure.ac | 4 ++++ + 2 files changed, 44 insertions(+), 8 deletions(-) + +diff --git a/gcc/config.gcc b/gcc/config.gcc +index c5064dd3766..ddab68fbf8f 100644 +--- a/gcc/config.gcc ++++ b/gcc/config.gcc +@@ -648,6 +648,8 @@ esac + # Common C libraries. + tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4" + ++default_libc="" ++ + # 32-bit x86 processors supported by --with-arch=. Each processor + # MUST be separated by exactly one space. + x86_archs="athlon athlon-4 athlon-fx athlon-mp athlon-tbird \ +@@ -854,16 +856,16 @@ case ${target} in + esac + case $target in + *-*-*android*) +- tm_defines="$tm_defines DEFAULT_LIBC=LIBC_BIONIC" ++ default_libc=LIBC_BIONIC + ;; + *-*-*uclibc* | *-*-uclinuxfdpiceabi) +- tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC" ++ default_libc=LIBC_UCLIBC + ;; + *-*-*musl*) +- tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL" ++ default_libc=LIBC_MUSL + ;; + *) +- tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC" ++ default_libc=LIBC_GLIBC + ;; + esac + # Assume that glibc or uClibc or Bionic are being used and so __cxa_atexit +@@ -956,7 +958,8 @@ case ${target} in + case ${enable_threads} in + "" | yes | posix) thread_file='posix' ;; + esac +- tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC SINGLE_LIBC" ++ tm_defines="$tm_defines SINGLE_LIBC" ++ default_libc=LIBC_UCLIBC + ;; + *-*-rdos*) + use_gcc_stdint=wrap +@@ -1606,13 +1609,13 @@ csky-*-*) + + case ${target} in + csky-*-linux-gnu*) +- tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC" ++ default_libc=LIBC_GLIBC + # Force .init_array support. The configure script cannot always + # automatically detect that GAS supports it, yet we require it. + gcc_cv_initfini_array=yes + ;; + csky-*-linux-uclibc*) +- tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC" ++ default_libc=LIBC_UCLIBC + default_use_cxa_atexit=no + ;; + *) +@@ -3065,7 +3068,7 @@ powerpc*-wrs-vxworks7r*) + tmake_file="${tmake_file} t-linux rs6000/t-linux64 rs6000/t-fprules rs6000/t-ppccomm" + tmake_file="${tmake_file} rs6000/t-vxworks" + +- tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC" ++ default_libc=LIBC_GLIBC + extra_objs="$extra_objs linux.o rs6000-linux.o" + ;; + powerpc-wrs-vxworks*) +@@ -5915,3 +5918,32 @@ i[34567]86-*-* | x86_64-*-*) + fi + ;; + esac ++ ++case "${with_default_libc}" in ++glibc) ++ default_libc=LIBC_GLIBC ++ ;; ++uclibc) ++ default_libc=LIBC_UCLIBC ++ ;; ++bionic) ++ default_libc=LIBC_BIONIC ++ ;; ++musl) ++ default_libc=LIBC_MUSL ++ ;; ++"") ++ ;; ++*) ++ echo "Unknown libc in --with-default-libc=$with_default_libc" 1>&2 ++ exit 1 ++ ;; ++esac ++ ++case "$default_libc" in ++"") ++ ;; ++*) ++ tm_defines="$tm_defines DEFAULT_LIBC=$default_libc" ++ ;; ++esac +diff --git a/gcc/configure.ac b/gcc/configure.ac +index 23bee7010a3..4fd41993b58 100644 +--- a/gcc/configure.ac ++++ b/gcc/configure.ac +@@ -2481,6 +2481,10 @@ if { { test x$host != x$target && test "x$with_sysroot" = x ; } || + fi + AC_SUBST(inhibit_libc) + ++AC_ARG_WITH(default-libc, ++ [AS_HELP_STRING([--with-default-libc], ++ [Use specified default C library])]) ++ + # When building gcc with a cross-compiler, we need to adjust things so + # that the generator programs are still built with the native compiler. + # Also, we cannot run fixincludes. +-- +2.39.0 + diff --git a/packages/gcc/12.2.0/0006-Add-newlib-and-picolibc-as-default-C-library-choices.patch b/packages/gcc/12.2.0/0006-Add-newlib-and-picolibc-as-default-C-library-choices.patch new file mode 100644 index 00000000..e4805ae8 --- /dev/null +++ b/packages/gcc/12.2.0/0006-Add-newlib-and-picolibc-as-default-C-library-choices.patch @@ -0,0 +1,42 @@ +From 2e3918a283c1c9fb3b4775fe96a56e430748579a Mon Sep 17 00:00:00 2001 +From: Keith Packard <keithp@keithp.com> +Date: Tue, 23 Aug 2022 22:12:06 -0700 +Subject: [PATCH 6/9] Add newlib and picolibc as default C library choices + +Signed-off-by: Keith Packard <keithp@keithp.com> +--- + gcc/config.gcc | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/gcc/config.gcc b/gcc/config.gcc +index ddab68fbf8f..e294ff8fbc8 100644 +--- a/gcc/config.gcc ++++ b/gcc/config.gcc +@@ -646,7 +646,7 @@ case ${target} in + esac + + # Common C libraries. +-tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4" ++tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4 LIBC_NEWLIB=5 LIBC_PICOLIBC=6" + + default_libc="" + +@@ -5932,6 +5932,15 @@ bionic) + musl) + default_libc=LIBC_MUSL + ;; ++newlib) ++ # Newlib configurations don't set the DEFAULT_LIBC variable, so ++ # avoid changing those by allowing --with-default-libc=newlib but ++ # not actually setting the DEFAULT_LIBC variable. ++ default_libc= ++ ;; ++picolibc) ++ default_libc=LIBC_PICOLIBC ++ ;; + "") + ;; + *) +-- +2.39.0 + diff --git a/packages/gcc/12.2.0/0007-Support-picolibc-targets.patch b/packages/gcc/12.2.0/0007-Support-picolibc-targets.patch new file mode 100644 index 00000000..01dbba87 --- /dev/null +++ b/packages/gcc/12.2.0/0007-Support-picolibc-targets.patch @@ -0,0 +1,38 @@ +From 41b20e994970f0ae63fb3f49c6f89a0b2f06aecb Mon Sep 17 00:00:00 2001 +From: Keith Packard <keithp@keithp.com> +Date: Sun, 12 Feb 2023 14:23:32 -0800 +Subject: [PATCH 7/9] Support picolibc targets + +Match *-picolibc-* and select picolibc as the default C library, plus continuing to use +the newlib-based logic for other configuration items. + +Signed-off-by: Keith Packard <keithp@keithp.com> +--- + gcc/config.gcc | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/gcc/config.gcc b/gcc/config.gcc +index e294ff8fbc8..06af4057079 100644 +--- a/gcc/config.gcc ++++ b/gcc/config.gcc +@@ -1082,6 +1082,17 @@ case ${target} in + ;; + esac + ;; ++*-picolibc-*) ++ # __cxa_atexit is provided. ++ default_use_cxa_atexit=yes ++ use_gcc_stdint=wrap ++ default_libc=LIBC_PICOLIBC ++ case "${with_newlib}-${with_headers}" in ++ no-no) use_gcc_stdint=provide ;; ++ *) ;; ++ esac ++ ;; ++ + *-*-elf|arc*-*-elf*) + # Assume that newlib is being used and so __cxa_atexit is provided. + default_use_cxa_atexit=yes +-- +2.39.0 + diff --git a/packages/gcc/12.2.0/0008-gcc-Allow-g-to-work-differently-from-gcc.patch b/packages/gcc/12.2.0/0008-gcc-Allow-g-to-work-differently-from-gcc.patch new file mode 100644 index 00000000..d84e52f3 --- /dev/null +++ b/packages/gcc/12.2.0/0008-gcc-Allow-g-to-work-differently-from-gcc.patch @@ -0,0 +1,68 @@ +From e426a20988185695675a2c456e0c24dcea515baf Mon Sep 17 00:00:00 2001 +From: Keith Packard <keithp@keithp.com> +Date: Sat, 11 Feb 2023 23:07:08 -0800 +Subject: [PATCH 8/9] gcc: Allow g++ to work differently from gcc + +Compile gcc.cc with -DIN_GPP defined when building g++ so that the +code can respond appropriately for the default target language. This +allows the driver to customize the specs used, selecting different +linker scripts, adjusting the use of crtbegin.o/crtend.o etc. + +By default, this change has no effect; targets need to explicitly +check for IN_GPP to have alternate behavior. + +Signed-off-by: Keith Packard <keithp@keithp.com> +--- + gcc/cp/Make-lang.in | 7 ++++++- + gcc/gpp.cc | 21 +++++++++++++++++++++ + 2 files changed, 27 insertions(+), 1 deletion(-) + create mode 100644 gcc/gpp.cc + +diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in +index 2de4e47c659..39c659b9537 100644 +--- a/gcc/cp/Make-lang.in ++++ b/gcc/cp/Make-lang.in +@@ -68,7 +68,12 @@ CFLAGS-cp/module.o += -DMODULE_VERSION='($(subst -,,$(MODULE_VERSION))U)' + endif + + # Create the compiler driver for g++. +-GXX_OBJS = $(GCC_OBJS) cp/g++spec.o ++GXX_OBJS = $(GCC_OBJS:gcc.o=gpp.o) cp/g++spec.o ++ ++CFLAGS-gpp.o = $(CFLAGS-gcc.o) ++gpp.o: $(BASEVER) ++gpp.o: gcc.o ++ + xg++$(exeext): $(GXX_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a $(LIBDEPS) + +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \ + $(GXX_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a \ +diff --git a/gcc/gpp.cc b/gcc/gpp.cc +new file mode 100644 +index 00000000000..3cd7b45e808 +--- /dev/null ++++ b/gcc/gpp.cc +@@ -0,0 +1,21 @@ ++/* Compiler driver program that can handle many languages. ++ Copyright (C) 1987-2022 Free Software Foundation, Inc. ++ ++This file is part of GCC. ++ ++GCC is free software; you can redistribute it and/or modify it under ++the terms of the GNU General Public License as published by the Free ++Software Foundation; either version 3, or (at your option) any later ++version. ++ ++GCC is distributed in the hope that it will be useful, but WITHOUT ANY ++WARRANTY; without even the implied warranty of MERCHANTABILITY or ++FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++for more details. ++ ++You should have received a copy of the GNU General Public License ++along with GCC; see the file COPYING3. If not see ++<http://www.gnu.org/licenses/>. */ ++ ++#define IN_GPP ++#include "gcc.cc" +-- +2.39.0 + diff --git a/packages/gcc/12.2.0/0009-picolibc-Add-custom-spec-file-fragments-for-using-pi.patch b/packages/gcc/12.2.0/0009-picolibc-Add-custom-spec-file-fragments-for-using-pi.patch new file mode 100644 index 00000000..0c4b90b5 --- /dev/null +++ b/packages/gcc/12.2.0/0009-picolibc-Add-custom-spec-file-fragments-for-using-pi.patch @@ -0,0 +1,138 @@ +From ad485aba918ea651987c6d153c2202a3efb5a75f Mon Sep 17 00:00:00 2001 +From: Keith Packard <keithp@keithp.com> +Date: Tue, 23 Aug 2022 22:13:08 -0700 +Subject: [PATCH 9/9] picolibc: Add custom spec file fragments for using + picolibc + +The '--oslib=' option allows targets to insert an OS library after the +C library in the LIB_PATH spec file fragment. This library maps a few +POSIX APIs used by picolibc to underlying system capabilities. + +The '--crt0=' option allows targets to use an alternate crt0 in place +of the usual one as provided by Picolibc. + +For example, picolibc provides 'libsemihost' and 'crt0-semihost.o' on +various targets which maps some POSIX APIs to semihosting capabilities +and signals the semihosting environment when 'main' returns. These +would be used by specifying --oslib=semihost --crt0=semihost. + +This patch also takes advantage of the IN_GPP conditional when +building g++ to elide exception handling contents from the executable +when not linking with the g++ driver. + +Signed-off-by: Keith Packard <keithp@keithp.com> +--- + gcc/config.gcc | 7 +++++++ + gcc/config/picolibc.h | 44 +++++++++++++++++++++++++++++++++++++++++ + gcc/config/picolibc.opt | 33 +++++++++++++++++++++++++++++++ + 3 files changed, 84 insertions(+) + create mode 100644 gcc/config/picolibc.h + create mode 100644 gcc/config/picolibc.opt + +diff --git a/gcc/config.gcc b/gcc/config.gcc +index 06af4057079..94d53970ceb 100644 +--- a/gcc/config.gcc ++++ b/gcc/config.gcc +@@ -5967,3 +5967,10 @@ case "$default_libc" in + tm_defines="$tm_defines DEFAULT_LIBC=$default_libc" + ;; + esac ++ ++case "$default_libc" in ++ LIBC_PICOLIBC) ++ extra_options="${extra_options} picolibc.opt" ++ tm_file="${tm_file} picolibc.h" ++ ;; ++esac +diff --git a/gcc/config/picolibc.h b/gcc/config/picolibc.h +new file mode 100644 +index 00000000000..d1d3fc44477 +--- /dev/null ++++ b/gcc/config/picolibc.h +@@ -0,0 +1,44 @@ ++/* Configuration common to all targets running Picolibc. ++ Copyright (C) 2023 Free Software Foundation, Inc. ++ ++ This file is part of GCC. ++ ++ GCC is free software; you can redistribute it and/or modify it ++ under the terms of the GNU General Public License as published ++ by the Free Software Foundation; either version 3, or (at your ++ option) any later version. ++ ++ GCC is distributed in the hope that it will be useful, but WITHOUT ++ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ++ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public ++ License for more details. ++ ++ Under Section 7 of GPL version 3, you are granted additional ++ permissions described in the GCC Runtime Library Exception, version ++ 3.1, as published by the Free Software Foundation. ++ ++ You should have received a copy of the GNU General Public License and ++ a copy of the GCC Runtime Library Exception along with this program; ++ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see ++ <http://www.gnu.org/licenses/>. */ ++ ++#ifdef IN_GPP ++#define PICOLIBC_LD "picolibcpp.ld" ++#define PICOLIBC_BEGIN " crtbegin%O%s" ++#define PICOLIBC_END "crtend%O%s" ++#else ++#define PICOLIBC_LD "picolibc.ld" ++#define PICOLIBC_BEGIN "" ++#define PICOLIBC_END "" ++#endif ++ ++#undef LIB_SPEC ++#define LIB_SPEC "%{!T:-T" PICOLIBC_LD "} --start-group -lc %{-oslib=*:-l%*} %(libgcc) --end-group" ++ ++#undef STARTFILE_SPEC ++#define STARTFILE_SPEC "%{-crt0=*:crt0-%*%O%s; :crt0%O%s}" PICOLIBC_BEGIN ++ ++#undef ENDFILE_SPEC ++#define ENDFILE_SPEC PICOLIBC_END ++ ++#define EH_TABLES_CAN_BE_READ_ONLY 1 +diff --git a/gcc/config/picolibc.opt b/gcc/config/picolibc.opt +new file mode 100644 +index 00000000000..39f81c446bb +--- /dev/null ++++ b/gcc/config/picolibc.opt +@@ -0,0 +1,33 @@ ++; Processor-independent options for picolibc. ++; ++; Copyright (C) 2022 Free Software Foundation, Inc. ++; ++; This file is part of GCC. ++; ++; GCC is free software; you can redistribute it and/or modify it under ++; the terms of the GNU General Public License as published by the Free ++; Software Foundation; either version 3, or (at your option) any later ++; version. ++; ++; GCC is distributed in the hope that it will be useful, but WITHOUT ANY ++; WARRANTY; without even the implied warranty of MERCHANTABILITY or ++; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++; for more details. ++; ++; You should have received a copy of the GNU General Public License ++; along with GCC; see the file COPYING3. If not see ++; <http://www.gnu.org/licenses/>. ++ ++-oslib ++Driver Separate Alias(-oslib=) ++ ++-oslib= ++Driver Joined ++Specify an OS support library to load after libc. ++ ++-crt0 ++Driver Separate Alias(-crt0=) ++ ++-crt0= ++Driver Joined ++Specify an alternate startup file. +-- +2.39.0 + diff --git a/packages/linux/4.14.301/chksum b/packages/linux/4.14.301/chksum deleted file mode 100644 index 27679c31..00000000 --- a/packages/linux/4.14.301/chksum +++ /dev/null @@ -1,8 +0,0 @@ -md5 linux-4.14.301.tar.xz 2faa259fdd1af8460e2533a156832ecf -sha1 linux-4.14.301.tar.xz 38a4ae8b90cc720c561bcb5406db9ea6c0ab8928 -sha256 linux-4.14.301.tar.xz acd2ee8e03da098fe9f7e52871dd0790850fc32b78657606bdf65bdd94bbf99b -sha512 linux-4.14.301.tar.xz 70b4ecd95e840bda1d1159802da9e9313b501be4d5472bd3865b141c260aa9d192b5732df8e838d213ff2b0f01f58351c82aa88a9d58a1120d22176c03ed7712 -md5 linux-4.14.301.tar.gz da5adab36d5644bea80c6718a033b533 -sha1 linux-4.14.301.tar.gz 66bad05536c00be04795721cb470fe0f0c0a2120 -sha256 linux-4.14.301.tar.gz 310f2caa138714a3bb40068bbed79e0b328f674d562b01289813844c63bb008c -sha512 linux-4.14.301.tar.gz db85885413cba1003a66bed152ab3f63ffb9e1faf49cf418c0c368d80d33cad048505f8997a89601bd789872b1fdc8433e778c0eb3e11bfc70b7842cde32abd3 diff --git a/packages/linux/4.14.306/chksum b/packages/linux/4.14.306/chksum new file mode 100644 index 00000000..2447e81c --- /dev/null +++ b/packages/linux/4.14.306/chksum @@ -0,0 +1,8 @@ +md5 linux-4.14.306.tar.xz f1cbd4faf63abf9f4da9c16daa64236e +sha1 linux-4.14.306.tar.xz 80a64a32e95a06915597ab3e0560f2d722ac6a9f +sha256 linux-4.14.306.tar.xz 58bbebef7a09dbe2dad804e3b2efb68a2db4bf84779f2da7e7e57e35858bf09e +sha512 linux-4.14.306.tar.xz c13785e7069a7cd798cc35a4192319c8772def1f8a752cf72ddd53ce1022df2015882046bf5820c71bd658d3fc9e5437e5879cd88668a2662a3278b828d6d6c2 +md5 linux-4.14.306.tar.gz 532b3569d2ed19525c4215989c4f83a6 +sha1 linux-4.14.306.tar.gz 304d50097b7aa20416915173397ba174d16e6ab0 +sha256 linux-4.14.306.tar.gz bda9349079ad76ec4b8f1dbde9af8c346a8e6e8043edfd0b62c94ed7c45a7bbd +sha512 linux-4.14.306.tar.gz 05c3bf34b3639ff91f87204dbb6c2ab61a7d7eb1496ede8bb0427ae8b505d5a1b2eb98b51bf1901593d6b4ebe39c2a580bfbed92cf5f36c787f472bf08784ace diff --git a/packages/linux/4.19.268/version.desc b/packages/linux/4.14.306/version.desc index e69de29b..e69de29b 100644 --- a/packages/linux/4.19.268/version.desc +++ b/packages/linux/4.14.306/version.desc diff --git a/packages/linux/4.19.268/chksum b/packages/linux/4.19.268/chksum deleted file mode 100644 index 7a2b074f..00000000 --- a/packages/linux/4.19.268/chksum +++ /dev/null @@ -1,8 +0,0 @@ -md5 linux-4.19.268.tar.xz 366755a45798defed2e53ad0cbcc4729 -sha1 linux-4.19.268.tar.xz 76e3763f5dd4026e0fc93538a0b1e2faf8caa502 -sha256 linux-4.19.268.tar.xz 219bce1ac3f542d06fc606ae6bcb10f8ab1940a46c7903113be59afc486c204f -sha512 linux-4.19.268.tar.xz ffaea6200b7b9f82742a0473fc17b8bbd12c13384ffb8470d288579480f89e0ab264b333dbbcaf2fe97d6c2b7d1e87692820e5ba554d14e314c9749b544aebd2 -md5 linux-4.19.268.tar.gz 816b76f2f3d7cdd70e2d575529b8097a -sha1 linux-4.19.268.tar.gz 1bc075e4ade7e8893875ed333971e72e6525536e -sha256 linux-4.19.268.tar.gz 2a0d4053a1fa44e959500ac11265935c54690417e9e004ef8212f5dbaaf17787 -sha512 linux-4.19.268.tar.gz ae6e79137b118bf42ebccd169ec7a779ff4f2ee08399d0dedbd6e8e48f35d7c6a9e32512df585764121d148eac80a320a7fd133eb973b97f71ce861b64210db5 diff --git a/packages/linux/4.19.273/chksum b/packages/linux/4.19.273/chksum new file mode 100644 index 00000000..a72437f8 --- /dev/null +++ b/packages/linux/4.19.273/chksum @@ -0,0 +1,8 @@ +md5 linux-4.19.273.tar.xz 12bc9df48be66df645e13503ca13a07d +sha1 linux-4.19.273.tar.xz fd0d866199a35605ff065cb1d09a0462df8bf917 +sha256 linux-4.19.273.tar.xz 321ef237f4664c7d14963c759583f5356f6fbdda7948464833b94d5cf3d52773 +sha512 linux-4.19.273.tar.xz 616a8b6cf13932c88c40685a96bbce58de0acdeb88a40e66e3bdd606aa9b26bb6b9d7a4d99f040d5ccc91349ba899b2c4e60413961f719deb065cb3ee1f40e4c +md5 linux-4.19.273.tar.gz 28ee505c22c80e5ef90b523140263161 +sha1 linux-4.19.273.tar.gz ceb6faf6057ac73406498bbe5a82848ada25077f +sha256 linux-4.19.273.tar.gz 1d7a66389d9e43cc79644cf3cc662a6faac1534d9d464371dedea6bfe306a55a +sha512 linux-4.19.273.tar.gz f4189e3b4fd20392522f0152c6718e35bab1ac86ec3072a9ef00f711348ac47dceed79f0f0720799bb2c401e0629a6ab83e5d3c20ee1a1e486426c242e31ece0 diff --git a/packages/linux/5.10.158/version.desc b/packages/linux/4.19.273/version.desc index e69de29b..e69de29b 100644 --- a/packages/linux/5.10.158/version.desc +++ b/packages/linux/4.19.273/version.desc diff --git a/packages/linux/5.10.158/chksum b/packages/linux/5.10.158/chksum deleted file mode 100644 index 79a99214..00000000 --- a/packages/linux/5.10.158/chksum +++ /dev/null @@ -1,8 +0,0 @@ -md5 linux-5.10.158.tar.xz fcb4928cafdefca55eb36fc88bf09a30 -sha1 linux-5.10.158.tar.xz 4979966cb568c4c4373de74e6ce957e3545c6041 -sha256 linux-5.10.158.tar.xz 1e0a24bb5510caa18b3601b25e12cc2a1ce123948de551f4f2cdbb40aea707e7 -sha512 linux-5.10.158.tar.xz 45bcb3c145500607d6328662776a5bd4e2fabe882677fefb5fcbf0377504ed1ca4ccddf1aff0a0f6b85ab79f6e9f91fb1377c33a7e14c7f352fa02ec40e67f4e -md5 linux-5.10.158.tar.gz 20356140f96bde79096df62c8518d743 -sha1 linux-5.10.158.tar.gz 4b2a4d31e19cc9bfa4b07df185ad6af2b35265b2 -sha256 linux-5.10.158.tar.gz 71d9dd3a9b0d3ee05bba34881209a7093e64b8793532c352757b63e654feba84 -sha512 linux-5.10.158.tar.gz fcb9e1c1557f3ee6b7e89a4a3a39a4b1f095339ed868df9fc1e74d8b64f36e193c5325d45c5dd019ee2fd928191b950801df98f7f9a794300caa60528ed644d2 diff --git a/packages/linux/5.10.169/chksum b/packages/linux/5.10.169/chksum new file mode 100644 index 00000000..cd0a37b7 --- /dev/null +++ b/packages/linux/5.10.169/chksum @@ -0,0 +1,8 @@ +md5 linux-5.10.169.tar.xz d073284fb8a7c9e993b62f3012c49de7 +sha1 linux-5.10.169.tar.xz baf306c4bd8612f92c11c16a612e802642718573 +sha256 linux-5.10.169.tar.xz d9754f6eb55e88214c7aaa7c4831c215f88b48da1d9b40f871b055ff56ebafcf +sha512 linux-5.10.169.tar.xz 9ff03313061ac90b44110351aec51c7626b8f83f53efd8c14af374778d909e9e5e8c43857306318a5cffe950ee81f92c6006ef9a26f81a491f608776b741b1e0 +md5 linux-5.10.169.tar.gz e0938760f7f4b1719512f7da7c29bec5 +sha1 linux-5.10.169.tar.gz 8792fcdc054cf0b72812237c62626195ba7cb518 +sha256 linux-5.10.169.tar.gz 7c388e83250df2a7ec5901c01508ed8ed63f982685c69c649f9998e10d95aae5 +sha512 linux-5.10.169.tar.gz a5992aab8f6a68cc8442631e28eb574ae97328d5429f97113297f78a33bc5698a9c745596b40b21ce386d3ad232be77a4897de5189b66ae1a23f41c9eec4bb3b diff --git a/packages/linux/5.15.82/version.desc b/packages/linux/5.10.169/version.desc index e69de29b..e69de29b 100644 --- a/packages/linux/5.15.82/version.desc +++ b/packages/linux/5.10.169/version.desc diff --git a/packages/linux/5.15.82/chksum b/packages/linux/5.15.82/chksum deleted file mode 100644 index 056614a0..00000000 --- a/packages/linux/5.15.82/chksum +++ /dev/null @@ -1,8 +0,0 @@ -md5 linux-5.15.82.tar.xz 39c6d368d79a321ad6b2db4e0f58e206 -sha1 linux-5.15.82.tar.xz 515f5e16dd6e66bfb54fc7be2bc6ae936da76c53 -sha256 linux-5.15.82.tar.xz fceef6bb79bac494663ccde34453521fc616cd94272fd30564752b3742381b65 -sha512 linux-5.15.82.tar.xz b0deb17077d9254e9a6eef853cdbcb7cbdde74cafef214d25961929d02a42fd61d306e3358b17a145999a0df3565c985de6149bd078330c63508ce8ce6fb4938 -md5 linux-5.15.82.tar.gz 76c2a1becb8b45996211476ef79ef419 -sha1 linux-5.15.82.tar.gz 79241dbc98a8f7f847cc4324e6a5beb2c7a837f7 -sha256 linux-5.15.82.tar.gz 2a138780b0d57648a454e09c0321464bd083f9cccd694bdc4e0c5b0f399b2ff1 -sha512 linux-5.15.82.tar.gz 73a42b3b86784a715188d14e41ef518a3efbb28bbc9a0a85b27bd975c77de7f6ca36430c2496b6f5d1714f122f2c563ba6c52537f2a521e0ba9c3896350e31ef diff --git a/packages/linux/5.15.95/chksum b/packages/linux/5.15.95/chksum new file mode 100644 index 00000000..242cdaa7 --- /dev/null +++ b/packages/linux/5.15.95/chksum @@ -0,0 +1,8 @@ +md5 linux-5.15.95.tar.xz 440f5d6bafdf567090127ecd6bd2a0e9 +sha1 linux-5.15.95.tar.xz c446eccbd8d90f80d93b649869189b16ed01d63e +sha256 linux-5.15.95.tar.xz ea71d1f0d28803679dfdc2278fd9f145f12cb566a796502182d719312756441b +sha512 linux-5.15.95.tar.xz 7e983cee8c804e6cd90a812aa61777efbc4a8c102b9d2e8ffb07f22aa9d7f291dff409c359a9be0ad69959cd883633534e7a5a5af34e2f260807b13f98f1c613 +md5 linux-5.15.95.tar.gz 5d106ef07f892de4161a926bbd2816d2 +sha1 linux-5.15.95.tar.gz 366d8c27f5ea2294ac1df9651425c4959f2ff209 +sha256 linux-5.15.95.tar.gz 82a87bcbbfd294cb3ed190d27a6af1a76c01e60122568e71422c34faf626313c +sha512 linux-5.15.95.tar.gz e2acf71a2854dcda777921281f2936d8abfe4945672f572b3ee0bc17f234c69c07fdafeb173e6cc23d8d6e6e707fb2786e899a84edab615bda91209c8d7574c4 diff --git a/packages/linux/5.4.226/version.desc b/packages/linux/5.15.95/version.desc index e69de29b..e69de29b 100644 --- a/packages/linux/5.4.226/version.desc +++ b/packages/linux/5.15.95/version.desc diff --git a/packages/linux/5.4.226/chksum b/packages/linux/5.4.226/chksum deleted file mode 100644 index 6f998297..00000000 --- a/packages/linux/5.4.226/chksum +++ /dev/null @@ -1,8 +0,0 @@ -md5 linux-5.4.226.tar.xz 63993a9d57008a1b2c7aad261ab2bba9 -sha1 linux-5.4.226.tar.xz 719a7f8bb1a8a541590b14ae6bf4aa9a777a5d63 -sha256 linux-5.4.226.tar.xz 0c1f552a1d2f63b3ecd4d33189f0003bc91fb8ff79967a7e295d015c280c9a44 -sha512 linux-5.4.226.tar.xz 154c11c58465985e5c68821c4483130c7fe4213fb2dfb4874ffe9d179ccdc9673a04f11d9596116f6105b3dcaa56da9f4305454cdd863b3ded5e24ef6948370d -md5 linux-5.4.226.tar.gz 7dfc70ed50e729363f11effb837dadc0 -sha1 linux-5.4.226.tar.gz 50680f732ba868200a781a40f35ee42e40ca3275 -sha256 linux-5.4.226.tar.gz d17b08833b299ff821fd461ebd35c7aff90f4277d77a1a8536c810d56c5ca1c9 -sha512 linux-5.4.226.tar.gz 6f1f020ba36f610c843170e1f775828c50fc866bcad717abc75eae0e238761e9916a53e7539b7e1792da0dccd5be30ba5012d9a4064c2cad49af666bcbef3779 diff --git a/packages/linux/5.4.232/chksum b/packages/linux/5.4.232/chksum new file mode 100644 index 00000000..ec0d28bb --- /dev/null +++ b/packages/linux/5.4.232/chksum @@ -0,0 +1,8 @@ +md5 linux-5.4.232.tar.xz e12774e530b8ab0a3f856997cfec6729 +sha1 linux-5.4.232.tar.xz 1655cafa4c8228e2b5b93abd86bd3f205d17d149 +sha256 linux-5.4.232.tar.xz b0656a5e798b2dab5fb4c9da6398d388306ba2169848fc837a4133e85b430e93 +sha512 linux-5.4.232.tar.xz 7d4339f7db5845e9bb3dc440adc90c23b8f63f5166c19fc143979b9dc84551649c275a8ee815792818b6c20bac17349c0802e8037a74e6fcb30693cb27f94439 +md5 linux-5.4.232.tar.gz 0238746a02022a16d6b600d69398487c +sha1 linux-5.4.232.tar.gz e756b834fad1a4139c7cd17150ef8bc830b8242c +sha256 linux-5.4.232.tar.gz 1b92697f812afa8f4150cb92df4e3b04406a17219f89f1628e850a671ebf131e +sha512 linux-5.4.232.tar.gz 0de643320c91f1fbd264beb5104dfae87f0f3984a53922ccf838b350028a0ad3918986abbad4996b398d05111db6d74df4160951a09c64d036c8d4391450a0de diff --git a/packages/linux/6.1/version.desc b/packages/linux/5.4.232/version.desc index e69de29b..e69de29b 100644 --- a/packages/linux/6.1/version.desc +++ b/packages/linux/5.4.232/version.desc diff --git a/packages/linux/6.1.13/chksum b/packages/linux/6.1.13/chksum new file mode 100644 index 00000000..24c8a518 --- /dev/null +++ b/packages/linux/6.1.13/chksum @@ -0,0 +1,8 @@ +md5 linux-6.1.13.tar.xz cb9bfd3d8dd6839888ba290fb1694df0 +sha1 linux-6.1.13.tar.xz fe9d0f171854391fd379c95b0d37156a51f9831c +sha256 linux-6.1.13.tar.xz 48841319f4b0077da15e4176e624032d8332d961ee660e1b85e1ce73ded17a67 +sha512 linux-6.1.13.tar.xz 33acc343d5cf8728f737935580d8ad9acca192770e94dc8fa9877f78193fd2d3ea1a1f3a2e0a2850a418b5699c9d2e7a4b1bf962186f464a5fd56b773dfe5f73 +md5 linux-6.1.13.tar.gz 4ff5c226d9406711c799ceda61e561cf +sha1 linux-6.1.13.tar.gz 36c1934a779cf60ba88d2e8b94972bf16389e118 +sha256 linux-6.1.13.tar.gz 8d0b489585a08076bb23aec08ada047af581049363a503961d80c9fd032060b9 +sha512 linux-6.1.13.tar.gz 2af2def4d11c5f069dddc48559995d31727440c7ae3e2683f94c0d9b60acf782c4bb8588a1884098b1e6391351580c0aa9827ab7cdf8904c9b984db8fd10f6ac diff --git a/packages/linux/6.1.13/version.desc b/packages/linux/6.1.13/version.desc new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/packages/linux/6.1.13/version.desc diff --git a/packages/linux/6.1/chksum b/packages/linux/6.1/chksum deleted file mode 100644 index a68f21fb..00000000 --- a/packages/linux/6.1/chksum +++ /dev/null @@ -1,8 +0,0 @@ -md5 linux-6.1.tar.xz 475320de08f16c9fa486fc4edfe98b30 -sha1 linux-6.1.tar.xz 30996d7c1c59ddbd495bd9eb37c8dfdb1a67c1c3 -sha256 linux-6.1.tar.xz 2ca1f17051a430f6fed1196e4952717507171acfd97d96577212502703b25deb -sha512 linux-6.1.tar.xz 6ed2a73c2699d0810e54753715635736fc370288ad5ce95c594f2379959b0e418665cd71bc512a0273fe226fe90074d8b10d14c209080a6466498417a4fdda68 -md5 linux-6.1.tar.gz 32445cd604f81b6fd0d023bc009a6a1d -sha1 linux-6.1.tar.gz e7fdde90c7b6638226e353cbd17c9eae67a40a09 -sha256 linux-6.1.tar.gz de4ee64f1e86da97c0c2974c02a77c01ea81eed0c04b6319fbc719810104de92 -sha512 linux-6.1.tar.gz 9d8a57d9071ffe6bd7e43a52d565e455ac00e64d40137d964c66fe47838b178dddc5c278b18d3486f80966a57a8eac720c45291ea822d64996202dccbeccd4b7 diff --git a/samples/arm-picolibc-eabi/crosstool.config b/samples/arm-picolibc-eabi/crosstool.config index 640f3071..72dcb07b 100644 --- a/samples/arm-picolibc-eabi/crosstool.config +++ b/samples/arm-picolibc-eabi/crosstool.config @@ -1,11 +1,10 @@ CT_CONFIG_VERSION="4" +CT_EXPERIMENTAL=y CT_ARCH_ARM=y CT_MULTILIB=y -CT_ARCH_FLOAT_SW=y CT_TARGET_CFLAGS="-ftls-model=local-exec" CT_TARGET_VENDOR="picolibc" -CT_LIBC_NONE=y +CT_LIBC_PICOLIBC=y CT_CC_GCC_MULTILIB_LIST="rmprofile" CT_CC_GCC_CONFIG_TLS=y CT_CC_LANG_CXX=y -CT_COMP_LIBS_PICOLIBC=y diff --git a/scripts/build/binutils/binutils.sh b/scripts/build/binutils/binutils.sh index fdec508f..eff19c46 100644 --- a/scripts/build/binutils/binutils.sh +++ b/scripts/build/binutils/binutils.sh @@ -176,6 +176,12 @@ do_binutils_backend() { [ "${CT_TOOLCHAIN_ENABLE_NLS}" != "y" ] && extra_config+=("--disable-nls") + if [ "${CT_COMP_LIBS_ZSTD}}" = "y" ]; then + extra_config+=("--with-zstd=${complibs}") + else + extra_config+=("--without-zstd") + fi + # Disable usage of glob for higher compatibility. # Not strictly needed for anything but GDB anyways. export ac_cv_func_glob=no diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh index 6eeda28d..352f6518 100644 --- a/scripts/build/cc/gcc.sh +++ b/scripts/build/cc/gcc.sh @@ -392,6 +392,12 @@ do_gcc_core_backend() { extra_config+=(--disable-libstdcxx) fi + if [ "${CT_LIBC_PICOLIBC}" = "y" ]; then + extra_config+=("--with-default-libc=picolibc") + extra_config+=("--enable-stdio=pure") + extra_config+=("--disable-wchar_t") + fi + core_LDFLAGS+=("${ldflags}") # *** WARNING ! *** @@ -1043,6 +1049,12 @@ do_gcc_backend() { extra_config+=(--disable-libstdcxx) fi + if [ "${CT_LIBC_PICOLIBC}" = "y" ]; then + extra_config+=("--with-default-libc=picolibc") + extra_config+=("--enable-stdio=pure") + extra_config+=("--disable-wchar_t") + fi + final_LDFLAGS+=("${ldflags}") # *** WARNING ! *** diff --git a/scripts/build/companion_libs/340-picolibc.sh b/scripts/build/companion_libs/340-picolibc.sh index e879005d..7b29a820 100644 --- a/scripts/build/companion_libs/340-picolibc.sh +++ b/scripts/build/companion_libs/340-picolibc.sh @@ -11,71 +11,13 @@ do_picolibc_for_build() { :; } do_picolibc_for_host() { :; } do_picolibc_for_target() { :; } -if [ "${CT_COMP_LIBS_PICOLIBC}" = "y" ]; then - -# Download picolibc -do_picolibc_get() { - CT_Fetch PICOLIBC -} - -do_picolibc_extract() { - CT_ExtractPatch PICOLIBC -} - -#------------------------------------------------------------------------------ -# Build an additional target libstdc++ with "-Os" (optimise for speed) option -# flag for libstdc++ "picolibc" variant. -do_cc_libstdcxx_picolibc() -{ - local -a final_opts - local final_backend +if [ "${CT_LIBC_PICOLIBC}" = "y" -o "${CT_COMP_LIBS_PICOLIBC}" = "y" ]; then - if [ "${CT_LIBC_PICOLIBC_GCC_LIBSTDCXX}" = "y" ]; then - final_opts+=( "host=${CT_HOST}" ) - final_opts+=( "libstdcxx_name=picolibc" ) - final_opts+=( "prefix=${CT_PREFIX_DIR}" ) - final_opts+=( "complibs=${CT_HOST_COMPLIBS_DIR}" ) - final_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" ) - final_opts+=( "ldflags=${CT_LDFLAGS_FOR_HOST}" ) - final_opts+=( "lang_list=c,c++" ) - final_opts+=( "build_step=libstdcxx" ) - final_opts+=( "extra_config+=('--enable-stdio=stdio_pure')" ) - final_opts+=( "extra_config+=('--disable-wchar_t')" ) - if [ "${CT_LIBC_PICOLIBC_ENABLE_TARGET_OPTSPACE}" = "y" ]; then - final_opts+=( "enable_optspace=yes" ) - fi - - if [ "${CT_BARE_METAL}" = "y" ]; then - final_opts+=( "mode=baremetal" ) - final_opts+=( "build_libgcc=yes" ) - final_opts+=( "build_libstdcxx=yes" ) - final_opts+=( "build_libgfortran=yes" ) - if [ "${CT_STATIC_TOOLCHAIN}" = "y" ]; then - final_opts+=( "build_staticlinked=yes" ) - fi - final_backend=do_gcc_core_backend - else - final_backend=do_gcc_backend - fi - - CT_DoStep INFO "Installing libstdc++ picolibc" - CT_mkdir_pushd "${CT_BUILD_DIR}/build-cc-libstdcxx-picolibc" - "${final_backend}" "${final_opts[@]}" - CT_Popd - - CT_EndStep - fi -} - -do_picolibc_for_target() { +do_picolibc_common_install() { local -a picolibc_opts local cflags_for_target - CT_DoStep INFO "Installing Picolibc library" - - CT_mkdir_pushd "${CT_BUILD_DIR}/build-picolibc-build-${CT_BUILD}" - - CT_DoLog EXTRA "Configuring Picolibc library" + CT_DoLog EXTRA "Configuring C library" # Multilib is the default, so if it is not enabled, disable it. if [ "${CT_MULTILIB}" != "y" ]; then @@ -106,9 +48,6 @@ RETARGETABLE_LOCKING:newlib-retargetable-locking fi done - [ "${CT_USE_SYSROOT}" = "y" ] && \ - picolibc_opts+=( "-Dsysroot-install=true" ) - [ "${CT_LIBC_PICOLIBC_EXTRA_SECTIONS}" = "y" ] && \ CT_LIBC_PICOLIBC_TARGET_CFLAGS="${CT_LIBC_PICOLIBC_TARGET_CFLAGS} -ffunction-sections -fdata-sections" @@ -128,7 +67,7 @@ RETARGETABLE_LOCKING:newlib-retargetable-locking done cat << EOF > picolibc-cross.txt [binaries] -c = '${CT_TARGET}-gcc' +c = '${CT_TARGET}-${CT_CC}' ar = '${CT_TARGET}-ar' as = '${CT_TARGET}-as' strip = '${CT_TARGET}-strip' @@ -145,13 +84,24 @@ needs_exe_wrapper = true skip_sanity_check = true EOF + local picolibc_sysroot_dir + local picolibc_lib_dir + if [ "${CT_LIBC_PICOLIBC}" = 'y' ]; then + picolibc_sysroot_dir="${CT_SYSROOT_DIR}" + picolibc_lib_dir="${CT_SYSROOT_DIR}/lib" + picolibc_opts+=( '-Dsystem-libc=true' ) + else + picolibc_sysroot_dir="${CT_PREFIX_DIR}/picolibc" + picolibc_lib_dir="${picolibc_sysroot_dir}/${CT_TARGET}/lib" + fi + CT_DoExecLog CFG \ meson \ --cross-file picolibc-cross.txt \ - --prefix="${CT_PREFIX_DIR}" \ - -Dincludedir=picolibc/include \ - -Dlibdir=picolibc/${CT_TARGET}/lib \ - -Dspecsdir="${CT_SYSROOT_DIR}"/lib \ + --prefix="${picolibc_sysroot_dir}" \ + -Dincludedir=include \ + -Dlibdir="${picolibc_lib_dir}" \ + -Dspecsdir="${CT_SYSROOT_DIR}/lib" \ "${CT_SRC_DIR}/picolibc" \ "${picolibc_opts[@]}" \ "${CT_LIBC_PICOLIBC_EXTRA_CONFIG_ARRAY[@]}" @@ -161,11 +111,75 @@ EOF CT_DoLog EXTRA "Installing C library" CT_DoExecLog ALL ninja install +} + +fi # CT_LIBC_PICOLIBC -o CT_COMP_LIBS_PICOLIBC + +if [ "${CT_COMP_LIBS_PICOLIBC}" = "y" ]; then + +do_cc_libstdcxx_picolibc() { :; } + +# Download picolibc +do_picolibc_get() { + CT_Fetch PICOLIBC +} + +do_picolibc_extract() { + CT_ExtractPatch PICOLIBC +} + +if [ "${CT_LIBC_PICOLIBC_GCC_LIBSTDCXX}" = "y" ]; then +#------------------------------------------------------------------------------ +# Build an additional target libstdc++ with "-Os" (optimise for speed) option +# flag for libstdc++ "picolibc" variant. +do_cc_libstdcxx_picolibc() +{ + local -a final_opts + local final_backend + final_opts+=( "host=${CT_HOST}" ) + final_opts+=( "libstdcxx_name=picolibc" ) + final_opts+=( "prefix=${CT_PREFIX_DIR}" ) + final_opts+=( "complibs=${CT_HOST_COMPLIBS_DIR}" ) + final_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" ) + final_opts+=( "ldflags=${CT_LDFLAGS_FOR_HOST}" ) + final_opts+=( "lang_list=c,c++" ) + final_opts+=( "build_step=libstdcxx" ) + final_opts+=( "extra_config+=('--enable-stdio=stdio_pure')" ) + final_opts+=( "extra_config+=('--disable-wchar_t')" ) + if [ "${CT_LIBC_PICOLIBC_ENABLE_TARGET_OPTSPACE}" = "y" ]; then + final_opts+=( "enable_optspace=yes" ) + fi + + if [ "${CT_BARE_METAL}" = "y" ]; then + final_opts+=( "mode=baremetal" ) + final_opts+=( "build_libgcc=yes" ) + final_opts+=( "build_libstdcxx=yes" ) + final_opts+=( "build_libgfortran=yes" ) + if [ "${CT_STATIC_TOOLCHAIN}" = "y" ]; then + final_opts+=( "build_staticlinked=yes" ) + fi + final_backend=do_gcc_core_backend + else + final_backend=do_gcc_backend + fi + + CT_DoStep INFO "Installing libstdc++ picolibc" + CT_mkdir_pushd "${CT_BUILD_DIR}/build-cc-libstdcxx-picolibc" + "${final_backend}" "${final_opts[@]}" CT_Popd + CT_EndStep +} +fi # CT_LIBC_PICOLIBC_GCC_LIBSTDCXX +do_picolibc_for_target() { + CT_DoStep INFO "Installing Picolibc library" + CT_mkdir_pushd "${CT_BUILD_DIR}/build-picolibc-build-${CT_BUILD}" + do_picolibc_common_install + CT_Popd + CT_EndStep do_cc_libstdcxx_picolibc } -fi +fi # CT_COMP_LIBS_PICOLIBC diff --git a/scripts/build/libc/picolibc.sh b/scripts/build/libc/picolibc.sh new file mode 100644 index 00000000..7e71c29b --- /dev/null +++ b/scripts/build/libc/picolibc.sh @@ -0,0 +1,29 @@ +# This file adds functions to use the Picolibc library as the system libc +# Copyright © 2022 Joakim Nohlgård +# Licensed under the GPL v2 or later. See COPYING in the root of this package + +picolibc_get() +{ + CT_Fetch PICOLIBC +} + +picolibc_extract() +{ + CT_ExtractPatch PICOLIBC +} + +picolibc_headers() +{ + CT_DoStep INFO "Installing C library headers" + CT_DoExecLog ALL cp -a "${CT_SRC_DIR}/picolibc/newlib/libc/include/." "${CT_HEADERS_DIR}" + CT_EndStep +} + +picolibc_main() +{ + CT_DoStep INFO "Installing C library" + CT_mkdir_pushd "${CT_BUILD_DIR}/build-libc" + do_picolibc_common_install + CT_Popd + CT_EndStep +} |