setup-toolchain.sh: Update GCC to 12.3
[kernel-tools.git] / setup-toolchain.sh
index 922a43ed4e348bf57a0b8377b185103d0b6d8d64..88f23377545065ed902a723e1f34eb13d373cae2 100755 (executable)
@@ -2,6 +2,20 @@
 set -euo pipefail
 set -x
 
+# You can redistribute and/or modify this file under the terms of the
+# GNU Affero General Public License as published by the Free Software
+# Foundation, either version 3 of the License, or (at your option)
+# any later version.
+
+# This program 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
+# Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public
+# License along with this program. If not, see
+# <https://www.gnu.org/licenses/>.
+
 # SPDX-FileCopyrightText: 2022 Jason Self <j@jxself.org>
 # SPDX-License-Identifier: AGPL-3.0-or-later
 #
@@ -66,10 +80,10 @@ setup_keyring
 download_source () {
   # This handles the actual downloading the of the source code from
   # the GNU FTP mirrors along with invoking GPG for verification.
-  if [ ! -f "binutils-$binutils_version.tar.bz2" ]; then
-    wget http://ftpmirror.gnu.org/gnu/binutils/binutils-$binutils_version.tar.bz2
-    wget http://ftpmirror.gnu.org/gnu/binutils/binutils-$binutils_version.tar.bz2.sig
-    gpg --no-default-keyring --keyring ./gnu-keyring.gpg --verify binutils-$binutils_version.tar.bz2.sig
+  if [ ! -f "binutils-$binutils_version.tar.lz" ]; then
+    wget http://ftpmirror.gnu.org/gnu/binutils/binutils-$binutils_version.tar.lz
+    wget http://ftpmirror.gnu.org/gnu/binutils/binutils-$binutils_version.tar.lz.sig
+    gpg --no-default-keyring --keyring ./gnu-keyring.gpg --verify binutils-$binutils_version.tar.lz.sig
   fi
   if [ ! -f "gcc-$gcc_version.tar.xz" ]; then
     wget http://ftpmirror.gnu.org/gnu/gcc/gcc-$gcc_version/gcc-$gcc_version.tar.xz
@@ -98,7 +112,7 @@ setup_source () {
   # function extracts the tarballs and places things into the
   # appropriate locations as needed.
   if [ ! -d "binutils-$binutils_version" ]; then
-    tar xf binutils-$binutils_version.tar.bz2
+    tar xf binutils-$binutils_version.tar.lz
   fi
   if [ ! -d "gcc-$gcc_version" ]; then
     tar xf gcc-$gcc_version.tar.xz
@@ -188,7 +202,7 @@ do
   # architecture may need to set up more than one combination of
   # these. These are just the defaults and are adjusted for specific
   # architectures as needed as the program runs.
-  export gcc_version="12.2.0"
+  export gcc_version="12.3.0"
   export binutils_version="2.40"
   export gmp_version="6.2.1"
   export mpc_version="1.3.1"
@@ -249,7 +263,7 @@ do
       # The 4.19 series needs to be built with GCC 10.4 & binutils 2.37
       export gcc_version="10.4.0"
       export binutils_version="2.37"
-      export toolchain_directory="toolchain-$gcc_version-bintuils-$binutils_version"
+      export toolchain_directory="toolchain-$gcc_version-binutils-$binutils_version"
       reset_path
       set_path
       reset_path