pastebin - collaborative debugging tool
nrubsig.kpaste.net RSS


nfstest_gcc_build.ksh93
Posted by Anonymous on Mon 18th Mar 2024 11:07
raw | new post
modification of post by Anonymous (view diff)

  1. #!/usr/bin/ksh93
  2.  
  3. #
  4. # nfstest_gcc_build.ksh93
  5. #
  6. # Simple NFSv4 torture test by building gcc in parallel
  7. # on a NFS filesystem
  8. #
  9. set -o xtrace
  10. set -o errexit
  11. set -o nounset
  12.  
  13. #
  14. # build config
  15. #
  16. typeset config_cp_p_function_not_implemented_workaround=false
  17. typeset config_use_posix_ksh93_builtins=true
  18.  
  19. compound gitdata=(
  20.         typeset url='git://repo.or.cz/gcc.git'
  21.         typeset tag='releases/gcc-13.1.0'
  22. )
  23.  
  24. typeset -a configure_options=(
  25.         # Per irc://irc.oftc.net/#gcc:
  26.         # ".. pch is broken on windows as allocation using the fixed
  27.         # address might not succeed in general and there is fixed
  28.         # retry loop using delay that kills all performance
  29.         # benefits..."
  30.         '--disable-libstdcxx-pch'
  31. )
  32.  
  33. #
  34. # temp dir setup
  35. #
  36.  
  37. # fixme: Does not work with NFSv4.1 filesystem from exported Linux tmpfs - why ?
  38. #tmpdir='/cygdrive/m/tmpdir'
  39. #mkdir -p "$tmpdir"
  40. #chmod a=rwxt "$tmpdir"
  41. #if [[ -d "$tmpdir" && -w "$tmpdir" ]] ; then
  42. #       export TMPDIR="$tmpdir"
  43. #fi
  44.  
  45. #
  46. # source checkout
  47. #
  48.  
  49. #time git -c checkout.workers=16 clone -b "${gitdata.tag}" --single-branch git://gcc.gnu.org/git/gcc.git
  50. #time git -c checkout.workers=16 clone -b "${gitdata.tag}" --single-branch https://github.com/gcc-mirror/gcc.git
  51.  
  52. if [[ -f '../gcc.bundle' ]] ; then
  53.         # Use local bundle as cache
  54.         # The bundle was created like this:
  55.         # ---- snip ----
  56.         # git clone git://repo.or.cz/gcc.git
  57.         # cd gcc
  58.         # git bundle create '../gcc.bundle' --all
  59.         # cd ..
  60.         # rm -Rf gcc
  61.         # ---- snip ----
  62.         time git -c checkout.workers=16 clone -b "${gitdata.tag}" --single-branch '../gcc.bundle'
  63. else
  64.         time git -c checkout.workers=16 clone -b "${gitdata.tag}" --single-branch "${gitdata.url}"
  65. fi
  66.  
  67. cd "$PWD/gcc/"
  68.  
  69. if $config_use_posix_ksh93_builtins ; then
  70.         PATH="/usr/ast/bin:/opt/ast/bin:$PATH"
  71. fi
  72.  
  73. #
  74. # patch sources and configure build
  75. #
  76.  
  77. # Cygwin: workaround for configure using cp -p where ln -s should be used
  78. # (this is an automake/autoconf issue, they should trust Cygwin and not use
  79. # ancient workarounds for issues which no longer exists)
  80. (set -o xtrace ; sed -i "s/as_ln_s='cp -pR'/as_ln_s='ln -s'/g" $(find . -name 'configure') )
  81.  
  82. if $config_use_posix_ksh93_builtins ; then
  83.         (set -o xtrace ; sed -i "s/\/bin\/sh/\/bin\/ksh93/g" $(find . -name 'configure') )
  84. fi
  85.  
  86. if $config_use_posix_ksh93_builtins ; then
  87.         ksh93 ./configure "${configure_options[@]}"
  88. else
  89.         bash ./configure "${configure_options[@]}"
  90. fi
  91.  
  92. if $config_cp_p_function_not_implemented_workaround ; then
  93.         # workaround for $ cp -p # failing with "Function not
  94.         # implemented" in older versions of ms-nfs41-client
  95.         if $config_use_posix_ksh93_builtins ; then
  96.                 (
  97.                         set -o xtrace
  98.                         sed -i -r 's/(cp.*)([[:space:]]+-p[[:space:]]+)/\1\2 -A pt /g' \
  99.                                 $(find . -name 'Makefile' -o -name 'Makefile.in')
  100.                 )
  101.         else
  102.                 (
  103.                         set -o xtrace ; sed -i -r 's/(cp.*)([[:space:]]+-p[[:space:]]+)/\1\2--no-preserve=ownership /g' \
  104.                                 $(find . -name 'Makefile' -o -name 'Makefile.in')
  105.                 )
  106.         fi
  107. fi
  108.  
  109. if $config_use_posix_ksh93_builtins ; then
  110.         # replace /bin/sh with /bin/ksh93 for speed
  111.         (set -o xtrace ; sed -i -r 's/\/bin\/sh/\/bin\/ksh93/g' \
  112.                 $(find . -name 'Makefile' -o -name 'Makefile.in') )
  113. fi
  114.  
  115. #
  116. # build gcc
  117. #
  118. ksh93 -c 'export SHELL=/bin/ksh93 ; (yes | make -j8 all)'
  119. echo $?
  120.  
  121. echo "#Done."

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at