|
11 | 11 | #@ {amd64,i386,armhf,arm64,armel,mipsel,mips64el} |
12 | 12 | #@ |
13 | 13 |
|
| 14 | +# partially synced with https://chromium.googlesource.com/chromium/src/+/e8df45bfd5386216b9b6ff178b26461902c7ae3a/build/linux/sysroot_scripts/sysroot-creator.sh |
| 15 | + |
| 16 | + |
14 | 17 | ###################################################################### |
15 | 18 | # Config |
16 | 19 | ###################################################################### |
17 | 20 |
|
18 | 21 | set -o nounset |
19 | 22 | set -o errexit |
| 23 | +set -x |
20 | 24 |
|
21 | 25 | SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" |
22 | 26 |
|
@@ -450,35 +454,45 @@ InstallIntoSysroot() { |
450 | 454 |
|
451 | 455 | CleanupJailSymlinks() { |
452 | 456 | Banner "Jail symlink cleanup" |
453 | | - |
454 | 457 | SAVEDPWD=$(pwd) |
455 | 458 | cd ${INSTALL_ROOT} |
456 | 459 | local libdirs="lib usr/lib" |
457 | | - if [ -d lib64 ]; then |
| 460 | + if [ "${ARCH}" != "MIPS" ]; then |
458 | 461 | libdirs="${libdirs} lib64" |
459 | 462 | fi |
460 | | - |
461 | 463 | find $libdirs -type l -printf '%p %l\n' | while read link target; do |
| 464 | + echo "Processing link ${link} -> ${target}" |
462 | 465 | # skip links with non-absolute paths |
463 | 466 | echo "${target}" | grep -qs ^/ || continue |
464 | 467 | echo "${link}: ${target}" |
465 | | - # Relativize the symlink. |
466 | | - prefix=$(echo "${link}" | sed -e 's/[^/]//g' | sed -e 's|/|../|g') |
467 | | - ln -snfv "${prefix}${target}" "${link}" |
| 468 | + case "${link}" in |
| 469 | + usr/lib/gcc/*-linux-gnu/4.*/* | usr/lib/gcc/arm-linux-gnueabihf/4.*/* | \ |
| 470 | + usr/lib/gcc/aarch64-linux-gnu/4.*/*) |
| 471 | + # Relativize the symlink. |
| 472 | + ln -snfv "../../../../..${target}" "${link}" |
| 473 | + ;; |
| 474 | + usr/lib/*-linux-gnu/* | usr/lib/arm-linux-gnueabihf/*) |
| 475 | + # Relativize the symlink. |
| 476 | + ln -snfv "../../..${target}" "${link}" |
| 477 | + ;; |
| 478 | + usr/lib/*) |
| 479 | + # Relativize the symlink. |
| 480 | + ln -snfv "../..${target}" "${link}" |
| 481 | + ;; |
| 482 | + lib64/* | lib/*) |
| 483 | + # Relativize the symlink." |
| 484 | + ln -snfv "..${target}" "${link}" |
| 485 | + ;; |
| 486 | + esac |
468 | 487 | done |
469 | | - |
470 | | - failed=0 |
471 | | - while read link target; do |
472 | | - # Make sure we catch new bad links. |
473 | | - if [ ! -r "${link}" ]; then |
474 | | - echo "ERROR: FOUND BAD LINK ${link}" |
475 | | - ls -l ${link} |
476 | | - failed=1 |
477 | | - fi |
478 | | - done < <(find $libdirs -type l -printf '%p %l\n') |
479 | | - if [ $failed -eq 1 ]; then |
480 | | - exit 1 |
481 | | - fi |
| 488 | + # find $libdirs -type l -printf '%p %l\n' | while read link target; do |
| 489 | + # # Make sure we catch new bad links. |
| 490 | + # if [ ! -r "${link}" ]; then |
| 491 | + # echo "ERROR: FOUND BAD LINK ${link}" |
| 492 | + # ls -l ${link} |
| 493 | + # exit 1 |
| 494 | + # fi |
| 495 | + # done |
482 | 496 | cd "$SAVEDPWD" |
483 | 497 | } |
484 | 498 |
|
@@ -513,7 +527,7 @@ BuildSysroot() { |
513 | 527 | StripChecksumsFromPackageList "$package_file" |
514 | 528 | InstallIntoSysroot ${files_and_sha256sums} |
515 | 529 | HacksAndPatches |
516 | | - # CleanupJailSymlinks |
| 530 | + CleanupJailSymlinks |
517 | 531 | # VerifyLibraryDeps |
518 | 532 | CreateTarBall |
519 | 533 | } |
|
0 commit comments