Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utils.py: Bump binutils to version 2.35.1 and use sha512sum #118

Closed
dileks opened this issue Sep 22, 2020 · 4 comments · Fixed by #122
Closed

utils.py: Bump binutils to version 2.35.1 and use sha512sum #118

dileks opened this issue Sep 22, 2020 · 4 comments · Fixed by #122

Comments

@dileks dileks added the enhancement New feature or request label Sep 22, 2020
@msfjarvis
Copy link
Member

open a PR?

@dileks
Copy link
Contributor Author

dileks commented Sep 22, 2020

Use officially provided sha512.sum from <sourceware.org>:

diff --git a/utils.py b/utils.py
index 0b823085e6ac..c3b3584a8ef2 100755
--- a/utils.py
+++ b/utils.py
@@ -22,7 +22,7 @@ def current_binutils():
     Simple getter for current stable binutils release
     :return: The current stable release of binutils
     """
-    return "binutils-2.35"
+    return "binutils-2.35.1"
 
 
 def download_binutils(folder):
@@ -58,20 +58,19 @@ def download_binutils(folder):
 
 
 def verify_binutils_checksum(file):
-    # Check the sha256sum of the downloaded package with a known good one
-    # To regenerate the sha256sum, download the .tar.xz and .tar.xz.sig files
-    # $ gpg --verify *.tar.xz.sig *.tar.xz
-    # $ sha256sum *.tar.xz
-    file_hash = hashlib.sha256()
+    # Check the SHA512 checksum of the downloaded file with a known good one
+    # XXX: Use officially provided sha512.sum from <sourceware.org> for .tar.xz file
+    # Link: ftp://sourceware.org/pub/binutils/releases/sha512.sum
+    file_hash = hashlib.sha512()
     with file.open("rb") as f:
         while True:
-            data = f.read(65536)
+            data = f.read(131072)
             if not data:
                 break
             file_hash.update(data)
-    good_hash = "1b11659fb49e20e18db460d44485f09442c8c56d5df165de9461eb09c8302f85"
+    good_hash = "94ff72708403413b70b247f3af4099ebaa882b6659249869f1ed9941a0f1912e313f08357d470f9fd2359e7f5e5b0eb86285e5eaf883fa8187789d6b1bd304eb"
     if file_hash.hexdigest() != good_hash:
-        raise RuntimeError("binutils sha256sum does not match known good one!")
+        raise RuntimeError("binutils: SHA512 checksum does not match known good one!")
 

@dileks
Copy link
Contributor Author

dileks commented Sep 22, 2020

That works with:

$ python3 ./build-binutils.py -B /home/dileks/src/llvm-toolchain/build -I /home/dileks/src/llvm-toolchain/install -t x86_64-linux-gnu

dileks added a commit to dileks/tc-build that referenced this issue Sep 24, 2020
Bump binutils to version 2.35.1 and use SHA512 checksum as upstream provides a sha512.sum file.

Run (here: x86-64):

$ python3 ./build-binutils.py -B ~/src/llvm-toolchain/build -I ~/src/llvm-toolchain/install -t x86_64-linux-gnu

Link: https://sourceware.org/pub/binutils/releases/sha512.sum
Link: https://sourceware.org/pipermail/binutils/2020-September/113375.html
Link: ClangBuiltLinux#118
dileks added a commit to dileks/tc-build that referenced this issue Sep 24, 2020
Bump binutils to version 2.35.1 and use SHA512 checksum as upstream provides a sha512.sum file.

Run (here: x86-64):

$ python3 ./build-binutils.py -B ~/src/llvm-toolchain/build -I ~/src/llvm-toolchain/install -t x86_64-linux-gnu

Link: https://sourceware.org/pub/binutils/releases/sha512.sum
Link: https://sourceware.org/pipermail/binutils/2020-September/113375.html
Link: ClangBuiltLinux#118
Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com>
dileks added a commit to dileks/tc-build that referenced this issue Sep 24, 2020
Bump binutils to version 2.35.1 and use SHA512 checksum as upstream provides a sha512.sum file.

Run (here: x86-64):

$ python3 ./build-binutils.py -B ~/src/llvm-toolchain/build -I ~/src/llvm-toolchain/install -t x86_64-linux-gnu

Link: https://sourceware.org/pub/binutils/releases/sha512.sum
Link: https://sourceware.org/pipermail/binutils/2020-September/113375.html
Link: ClangBuiltLinux#118
Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com>
dileks added a commit to dileks/tc-build that referenced this issue Sep 24, 2020
Bump binutils to version 2.35.1 and use SHA512 checksum as upstream provides a sha512.sum file.

Run (here: x86-64):

$ python3 ./build-binutils.py -B ~/src/llvm-toolchain/build -I ~/src/llvm-toolchain/install -t x86_64-linux-gnu

Link: https://sourceware.org/pub/binutils/releases/sha512.sum
Link: https://sourceware.org/pipermail/binutils/2020-September/113375.html
Link: ClangBuiltLinux#118
Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com>
@dileks dileks changed the title utils: Upgrade to binutils-2.35.1 utils.py: Bump binutils to version 2.35.1 and use sha512sum Sep 24, 2020
@dileks dileks removed the enhancement New feature or request label Sep 24, 2020
@dileks
Copy link
Contributor Author

dileks commented Sep 24, 2020

Might be useful/helpful to have a new label for version upgrades?

@msfjarvis msfjarvis linked a pull request Sep 24, 2020 that will close this issue
Kyuofox pushed a commit to Kyuofox/tc-build that referenced this issue Dec 2, 2020
Bump binutils to version 2.35.1 and use SHA512 checksum as upstream provides a sha512.sum file.

Run (here: x86-64):

$ python3 ./build-binutils.py -B ~/src/llvm-toolchain/build -I ~/src/llvm-toolchain/install -t x86_64-linux-gnu

Link: https://sourceware.org/pub/binutils/releases/sha512.sum
Link: https://sourceware.org/pipermail/binutils/2020-September/113375.html
Link: ClangBuiltLinux/tc-build#118
Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants