|
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 | ###################################################################### |
@@ -450,35 +453,44 @@ InstallIntoSysroot() { |
450 | 453 |
|
451 | 454 | CleanupJailSymlinks() { |
452 | 455 | Banner "Jail symlink cleanup" |
453 | | - |
454 | 456 | SAVEDPWD=$(pwd) |
455 | 457 | cd ${INSTALL_ROOT} |
456 | 458 | local libdirs="lib usr/lib" |
457 | 459 | if [ -d lib64 ]; then |
458 | 460 | libdirs="${libdirs} lib64" |
459 | 461 | fi |
460 | | - |
461 | 462 | find $libdirs -type l -printf '%p %l\n' | while read link target; do |
462 | 463 | # skip links with non-absolute paths |
463 | 464 | echo "${target}" | grep -qs ^/ || continue |
464 | 465 | 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}" |
| 466 | + case "${link}" in |
| 467 | + usr/lib/gcc/*-linux-gnu/4.*/* | usr/lib/gcc/arm-linux-gnueabihf/4.*/* | \ |
| 468 | + usr/lib/gcc/aarch64-linux-gnu/4.*/*) |
| 469 | + # Relativize the symlink. |
| 470 | + ln -snfv "../../../../..${target}" "${link}" |
| 471 | + ;; |
| 472 | + usr/lib/*-linux-gnu/* | usr/lib/arm-linux-gnueabihf/*) |
| 473 | + # Relativize the symlink. |
| 474 | + ln -snfv "../../..${target}" "${link}" |
| 475 | + ;; |
| 476 | + usr/lib/*) |
| 477 | + # Relativize the symlink. |
| 478 | + ln -snfv "../..${target}" "${link}" |
| 479 | + ;; |
| 480 | + lib64/* | lib/*) |
| 481 | + # Relativize the symlink." |
| 482 | + ln -snfv "..${target}" "${link}" |
| 483 | + ;; |
| 484 | + esac |
468 | 485 | done |
469 | | - |
470 | | - failed=0 |
471 | | - while read link target; do |
| 486 | + find $libdirs -type l -printf '%p %l\n' | while read link target; do |
472 | 487 | # Make sure we catch new bad links. |
473 | 488 | if [ ! -r "${link}" ]; then |
474 | 489 | echo "ERROR: FOUND BAD LINK ${link}" |
475 | 490 | ls -l ${link} |
476 | | - failed=1 |
| 491 | + #exit 1 |
477 | 492 | fi |
478 | | - done < <(find $libdirs -type l -printf '%p %l\n') |
479 | | - if [ $failed -eq 1 ]; then |
480 | | - exit 1 |
481 | | - fi |
| 493 | + done |
482 | 494 | cd "$SAVEDPWD" |
483 | 495 | } |
484 | 496 |
|
@@ -513,7 +525,7 @@ BuildSysroot() { |
513 | 525 | StripChecksumsFromPackageList "$package_file" |
514 | 526 | InstallIntoSysroot ${files_and_sha256sums} |
515 | 527 | HacksAndPatches |
516 | | - # CleanupJailSymlinks |
| 528 | + CleanupJailSymlinks |
517 | 529 | # VerifyLibraryDeps |
518 | 530 | CreateTarBall |
519 | 531 | } |
|
0 commit comments