crossgcc 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #!/usr/bin/env bash
  2. # helper script: downloads crossgcc, for building coreboot
  3. #
  4. # Copyright (C) 2016 Leah Rowe <info@minifree.org>
  5. #
  6. # This program is free software: you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation, either version 3 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. #
  19. # This script assumes that the working directory is the
  20. # root of libreboot_src or libreboot git.
  21. [ "x${DEBUG+set}" = 'xset' ] && set -v
  22. set -u -e
  23. if [ -f "version" ]; then
  24. # _src release archive is being used
  25. version="libreboot-$(cat version)"
  26. else
  27. # git repo is being used
  28. version="libreboot-$(git describe --tags HEAD)"
  29. fi
  30. # coreboot revisios used for crossgcc
  31. crossgccrevision="35562d8b6477058e6bca31b5cedd9d4897124fc7"
  32. vbootrevision="d187cd3fc792f8bcefbee4587c83eafbd08441fc"
  33. rm -Rf "crossgcc/"
  34. (
  35. git clone https://review.coreboot.org/coreboot crossgcc || git clone https://github.com/coreboot/coreboot.git crossgcc
  36. cd "crossgcc/"
  37. git reset --hard ${crossgccrevision}
  38. git submodule update --init --checkout -- 3rdparty/vboot/
  39. (
  40. cd 3rdparty/vboot/
  41. git reset --hard ${vbootrevision}
  42. )
  43. # If -pie is enabled in GCC, then --with-pic must be used when compiling
  44. git am ../resources/libreboot/patch/crossgcc/looking_for_pie.patch
  45. # Update URI pointing to the version of libelf we need
  46. git am ../resources/libreboot/patch/crossgcc/libelf.patch
  47. #Patch to add hash checking to buildgcc
  48. git apply ../resources/libreboot/patch/crossgcc/buildgcc_hash_patch.diff
  49. rm -Rf .git* */*/.git*
  50. )
  51. printf "Deblobbing coreboot\n"
  52. ./resources/utilities/coreboot-libre/deblob