Advertisement
Guest User

Yaboot Compile Fail

a guest
Mar 17th, 2015
493
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 101.06 KB | None | 0 0
  1. BUILD LOG
  2. [32;01m * Package: sys-boot/yaboot-1.3.17-r2
  3.  * Repository: gentoo
  4.  * Maintainer: ppc@gentoo.org ppc64@gentoo.org
  5.  * USE: abi_ppc_32 elibc_glibc kernel_linux ppc userland_GNU
  6.  * FEATURES: preserve-libs sandbox userpriv usersandbox
  7. >>> Unpacking source...
  8. >>> Unpacking yaboot-1.3.17.tar.gz to /var/tmp/portage/sys-boot/yaboot-1.3.17-r2/work
  9. >>> Source unpacked in /var/tmp/portage/sys-boot/yaboot-1.3.17-r2/work
  10. >>> Preparing source in /var/tmp/portage/sys-boot/yaboot-1.3.17-r2/work/yaboot-1.3.17 ...
  11. * Applying yabootconfig-1.3.13.patch ...
  12.  [ ok ]
  13. * Applying chrpfix.patch ...
  14.  [ ok ]
  15. * Applying yaboot-1.3.17-nopiessp-gcc4.patch ...
  16.  [ ok ]
  17. * Applying yaboot-stubfuncs.patch ...
  18.  [ ok ]
  19. * Applying new-ofpath-devspec.patch ...
  20.  [ ok ]
  21. >>> Source prepared.
  22. >>> Configuring source in /var/tmp/portage/sys-boot/yaboot-1.3.17-r2/work/yaboot-1.3.17 ...
  23. >>> Source configured.
  24. >>> Compiling source in /var/tmp/portage/sys-boot/yaboot-1.3.17-r2/work/yaboot-1.3.17 ...
  25. make -j2 PREFIX=/usr MANDIR=share/man CC=powerpc-unknown-linux-gnu-gcc
  26. powerpc-unknown-linux-gnu-gcc -Os -m32 -fno-stack-protector -nostdinc -Wall -isystem `powerpc-unknown-linux-gnu-gcc -m32 -print-file-name=include` -fsigned-char -DVERSION="\"1.3.17\"" -DTEXTADDR=0x100000 -DDEBUG=0 -DMALLOCADDR= -DMALLOCSIZE=0x100000 -DKERNELADDR=0x00000000 -Wno-error -fdiagnostics-show-option -I ./include -fno-strict-aliasing -DCONFIG_COLOR_TEXT -DCONFIG_SET_COLORMAP -DUSE_MD5_PASSWORDS -DCONFIG_FS_XFS -DCONFIG_FS_REISERFS -D__ASSEMBLY__ -c -o second/crt0.o second/crt0.S
  27. powerpc-unknown-linux-gnu-gcc -Os -m32 -fno-stack-protector -nostdinc -Wall -isystem `powerpc-unknown-linux-gnu-gcc -m32 -print-file-name=include` -fsigned-char -DVERSION="\"1.3.17\"" -DTEXTADDR=0x100000 -DDEBUG=0 -DMALLOCADDR= -DMALLOCSIZE=0x100000 -DKERNELADDR=0x00000000 -Wno-error -fdiagnostics-show-option -I ./include -fno-strict-aliasing -DCONFIG_COLOR_TEXT -DCONFIG_SET_COLORMAP -DUSE_MD5_PASSWORDS -DCONFIG_FS_XFS -DCONFIG_FS_REISERFS -c -o second/yaboot.o second/yaboot.c
  28. powerpc-unknown-linux-gnu-gcc -Os -m32 -fno-stack-protector -nostdinc -Wall -isystem `powerpc-unknown-linux-gnu-gcc -m32 -print-file-name=include` -fsigned-char -DVERSION="\"1.3.17\"" -DTEXTADDR=0x100000 -DDEBUG=0 -DMALLOCADDR= -DMALLOCSIZE=0x100000 -DKERNELADDR=0x00000000 -Wno-error -fdiagnostics-show-option -I ./include -fno-strict-aliasing -DCONFIG_COLOR_TEXT -DCONFIG_SET_COLORMAP -DUSE_MD5_PASSWORDS -DCONFIG_FS_XFS -DCONFIG_FS_REISERFS -D__ASSEMBLY__ -c -o second/cache.o second/cache.S
  29. second/yaboot.c: In function ‘setup_display’:
  30. second/yaboot.c:1510:13: warning: variable ‘result’ set but not used [-Wunused-but-set-variable]
  31. int i, result;
  32. ^
  33. powerpc-unknown-linux-gnu-gcc -Os -m32 -fno-stack-protector -nostdinc -Wall -isystem `powerpc-unknown-linux-gnu-gcc -m32 -print-file-name=include` -fsigned-char -DVERSION="\"1.3.17\"" -DTEXTADDR=0x100000 -DDEBUG=0 -DMALLOCADDR= -DMALLOCSIZE=0x100000 -DKERNELADDR=0x00000000 -Wno-error -fdiagnostics-show-option -I ./include -fno-strict-aliasing -DCONFIG_COLOR_TEXT -DCONFIG_SET_COLORMAP -DUSE_MD5_PASSWORDS -DCONFIG_FS_XFS -DCONFIG_FS_REISERFS -c -o second/prom.o second/prom.c
  34. second/yaboot.c: In function ‘yaboot_text_ui’:
  35. second/yaboot.c:1321:9: warning: ‘ph’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  36. if (ph)
  37. ^
  38. second/yaboot.c:1198:23: note: ‘ph’ was declared here
  39. Elf32_Phdr *p, *ph;
  40. ^
  41. second/yaboot.c:1453:9: warning: ‘ph’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  42. if (ph)
  43. ^
  44. second/yaboot.c:1331:23: note: ‘ph’ was declared here
  45. Elf64_Phdr *p, *ph;
  46. ^
  47. powerpc-unknown-linux-gnu-gcc -Os -m32 -fno-stack-protector -nostdinc -Wall -isystem `powerpc-unknown-linux-gnu-gcc -m32 -print-file-name=include` -fsigned-char -DVERSION="\"1.3.17\"" -DTEXTADDR=0x100000 -DDEBUG=0 -DMALLOCADDR= -DMALLOCSIZE=0x100000 -DKERNELADDR=0x00000000 -Wno-error -fdiagnostics-show-option -I ./include -fno-strict-aliasing -DCONFIG_COLOR_TEXT -DCONFIG_SET_COLORMAP -DUSE_MD5_PASSWORDS -DCONFIG_FS_XFS -DCONFIG_FS_REISERFS -c -o second/file.o second/file.c
  48. second/file.c: In function ‘open_file’:
  49. second/file.c:662:28: warning: argument to ‘sizeof’ in ‘memset’ call is the same pointer type ‘struct boot_file_t *’ as the destination; expected ‘struct boot_file_t’ or an explicit length [-Wsizeof-pointer-memaccess]
  50. memset(file, 0, sizeof(struct boot_file_t*));
  51. ^
  52. powerpc-unknown-linux-gnu-gcc -Os -m32 -fno-stack-protector -nostdinc -Wall -isystem `powerpc-unknown-linux-gnu-gcc -m32 -print-file-name=include` -fsigned-char -DVERSION="\"1.3.17\"" -DTEXTADDR=0x100000 -DDEBUG=0 -DMALLOCADDR= -DMALLOCSIZE=0x100000 -DKERNELADDR=0x00000000 -Wno-error -fdiagnostics-show-option -I ./include -fno-strict-aliasing -DCONFIG_COLOR_TEXT -DCONFIG_SET_COLORMAP -DUSE_MD5_PASSWORDS -DCONFIG_FS_XFS -DCONFIG_FS_REISERFS -c -o second/partition.o second/partition.c
  53. powerpc-unknown-linux-gnu-gcc -Os -m32 -fno-stack-protector -nostdinc -Wall -isystem `powerpc-unknown-linux-gnu-gcc -m32 -print-file-name=include` -fsigned-char -DVERSION="\"1.3.17\"" -DTEXTADDR=0x100000 -DDEBUG=0 -DMALLOCADDR= -DMALLOCSIZE=0x100000 -DKERNELADDR=0x00000000 -Wno-error -fdiagnostics-show-option -I ./include -fno-strict-aliasing -DCONFIG_COLOR_TEXT -DCONFIG_SET_COLORMAP -DUSE_MD5_PASSWORDS -DCONFIG_FS_XFS -DCONFIG_FS_REISERFS -c -o second/fs.o second/fs.c
  54. powerpc-unknown-linux-gnu-gcc -Os -m32 -fno-stack-protector -nostdinc -Wall -isystem `powerpc-unknown-linux-gnu-gcc -m32 -print-file-name=include` -fsigned-char -DVERSION="\"1.3.17\"" -DTEXTADDR=0x100000 -DDEBUG=0 -DMALLOCADDR= -DMALLOCSIZE=0x100000 -DKERNELADDR=0x00000000 -Wno-error -fdiagnostics-show-option -I ./include -fno-strict-aliasing -DCONFIG_COLOR_TEXT -DCONFIG_SET_COLORMAP -DUSE_MD5_PASSWORDS -DCONFIG_FS_XFS -DCONFIG_FS_REISERFS -c -o second/cfg.o second/cfg.c
  55. powerpc-unknown-linux-gnu-gcc -Os -m32 -fno-stack-protector -nostdinc -Wall -isystem `powerpc-unknown-linux-gnu-gcc -m32 -print-file-name=include` -fsigned-char -DVERSION="\"1.3.17\"" -DTEXTADDR=0x100000 -DDEBUG=0 -DMALLOCADDR= -DMALLOCSIZE=0x100000 -DKERNELADDR=0x00000000 -Wno-error -fdiagnostics-show-option -I ./include -fno-strict-aliasing -DCONFIG_COLOR_TEXT -DCONFIG_SET_COLORMAP -DUSE_MD5_PASSWORDS -DCONFIG_FS_XFS -DCONFIG_FS_REISERFS -D__ASSEMBLY__ -c -o second/setjmp.o second/setjmp.S
  56. powerpc-unknown-linux-gnu-gcc -Os -m32 -fno-stack-protector -nostdinc -Wall -isystem `powerpc-unknown-linux-gnu-gcc -m32 -print-file-name=include` -fsigned-char -DVERSION="\"1.3.17\"" -DTEXTADDR=0x100000 -DDEBUG=0 -DMALLOCADDR= -DMALLOCSIZE=0x100000 -DKERNELADDR=0x00000000 -Wno-error -fdiagnostics-show-option -I ./include -fno-strict-aliasing -DCONFIG_COLOR_TEXT -DCONFIG_SET_COLORMAP -DUSE_MD5_PASSWORDS -DCONFIG_FS_XFS -DCONFIG_FS_REISERFS -c -o second/cmdline.o second/cmdline.c
  57. powerpc-unknown-linux-gnu-gcc -Os -m32 -fno-stack-protector -nostdinc -Wall -isystem `powerpc-unknown-linux-gnu-gcc -m32 -print-file-name=include` -fsigned-char -DVERSION="\"1.3.17\"" -DTEXTADDR=0x100000 -DDEBUG=0 -DMALLOCADDR= -DMALLOCSIZE=0x100000 -DKERNELADDR=0x00000000 -Wno-error -fdiagnostics-show-option -I ./include -fno-strict-aliasing -DCONFIG_COLOR_TEXT -DCONFIG_SET_COLORMAP -DUSE_MD5_PASSWORDS -DCONFIG_FS_XFS -DCONFIG_FS_REISERFS -c -o second/fs_of.o second/fs_of.c
  58. powerpc-unknown-linux-gnu-gcc -Os -m32 -fno-stack-protector -nostdinc -Wall -isystem `powerpc-unknown-linux-gnu-gcc -m32 -print-file-name=include` -fsigned-char -DVERSION="\"1.3.17\"" -DTEXTADDR=0x100000 -DDEBUG=0 -DMALLOCADDR= -DMALLOCSIZE=0x100000 -DKERNELADDR=0x00000000 -Wno-error -fdiagnostics-show-option -I ./include -fno-strict-aliasing -DCONFIG_COLOR_TEXT -DCONFIG_SET_COLORMAP -DUSE_MD5_PASSWORDS -DCONFIG_FS_XFS -DCONFIG_FS_REISERFS -c -o second/fs_ext2.o second/fs_ext2.c
  59. powerpc-unknown-linux-gnu-gcc -Os -m32 -fno-stack-protector -nostdinc -Wall -isystem `powerpc-unknown-linux-gnu-gcc -m32 -print-file-name=include` -fsigned-char -DVERSION="\"1.3.17\"" -DTEXTADDR=0x100000 -DDEBUG=0 -DMALLOCADDR= -DMALLOCSIZE=0x100000 -DKERNELADDR=0x00000000 -Wno-error -fdiagnostics-show-option -I ./include -fno-strict-aliasing -DCONFIG_COLOR_TEXT -DCONFIG_SET_COLORMAP -DUSE_MD5_PASSWORDS -DCONFIG_FS_XFS -DCONFIG_FS_REISERFS -c -o second/fs_iso.o second/fs_iso.c
  60. powerpc-unknown-linux-gnu-gcc -Os -m32 -fno-stack-protector -nostdinc -Wall -isystem `powerpc-unknown-linux-gnu-gcc -m32 -print-file-name=include` -fsigned-char -DVERSION="\"1.3.17\"" -DTEXTADDR=0x100000 -DDEBUG=0 -DMALLOCADDR= -DMALLOCSIZE=0x100000 -DKERNELADDR=0x00000000 -Wno-error -fdiagnostics-show-option -I ./include -fno-strict-aliasing -DCONFIG_COLOR_TEXT -DCONFIG_SET_COLORMAP -DUSE_MD5_PASSWORDS -DCONFIG_FS_XFS -DCONFIG_FS_REISERFS -c -o second/fs_swap.o second/fs_swap.c
  61. second/fs_swap.c: In function ‘swap_open’:
  62. second/fs_swap.c:90:15: warning: unused variable ‘rc’ [-Wunused-variable]
  63. int rc = prom_readblocks(file->of_device, blk, BLKCOUNT, buffer);
  64. ^
  65. powerpc-unknown-linux-gnu-gcc -Os -m32 -fno-stack-protector -nostdinc -Wall -isystem `powerpc-unknown-linux-gnu-gcc -m32 -print-file-name=include` -fsigned-char -DVERSION="\"1.3.17\"" -DTEXTADDR=0x100000 -DDEBUG=0 -DMALLOCADDR= -DMALLOCSIZE=0x100000 -DKERNELADDR=0x00000000 -Wno-error -fdiagnostics-show-option -I ./include -fno-strict-aliasing -DCONFIG_COLOR_TEXT -DCONFIG_SET_COLORMAP -DUSE_MD5_PASSWORDS -DCONFIG_FS_XFS -DCONFIG_FS_REISERFS -c -o second/iso_util.o second/iso_util.c
  66. powerpc-unknown-linux-gnu-gcc -Os -m32 -fno-stack-protector -nostdinc -Wall -isystem `powerpc-unknown-linux-gnu-gcc -m32 -print-file-name=include` -fsigned-char -DVERSION="\"1.3.17\"" -DTEXTADDR=0x100000 -DDEBUG=0 -DMALLOCADDR= -DMALLOCSIZE=0x100000 -DKERNELADDR=0x00000000 -Wno-error -fdiagnostics-show-option -I ./include -fno-strict-aliasing -DCONFIG_COLOR_TEXT -DCONFIG_SET_COLORMAP -DUSE_MD5_PASSWORDS -DCONFIG_FS_XFS -DCONFIG_FS_REISERFS -c -o lib/nonstd.o lib/nonstd.c
  67. powerpc-unknown-linux-gnu-gcc -Os -m32 -fno-stack-protector -nostdinc -Wall -isystem `powerpc-unknown-linux-gnu-gcc -m32 -print-file-name=include` -fsigned-char -DVERSION="\"1.3.17\"" -DTEXTADDR=0x100000 -DDEBUG=0 -DMALLOCADDR= -DMALLOCSIZE=0x100000 -DKERNELADDR=0x00000000 -Wno-error -fdiagnostics-show-option -I ./include -fno-strict-aliasing -DCONFIG_COLOR_TEXT -DCONFIG_SET_COLORMAP -DUSE_MD5_PASSWORDS -DCONFIG_FS_XFS -DCONFIG_FS_REISERFS -c -o lib/nosys.o lib/nosys.c
  68. lib/nonstd.c: In function ‘exit’:
  69. lib/nonstd.c:102:1: warning: ‘noreturn’ function does return [enabled by default]
  70. }
  71. ^
  72. powerpc-unknown-linux-gnu-gcc -Os -m32 -fno-stack-protector -nostdinc -Wall -isystem `powerpc-unknown-linux-gnu-gcc -m32 -print-file-name=include` -fsigned-char -DVERSION="\"1.3.17\"" -DTEXTADDR=0x100000 -DDEBUG=0 -DMALLOCADDR= -DMALLOCSIZE=0x100000 -DKERNELADDR=0x00000000 -Wno-error -fdiagnostics-show-option -I ./include -fno-strict-aliasing -DCONFIG_COLOR_TEXT -DCONFIG_SET_COLORMAP -DUSE_MD5_PASSWORDS -DCONFIG_FS_XFS -DCONFIG_FS_REISERFS -D__ASSEMBLY__ -c -o lib/string.o lib/string.S
  73. powerpc-unknown-linux-gnu-gcc -Os -m32 -fno-stack-protector -nostdinc -Wall -isystem `powerpc-unknown-linux-gnu-gcc -m32 -print-file-name=include` -fsigned-char -DVERSION="\"1.3.17\"" -DTEXTADDR=0x100000 -DDEBUG=0 -DMALLOCADDR= -DMALLOCSIZE=0x100000 -DKERNELADDR=0x00000000 -Wno-error -fdiagnostics-show-option -I ./include -fno-strict-aliasing -DCONFIG_COLOR_TEXT -DCONFIG_SET_COLORMAP -DUSE_MD5_PASSWORDS -DCONFIG_FS_XFS -DCONFIG_FS_REISERFS -c -o lib/strtol.o lib/strtol.c
  74. powerpc-unknown-linux-gnu-gcc -Os -m32 -fno-stack-protector -nostdinc -Wall -isystem `powerpc-unknown-linux-gnu-gcc -m32 -print-file-name=include` -fsigned-char -DVERSION="\"1.3.17\"" -DTEXTADDR=0x100000 -DDEBUG=0 -DMALLOCADDR= -DMALLOCSIZE=0x100000 -DKERNELADDR=0x00000000 -Wno-error -fdiagnostics-show-option -I ./include -fno-strict-aliasing -DCONFIG_COLOR_TEXT -DCONFIG_SET_COLORMAP -DUSE_MD5_PASSWORDS -DCONFIG_FS_XFS -DCONFIG_FS_REISERFS -c -o lib/vsprintf.o lib/vsprintf.c
  75. powerpc-unknown-linux-gnu-gcc -Os -m32 -fno-stack-protector -nostdinc -Wall -isystem `powerpc-unknown-linux-gnu-gcc -m32 -print-file-name=include` -fsigned-char -DVERSION="\"1.3.17\"" -DTEXTADDR=0x100000 -DDEBUG=0 -DMALLOCADDR= -DMALLOCSIZE=0x100000 -DKERNELADDR=0x00000000 -Wno-error -fdiagnostics-show-option -I ./include -fno-strict-aliasing -DCONFIG_COLOR_TEXT -DCONFIG_SET_COLORMAP -DUSE_MD5_PASSWORDS -DCONFIG_FS_XFS -DCONFIG_FS_REISERFS -c -o lib/ctype.o lib/ctype.c
  76. powerpc-unknown-linux-gnu-gcc -Os -m32 -fno-stack-protector -nostdinc -Wall -isystem `powerpc-unknown-linux-gnu-gcc -m32 -print-file-name=include` -fsigned-char -DVERSION="\"1.3.17\"" -DTEXTADDR=0x100000 -DDEBUG=0 -DMALLOCADDR= -DMALLOCSIZE=0x100000 -DKERNELADDR=0x00000000 -Wno-error -fdiagnostics-show-option -I ./include -fno-strict-aliasing -DCONFIG_COLOR_TEXT -DCONFIG_SET_COLORMAP -DUSE_MD5_PASSWORDS -DCONFIG_FS_XFS -DCONFIG_FS_REISERFS -c -o lib/malloc.o lib/malloc.c
  77. powerpc-unknown-linux-gnu-gcc -Os -m32 -fno-stack-protector -nostdinc -Wall -isystem `powerpc-unknown-linux-gnu-gcc -m32 -print-file-name=include` -fsigned-char -DVERSION="\"1.3.17\"" -DTEXTADDR=0x100000 -DDEBUG=0 -DMALLOCADDR= -DMALLOCSIZE=0x100000 -DKERNELADDR=0x00000000 -Wno-error -fdiagnostics-show-option -I ./include -fno-strict-aliasing -DCONFIG_COLOR_TEXT -DCONFIG_SET_COLORMAP -DUSE_MD5_PASSWORDS -DCONFIG_FS_XFS -DCONFIG_FS_REISERFS -c -o lib/strstr.o lib/strstr.c
  78. powerpc-unknown-linux-gnu-gcc -Os -m32 -fno-stack-protector -nostdinc -Wall -isystem `powerpc-unknown-linux-gnu-gcc -m32 -print-file-name=include` -fsigned-char -DVERSION="\"1.3.17\"" -DTEXTADDR=0x100000 -DDEBUG=0 -DMALLOCADDR= -DMALLOCSIZE=0x100000 -DKERNELADDR=0x00000000 -Wno-error -fdiagnostics-show-option -I ./include -fno-strict-aliasing -DCONFIG_COLOR_TEXT -DCONFIG_SET_COLORMAP -DUSE_MD5_PASSWORDS -DCONFIG_FS_XFS -DCONFIG_FS_REISERFS -c -o lib/ssp.o lib/ssp.c
  79. powerpc-unknown-linux-gnu-gcc -Os -m32 -fno-stack-protector -nostdinc -Wall -isystem `powerpc-unknown-linux-gnu-gcc -m32 -print-file-name=include` -fsigned-char -DVERSION="\"1.3.17\"" -DTEXTADDR=0x100000 -DDEBUG=0 -DMALLOCADDR= -DMALLOCSIZE=0x100000 -DKERNELADDR=0x00000000 -Wno-error -fdiagnostics-show-option -I ./include -fno-strict-aliasing -DCONFIG_COLOR_TEXT -DCONFIG_SET_COLORMAP -DUSE_MD5_PASSWORDS -DCONFIG_FS_XFS -DCONFIG_FS_REISERFS -c -o second/md5.o second/md5.c
  80. powerpc-unknown-linux-gnu-gcc -Os -m32 -fno-stack-protector -nostdinc -Wall -isystem `powerpc-unknown-linux-gnu-gcc -m32 -print-file-name=include` -fsigned-char -DVERSION="\"1.3.17\"" -DTEXTADDR=0x100000 -DDEBUG=0 -DMALLOCADDR= -DMALLOCSIZE=0x100000 -DKERNELADDR=0x00000000 -Wno-error -fdiagnostics-show-option -I ./include -fno-strict-aliasing -DCONFIG_COLOR_TEXT -DCONFIG_SET_COLORMAP -DUSE_MD5_PASSWORDS -DCONFIG_FS_XFS -DCONFIG_FS_REISERFS -c -o second/fs_xfs.o second/fs_xfs.c
  81. powerpc-unknown-linux-gnu-gcc -Os -m32 -fno-stack-protector -nostdinc -Wall -isystem `powerpc-unknown-linux-gnu-gcc -m32 -print-file-name=include` -fsigned-char -DVERSION="\"1.3.17\"" -DTEXTADDR=0x100000 -DDEBUG=0 -DMALLOCADDR= -DMALLOCSIZE=0x100000 -DKERNELADDR=0x00000000 -Wno-error -fdiagnostics-show-option -I ./include -fno-strict-aliasing -DCONFIG_COLOR_TEXT -DCONFIG_SET_COLORMAP -DUSE_MD5_PASSWORDS -DCONFIG_FS_XFS -DCONFIG_FS_REISERFS -c -o second/fs_reiserfs.o second/fs_reiserfs.c
  82. In file included from ./include/byteorder.h:4:0,
  83. from ./include/reiserfs/reiserfs.h:3,
  84. from second/fs_reiserfs.c:33:
  85. second/fs_reiserfs.c: In function ‘block_read’:
  86. ./include/swab.h:12:5: warning: operation on ‘*journal_table’ may be undefined [-Wsequence-point]
  87. (((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \
  88. ^
  89. ./include/byteorder.h:8:26: note: in expansion of macro ‘swab32’
  90. # define le32_to_cpu(x) swab32((x))
  91. ^
  92. second/fs_reiserfs.c:221:17: note: in expansion of macro ‘le32_to_cpu’
  93. j_len = le32_to_cpu((*journal_table)++);
  94. ^
  95. ./include/swab.h:12:5: warning: operation on ‘*journal_table’ may be undefined [-Wsequence-point]
  96. (((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \
  97. ^
  98. ./include/byteorder.h:8:26: note: in expansion of macro ‘swab32’
  99. # define le32_to_cpu(x) swab32((x))
  100. ^
  101. second/fs_reiserfs.c:221:17: note: in expansion of macro ‘le32_to_cpu’
  102. j_len = le32_to_cpu((*journal_table)++);
  103. ^
  104. ./include/swab.h:12:5: warning: operation on ‘*journal_table’ may be undefined [-Wsequence-point]
  105. (((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \
  106. ^
  107. ./include/byteorder.h:8:26: note: in expansion of macro ‘swab32’
  108. # define le32_to_cpu(x) swab32((x))
  109. ^
  110. second/fs_reiserfs.c:221:17: note: in expansion of macro ‘le32_to_cpu’
  111. j_len = le32_to_cpu((*journal_table)++);
  112. ^
  113. second/fs_reiserfs.c:224:38: warning: operation on ‘journal_table’ may be undefined [-Wsequence-point]
  114. if ( le32_to_cpu(*journal_table++) == blockNr )
  115. ^
  116. ./include/swab.h:12:13: note: in definition of macro ‘swab32’
  117. (((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \
  118. ^
  119. second/fs_reiserfs.c:224:12: note: in expansion of macro ‘le32_to_cpu’
  120. if ( le32_to_cpu(*journal_table++) == blockNr )
  121. ^
  122. second/fs_reiserfs.c:224:38: warning: operation on ‘journal_table’ may be undefined [-Wsequence-point]
  123. if ( le32_to_cpu(*journal_table++) == blockNr )
  124. ^
  125. ./include/swab.h:12:13: note: in definition of macro ‘swab32’
  126. (((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \
  127. ^
  128. second/fs_reiserfs.c:224:12: note: in expansion of macro ‘le32_to_cpu’
  129. if ( le32_to_cpu(*journal_table++) == blockNr )
  130. ^
  131. second/fs_reiserfs.c:224:38: warning: operation on ‘journal_table’ may be undefined [-Wsequence-point]
  132. if ( le32_to_cpu(*journal_table++) == blockNr )
  133. ^
  134. ./include/swab.h:12:13: note: in definition of macro ‘swab32’
  135. (((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \
  136. ^
  137. second/fs_reiserfs.c:224:12: note: in expansion of macro ‘le32_to_cpu’
  138. if ( le32_to_cpu(*journal_table++) == blockNr )
  139. ^
  140. second/fs_reiserfs.c:243:42: warning: operation on ‘i’ may be undefined [-Wsequence-point]
  141. if ( le32_to_cpu(desc.j_realblock[i++]) == blockNr )
  142. ^
  143. ./include/swab.h:12:13: note: in definition of macro ‘swab32’
  144. (((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \
  145. ^
  146. second/fs_reiserfs.c:243:12: note: in expansion of macro ‘le32_to_cpu’
  147. if ( le32_to_cpu(desc.j_realblock[i++]) == blockNr )
  148. ^
  149. second/fs_reiserfs.c:243:42: warning: operation on ‘i’ may be undefined [-Wsequence-point]
  150. if ( le32_to_cpu(desc.j_realblock[i++]) == blockNr )
  151. ^
  152. ./include/swab.h:12:13: note: in definition of macro ‘swab32’
  153. (((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \
  154. ^
  155. second/fs_reiserfs.c:243:12: note: in expansion of macro ‘le32_to_cpu’
  156. if ( le32_to_cpu(desc.j_realblock[i++]) == blockNr )
  157. ^
  158. second/fs_reiserfs.c:243:42: warning: operation on ‘i’ may be undefined [-Wsequence-point]
  159. if ( le32_to_cpu(desc.j_realblock[i++]) == blockNr )
  160. ^
  161. ./include/swab.h:12:13: note: in definition of macro ‘swab32’
  162. (((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \
  163. ^
  164. second/fs_reiserfs.c:243:12: note: in expansion of macro ‘le32_to_cpu’
  165. if ( le32_to_cpu(desc.j_realblock[i++]) == blockNr )
  166. ^
  167. second/fs_reiserfs.c:255:42: warning: operation on ‘i’ may be undefined [-Wsequence-point]
  168. if ( le32_to_cpu(commit.j_realblock[i++ - JOURNAL_TRANS_HALF]) == blockNr )
  169. ^
  170. ./include/swab.h:12:13: note: in definition of macro ‘swab32’
  171. (((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \
  172. ^
  173. second/fs_reiserfs.c:255:10: note: in expansion of macro ‘le32_to_cpu’
  174. if ( le32_to_cpu(commit.j_realblock[i++ - JOURNAL_TRANS_HALF]) == blockNr )
  175. ^
  176. second/fs_reiserfs.c:255:42: warning: operation on ‘i’ may be undefined [-Wsequence-point]
  177. if ( le32_to_cpu(commit.j_realblock[i++ - JOURNAL_TRANS_HALF]) == blockNr )
  178. ^
  179. ./include/swab.h:12:13: note: in definition of macro ‘swab32’
  180. (((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \
  181. ^
  182. second/fs_reiserfs.c:255:10: note: in expansion of macro ‘le32_to_cpu’
  183. if ( le32_to_cpu(commit.j_realblock[i++ - JOURNAL_TRANS_HALF]) == blockNr )
  184. ^
  185. second/fs_reiserfs.c:255:42: warning: operation on ‘i’ may be undefined [-Wsequence-point]
  186. if ( le32_to_cpu(commit.j_realblock[i++ - JOURNAL_TRANS_HALF]) == blockNr )
  187. ^
  188. ./include/swab.h:12:13: note: in definition of macro ‘swab32’
  189. (((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \
  190. ^
  191. second/fs_reiserfs.c:255:10: note: in expansion of macro ‘le32_to_cpu’
  192. if ( le32_to_cpu(commit.j_realblock[i++ - JOURNAL_TRANS_HALF]) == blockNr )
  193. ^
  194. powerpc-unknown-linux-gnu-gcc -Os -fno-stack-protector -Wall -I/usr/include -Wno-error -fdiagnostics-show-option -o util/addnote util/addnote.c
  195. ln -sf ybin ybin/mkofboot
  196. ld -Ttext 0x100000 -Bstatic -melf32ppclinux second/crt0.o second/yaboot.o second/cache.o second/prom.o second/file.o second/partition.o second/fs.o second/cfg.o second/setjmp.o second/cmdline.o second/fs_of.o second/fs_ext2.o second/fs_iso.o second/fs_swap.o second/iso_util.o lib/nonstd.o lib/nosys.o lib/string.o lib/strtol.o lib/vsprintf.o lib/ctype.o lib/malloc.o lib/strstr.o lib/ssp.o second/md5.o second/fs_xfs.o second/fs_reiserfs.o -lext2fs `powerpc-unknown-linux-gnu-gcc -m32 -print-libgcc-file-name` -o second/yaboot
  197. /usr/lib/libext2fs.a(unix_io.o): In function `raw_write_blk':
  198. (.text+0x1b0): undefined reference to `pwrite64'
  199. /usr/lib/libext2fs.a(unix_io.o): In function `raw_read_blk':
  200. (.text+0x630): undefined reference to `pread64'
  201. /usr/lib/libext2fs.a(unix_io.o): In function `unix_open.part.9':
  202. (.text+0x18ec): undefined reference to `__stack_chk_fail'
  203. Makefile:112: recipe for target 'yaboot' failed
  204. make: *** [yaboot] Error 1
  205. emake failed
  206. * ERROR: sys-boot/yaboot-1.3.17-r2::gentoo failed (compile phase):
  207. * (no error message)
  208. *
  209. * Call stack:
  210. * ebuild.sh, line 93: Called src_compile
  211. * environment, line 1846: Called die
  212. * The specific snippet of code:
  213. * emake PREFIX=/usr MANDIR=share/man CC="$(tc-getCC)" || die
  214. *
  215. * If you need support, post the output of `emerge --info '=sys-boot/yaboot-1.3.17-r2::gentoo'`,
  216. * the complete build log and the output of `emerge -pqv '=sys-boot/yaboot-1.3.17-r2::gentoo'`.
  217. * The complete build log is located at '/var/tmp/portage/sys-boot/yaboot-1.3.17-r2/temp/build.log'.
  218. * The ebuild environment file is located at '/var/tmp/portage/sys-boot/yaboot-1.3.17-r2/temp/environment'.
  219. * Working directory: '/var/tmp/portage/sys-boot/yaboot-1.3.17-r2/work/yaboot-1.3.17'
  220. * S: '/var/tmp/portage/sys-boot/yaboot-1.3.17-r2/work/yaboot-1.3.17'
  221.  
  222. ENVIROMENT
  223.  
  224. declare -x ABI="ppc"
  225. declare -x ABI_PPC="32"
  226. declare -x ALSA_CARDS=""
  227. declare -x APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias"
  228. declare -x ARCH="ppc"
  229. declare -x BOOTSTRAP_USE="cxx unicode internal-glib python_targets_python3_3 python_targets_python2_7"
  230. declare -x CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author"
  231. declare -x CAMERAS="ptp2"
  232. declare -x CBUILD="powerpc-unknown-linux-gnu"
  233. declare -x CFLAGS="-O2 -mcpu=powerpc -mtune=powerpc"
  234. declare -x CFLAGS_default
  235. declare -x CHOST="powerpc-unknown-linux-gnu"
  236. declare -x CHOST_default="powerpc-unknown-linux-gnu"
  237. declare -x CHOST_ppc="powerpc-unknown-linux-gnu"
  238. declare -x COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog"
  239. declare -x CTARGET_default="powerpc-unknown-linux-gnu"
  240. declare -x CXXFLAGS="-O2 -mcpu=powerpc -mtune=powerpc"
  241. declare -x DEFAULT_ABI="ppc"
  242. declare -x DEFINED_PHASES=" compile install prepare unpack"
  243. declare DEPEND="sys-apps/powerpc-utils
  244. sys-fs/e2fsprogs[static-libs] "
  245. declare DESCRIPTION="PPC Bootloader"
  246. declare -x DESTTREE="/usr"
  247. declare -x DIROPTIONS="-m0755"
  248. declare -x EAPI="2"
  249. declare -x ELIBC="glibc"
  250. declare -- EPATCH_COMMON_OPTS="-g0 -E --no-backup-if-mismatch"
  251. declare -- EPATCH_EXCLUDE=""
  252. declare -- EPATCH_FORCE="no"
  253. declare -- EPATCH_MULTI_MSG="Applying various patches (bugfixes/updates) ..."
  254. declare -- EPATCH_OPTS=""
  255. declare -- EPATCH_SINGLE_MSG=""
  256. declare -- EPATCH_SOURCE="/var/tmp/portage/sys-boot/yaboot-1.3.17-r2/work/patch"
  257. declare -- EPATCH_SUFFIX="patch.bz2"
  258. declare -x EXEOPTIONS="-m0755"
  259. declare -x FCFLAGS="-O2 -pipe"
  260. declare -x FETCHCOMMAND_SSH="bash -c \"x=\\\${2#ssh://} ; host=\\\${x%%/*} ; port=\\\${host##*:} ; host=\\\${host%:*} ; [[ \\\${host} = \\\${port} ]] && port=22 ; exec rsync --rsh=\\\"ssh -p\\\${port} \\\${3}\\\" -avP \\\"\\\${host}:/\\\${x#*/}\\\" \\\"\\\$1\\\"\" rsync \"\${DISTDIR}/\${FILE}\" \"\${URI}\" \"\${PORTAGE_SSH_OPTS}\""
  261. declare -x FFLAGS="-O2 -pipe"
  262. declare -x GCC_SPECS=""
  263. declare -x GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx"
  264. declare -x GRUB_PLATFORMS=""
  265. declare HDEPEND=""
  266. declare HOMEPAGE="http://yaboot.ozlabs.org"
  267. declare -x INHERITED=" multilib toolchain-funcs eutils"
  268. declare -x INPUT_DEVICES=""
  269. declare -x INSDESTTREE=""
  270. declare -x INSOPTIONS="-m0644"
  271. declare IUSE="ibm "
  272. declare -x IUSE_IMPLICIT="abi_ppc_32 prefix prefix-guest"
  273. declare -x KERNEL="linux"
  274. declare -x KERNEL_ABI="ppc"
  275. declare -x KEYWORDS="-* ppc -ppc64"
  276. declare -x KV="3.17.8-gentoo-r1"
  277. declare -x LANG="en_US.utf8"
  278. declare -x LCD_DEVICES=""
  279. declare -x LC_CTYPE="en_US.UTF-8"
  280. declare -x LC_MESSAGES="C"
  281. declare -x LDFLAGS="-Wl,-O1 -Wl,--as-needed"
  282. declare -x LDFLAGS_default
  283. declare -x LIBDIR_default="lib"
  284. declare -x LIBDIR_ppc="lib"
  285. declare -x LIBOPTIONS="-m0644"
  286. declare -x LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer"
  287. declare -x LICENSE="GPL-2"
  288. declare -x MAIL="/var/mail/root"
  289. declare -x MAKEOPTS="-j2"
  290. declare -x MULTILIB_ABIS="ppc"
  291. declare -x MULTIOSDIRS="../lib"
  292. declare -x NETBEANS="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml"
  293. declare -x OFFICE_IMPLEMENTATION="libreoffice"
  294. declare -x PATH="/usr/lib/portage/python2.7/ebuild-helpers:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/powerpc-unknown-linux-gnu/gcc-bin/4.8.3"
  295. declare PDEPEND=""
  296. declare -x PHP_TARGETS=""
  297. declare -x PKG_CONFIG_PATH="/usr/lib/pkgconfig"
  298. declare -a PORTAGE_DOCOMPRESS='([0]="/usr/share/doc" [1]="/usr/share/info" [2]="/usr/share/man")'
  299. declare -x PORTAGE_DOCOMPRESS_SIZE_LIMIT="128"
  300. declare -a PORTAGE_DOCOMPRESS_SKIP='([0]="/usr/share/doc/yaboot-1.3.17-r2/html")'
  301. declare -x PROFILE_ONLY_VARIABLES="ARCH ELIBC IUSE_IMPLICIT KERNEL USERLAND USE_EXPAND_IMPLICIT USE_EXPAND_UNPREFIXED USE_EXPAND_VALUES_ARCH USE_EXPAND_VALUES_ELIBC USE_EXPAND_VALUES_KERNEL USE_EXPAND_VALUES_USERLAND"
  302. declare -x PROPERTIES=""
  303. declare -x PROVIDE=""
  304. declare -x PYTHONDONTWRITEBYTECODE="1"
  305. declare -x PYTHON_SINGLE_TARGET=""
  306. declare -x PYTHON_TARGETS=""
  307. declare -x RDEPEND="!ibm? ( sys-fs/hfsutils
  308. sys-fs/hfsplusutils
  309. sys-fs/mac-fdisk ) "
  310. declare REPOSITORY
  311. declare REQUIRED_USE=""
  312. declare -x RESTRICT=""
  313. declare -x RESUMECOMMAND_SSH="bash -c \"x=\\\${2#ssh://} ; host=\\\${x%%/*} ; port=\\\${host##*:} ; host=\\\${host%:*} ; [[ \\\${host} = \\\${port} ]] && port=22 ; exec rsync --rsh=\\\"ssh -p\\\${port} \\\${3}\\\" -avP \\\"\\\${host}:/\\\${x#*/}\\\" \\\"\\\$1\\\"\" rsync \"\${DISTDIR}/\${FILE}\" \"\${URI}\" \"\${PORTAGE_SSH_OPTS}\""
  314. declare -x RUBYOPT="-rauto_gem"
  315. declare -x RUBY_TARGETS=""
  316. declare -x S="/var/tmp/portage/sys-boot/yaboot-1.3.17-r2/work/yaboot-1.3.17"
  317. declare -x SANDBOX_DEBUG="0"
  318. declare -x SANDBOX_DENY=""
  319. declare -x SANDBOX_PID="17336"
  320. declare -x SANDBOX_PREDICT="/var/tmp/portage/sys-boot/yaboot-1.3.17-r2/homedir:/dev/crypto"
  321. declare -x SANDBOX_READ="/:/var/tmp"
  322. declare -x SANDBOX_VERBOSE="1"
  323. declare -x SANDBOX_WRITE=":/dev/console:/dev/fd:/dev/full:/dev/null:/dev/pts/:/dev/pty:/dev/shm:/dev/tts:/dev/tty:/dev/vc/:/dev/zero:/proc/self/fd:/tmp/:/usr/lib32/cf:/usr/lib32/conftest:/usr/lib64/cf:/usr/lib64/conftest:/usr/lib/cf:/usr/lib/conftest:/usr/tmp/cf:/usr/tmp/conftest:/var/tmp:/var/tmp/:/var/tmp/portage/sys-boot/yaboot-1.3.17-r2/homedir/.bash_history"
  324. declare -x SHELL="/bin/bash"
  325. declare -x SLOT="0"
  326. declare SRC_URI="http://yaboot.ozlabs.org/releases/yaboot-1.3.17.tar.gz"
  327. declare -x SSH_CLIENT="10.5.19.98 51436 22"
  328. declare -x SSH_CONNECTION="10.5.19.98 51436 128.151.143.42 22"
  329. declare -x SSH_TTY="/dev/pts/0"
  330. declare -x SYSTEMD_LESS="FRSM --shift 5"
  331. declare -x USE="abi_ppc_32 elibc_glibc kernel_linux ppc userland_GNU"
  332. declare -x USERLAND="GNU"
  333. declare -x USE_EXPAND_IMPLICIT="ARCH ELIBC KERNEL USERLAND"
  334. declare -x USE_EXPAND_UNPREFIXED="ARCH"
  335. declare -x USE_EXPAND_VALUES_ARCH="alpha amd64 amd64-fbsd amd64-linux arm arm-linux arm64 hppa hppa-hpux ia64 ia64-hpux ia64-linux m68k m68k-mint mips ppc ppc64 ppc64-linux ppc-aix ppc-macos ppc-openbsd s390 sh sparc sparc64-freebsd sparc64-solaris sparc-fbsd sparc-solaris x64-freebsd x64-macos x64-openbsd x64-solaris x86 x86-cygwin x86-fbsd x86-freebsd x86-interix x86-linux x86-macos x86-netbsd x86-openbsd x86-solaris x86-winnt"
  336. declare -x USE_EXPAND_VALUES_ELIBC="AIX Cygwin Darwin DragonFly FreeBSD glibc HPUX Interix mintlib musl NetBSD OpenBSD SunOS uclibc Winnt"
  337. declare -x USE_EXPAND_VALUES_KERNEL="AIX Cygwin Darwin FreeBSD freemint HPUX Interix linux NetBSD OpenBSD SunOS Winnt"
  338. declare -x USE_EXPAND_VALUES_USERLAND="BSD GNU"
  339. declare -x VIDEO_CARDS=""
  340. declare -x XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
  341. declare -- _EUTILS_ECLASS="1"
  342. declare -x _E_DOCDESTTREE_=""
  343. declare -x _E_EXEDESTTREE_=""
  344. declare -- _MULTILIB_ECLASS="1"
  345. declare -- _TOOLCHAIN_FUNCS_ECLASS="1"
  346. declare -- phase_func
  347. __bashpid ()
  348. {
  349. sh -c 'echo ${PPID}'
  350. }
  351. __start_distcc ()
  352. {
  353. if has distcc $FEATURES && has distcc-pump $FEATURES; then
  354. if [[ -z $INCLUDE_SERVER_PORT ]] || [[ ! -w $INCLUDE_SERVER_PORT ]]; then
  355. eval $(pump --startup | grep -v PATH);
  356. trap "pump --shutdown >/dev/null" EXIT;
  357. fi;
  358. fi
  359. }
  360. _epatch_draw_line ()
  361. {
  362. [[ -z $1 ]] && set "$(printf "%65s" '')";
  363. echo "${1//?/=}"
  364. }
  365. _eutils_eprefix_init ()
  366. {
  367. has "${EAPI:-0}" 0 1 2 && : ${ED:=${D}} ${EPREFIX:=} ${EROOT:=${ROOT}}
  368. }
  369. _gcc-install-dir ()
  370. {
  371. echo "$(LC_ALL=C $(tc-getCC) -print-search-dirs 2> /dev/null | awk '$1=="install:" {print $2}')"
  372. }
  373. _gcc-specs-directive_raw ()
  374. {
  375. local cc=$(tc-getCC);
  376. local specfiles=$(LC_ALL=C ${cc} -v 2>&1 | awk '$1=="Reading" {print $NF}');
  377. ${cc} -dumpspecs 2> /dev/null | cat - ${specfiles} | awk -v directive=$1 'BEGIN { pspec=""; spec=""; outside=1 }
  378. $1=="*"directive":" { pspec=spec; spec=""; outside=0; next }
  379. outside || NF==0 || ( substr($1,1,1)=="*" && substr($1,length($1),1)==":" ) { outside=1; next }
  380. spec=="" && substr($0,1,1)=="+" { spec=pspec " " substr($0,2); next }
  381. { spec=spec $0 }
  382. END { print spec }';
  383. return 0
  384. }
  385. _gcc-specs-exists ()
  386. {
  387. [[ -f $(_gcc-install-dir)/$1 ]]
  388. }
  389. _gcc_fullversion ()
  390. {
  391. local ver="$1";
  392. shift;
  393. set -- `$(tc-getCPP "$@") -E -P - <<<"__GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__"`;
  394. eval echo "$ver"
  395. }
  396. _iconins ()
  397. {
  398. ( local funcname=$1;
  399. shift;
  400. local size dir;
  401. local context=apps;
  402. local theme=hicolor;
  403. while [[ $# -gt 0 ]]; do
  404. case $1 in
  405. -s | --size)
  406. if [[ ${2%%x*}x${2%%x*} == "$2" ]]; then
  407. size=${2%%x*};
  408. else
  409. size=${2};
  410. fi;
  411. case ${size} in
  412. 16 | 22 | 24 | 32 | 36 | 48 | 64 | 72 | 96 | 128 | 192 | 256 | 512)
  413. size=${size}x${size}
  414. ;;
  415. scalable)
  416.  
  417. ;;
  418. *)
  419. eerror "${size} is an unsupported icon size!";
  420. exit 1
  421. ;;
  422. esac;
  423. shift 2
  424. ;;
  425. -t | --theme)
  426. theme=${2};
  427. shift 2
  428. ;;
  429. -c | --context)
  430. context=${2};
  431. shift 2
  432. ;;
  433. *)
  434. if [[ -z ${size} ]]; then
  435. insinto /usr/share/pixmaps;
  436. else
  437. insinto /usr/share/icons/${theme}/${size}/${context};
  438. fi;
  439. if [[ ${funcname} == doicon ]]; then
  440. if [[ -f $1 ]]; then
  441. doins "${1}";
  442. else
  443. if [[ -d $1 ]]; then
  444. shopt -s nullglob;
  445. doins "${1}"/*.{png,svg};
  446. shopt -u nullglob;
  447. else
  448. eerror "${1} is not a valid file/directory!";
  449. exit 1;
  450. fi;
  451. fi;
  452. else
  453. break;
  454. fi;
  455. shift 1
  456. ;;
  457. esac;
  458. done;
  459. if [[ ${funcname} == newicon ]]; then
  460. newins "$@";
  461. fi ) || die
  462. }
  463. _tc-getPROG ()
  464. {
  465. local tuple=$1;
  466. local v var vars=$2;
  467. local prog=$3;
  468. var=${vars%% *};
  469. for v in ${vars};
  470. do
  471. if [[ -n ${!v} ]]; then
  472. export ${var}="${!v}";
  473. echo "${!v}";
  474. return 0;
  475. fi;
  476. done;
  477. local search=;
  478. [[ -n $4 ]] && search=$(type -p "$4-${prog}");
  479. [[ -z ${search} && -n ${!tuple} ]] && search=$(type -p "${!tuple}-${prog}");
  480. [[ -n ${search} ]] && prog=${search##*/};
  481. export ${var}=${prog};
  482. echo "${!var}"
  483. }
  484. built_with_use ()
  485. {
  486. _eutils_eprefix_init;
  487. local hidden="no";
  488. if [[ $1 == "--hidden" ]]; then
  489. hidden="yes";
  490. shift;
  491. fi;
  492. local missing_action="die";
  493. if [[ $1 == "--missing" ]]; then
  494. missing_action=$2;
  495. shift;
  496. shift;
  497. case ${missing_action} in
  498. true | false | die)
  499.  
  500. ;;
  501. *)
  502. die "unknown action '${missing_action}'"
  503. ;;
  504. esac;
  505. fi;
  506. local opt=$1;
  507. [[ ${opt:0:1} = "-" ]] && shift || opt="-a";
  508. local PKG=$(best_version $1);
  509. [[ -z ${PKG} ]] && die "Unable to resolve $1 to an installed package";
  510. shift;
  511. local USEFILE=${EROOT}/var/db/pkg/${PKG}/USE;
  512. local IUSEFILE=${EROOT}/var/db/pkg/${PKG}/IUSE;
  513. if [[ ! -e ${USEFILE} ]] || [[ ! -e ${IUSEFILE} && ${hidden} == "no" ]]; then
  514. case ${missing_action} in
  515. true)
  516. return 0
  517. ;;
  518. false)
  519. return 1
  520. ;;
  521. die)
  522. die "Unable to determine what USE flags $PKG was built with"
  523. ;;
  524. esac;
  525. fi;
  526. if [[ ${hidden} == "no" ]]; then
  527. local IUSE_BUILT=($(<"${IUSEFILE}"));
  528. local expand;
  529. for expand in $(echo ${USE_EXPAND} | tr '[:upper:]' '[:lower:]');
  530. do
  531. if [[ $1 == ${expand}_* ]]; then
  532. expand="";
  533. break;
  534. fi;
  535. done;
  536. if [[ -n ${expand} ]]; then
  537. if ! has $1 ${IUSE_BUILT[@]#[-+]}; then
  538. case ${missing_action} in
  539. true)
  540. return 0
  541. ;;
  542. false)
  543. return 1
  544. ;;
  545. die)
  546. die "$PKG does not actually support the $1 USE flag!"
  547. ;;
  548. esac;
  549. fi;
  550. fi;
  551. fi;
  552. local USE_BUILT=$(<${USEFILE});
  553. while [[ $# -gt 0 ]]; do
  554. if [[ ${opt} = "-o" ]]; then
  555. has $1 ${USE_BUILT} && return 0;
  556. else
  557. has $1 ${USE_BUILT} || return 1;
  558. fi;
  559. shift;
  560. done;
  561. [[ ${opt} = "-a" ]]
  562. }
  563. check_license ()
  564. {
  565. die "you no longer need this as portage supports ACCEPT_LICENSE itself"
  566. }
  567. doicon ()
  568. {
  569. _iconins ${FUNCNAME} "$@"
  570. }
  571. domenu ()
  572. {
  573. ( local i j ret=0;
  574. insinto /usr/share/applications;
  575. for i in "$@";
  576. do
  577. if [[ -f ${i} ]]; then
  578. doins "${i}";
  579. ((ret+=$?));
  580. else
  581. if [[ -d ${i} ]]; then
  582. for j in "${i}"/*.desktop;
  583. do
  584. doins "${j}";
  585. ((ret+=$?));
  586. done;
  587. else
  588. ((++ret));
  589. fi;
  590. fi;
  591. done;
  592. exit ${ret} )
  593. }
  594. ebeep ()
  595. {
  596. local n;
  597. if [[ -z ${EBEEP_IGNORE} ]]; then
  598. for ((n=1 ; n <= ${1:-5} ; n++))
  599. do
  600. echo -ne "\a";
  601. sleep 0.1 &>/dev/null;
  602. sleep 0,1 &>/dev/null;
  603. echo -ne "\a";
  604. sleep 1;
  605. done;
  606. fi
  607. }
  608. econf_build ()
  609. {
  610. local CBUILD=${CBUILD:-${CHOST}};
  611. tc-env_build econf --build=${CBUILD} --host=${CBUILD} "$@"
  612. }
  613. ecvs_clean ()
  614. {
  615. [[ -z $* ]] && set -- .;
  616. find "$@" -type d -name 'CVS' -prune -print0 | xargs -0 rm -rf;
  617. find "$@" -type f -name '.cvs*' -print0 | xargs -0 rm -rf
  618. }
  619. edos2unix ()
  620. {
  621. [[ $# -eq 0 ]] && return 0;
  622. sed -i 's/\r$//' -- "$@" || die
  623. }
  624. einstalldocs ()
  625. {
  626. debug-print-function ${FUNCNAME} "${@}";
  627. local dodoc_opts=-r;
  628. has ${EAPI} 0 1 2 3 && dodoc_opts=;
  629. if ! declare -p DOCS &>/dev/null; then
  630. local d;
  631. for d in README* ChangeLog AUTHORS NEWS TODO CHANGES THANKS BUGS FAQ CREDITS CHANGELOG;
  632. do
  633. if [[ -s ${d} ]]; then
  634. dodoc "${d}" || die;
  635. fi;
  636. done;
  637. else
  638. if [[ $(declare -p DOCS) == "declare -a"* ]]; then
  639. if [[ -n ${DOCS[@]} ]]; then
  640. dodoc ${dodoc_opts} "${DOCS[@]}" || die;
  641. fi;
  642. else
  643. if [[ -n ${DOCS} ]]; then
  644. dodoc ${dodoc_opts} ${DOCS} || die;
  645. fi;
  646. fi;
  647. fi;
  648. if [[ $(declare -p HTML_DOCS 2>/dev/null) == "declare -a"* ]]; then
  649. if [[ -n ${HTML_DOCS[@]} ]]; then
  650. dohtml -r "${HTML_DOCS[@]}" || die;
  651. fi;
  652. else
  653. if [[ -n ${HTML_DOCS} ]]; then
  654. dohtml -r ${HTML_DOCS} || die;
  655. fi;
  656. fi;
  657. return 0
  658. }
  659. emktemp ()
  660. {
  661. local exe="touch";
  662. [[ $1 == -d ]] && exe="mkdir" && shift;
  663. local topdir=$1;
  664. if [[ -z ${topdir} ]]; then
  665. [[ -z ${T} ]] && topdir="/tmp" || topdir=${T};
  666. fi;
  667. if ! type -P mktemp > /dev/null; then
  668. local tmp=/;
  669. while [[ -e ${tmp} ]]; do
  670. tmp=${topdir}/tmp.${RANDOM}.${RANDOM}.${RANDOM};
  671. done;
  672. ${exe} "${tmp}" || ${exe} -p "${tmp}";
  673. echo "${tmp}";
  674. else
  675. if [[ ${exe} == "touch" ]]; then
  676. TMPDIR="${topdir}" mktemp -t tmp.XXXXXXXXXX;
  677. else
  678. TMPDIR="${topdir}" mktemp -dt tmp.XXXXXXXXXX;
  679. fi;
  680. fi
  681. }
  682. epatch ()
  683. {
  684. function _epatch_draw_line ()
  685. {
  686. [[ -z $1 ]] && set "$(printf "%65s" '')";
  687. echo "${1//?/=}"
  688. };
  689. unset P4CONFIG P4PORT P4USER;
  690. local EPATCH_OPTS=(${EPATCH_OPTS[*]});
  691. while [[ $# -gt 0 ]]; do
  692. case $1 in
  693. -*)
  694. EPATCH_OPTS+=("$1")
  695. ;;
  696. *)
  697. break
  698. ;;
  699. esac;
  700. shift;
  701. done;
  702. if [[ $# -gt 1 ]]; then
  703. local m;
  704. for m in "$@";
  705. do
  706. epatch "${m}";
  707. done;
  708. return 0;
  709. fi;
  710. local SINGLE_PATCH="no";
  711. [[ $# -eq 0 ]] && set -- "${EPATCH_SOURCE}";
  712. if [[ -f $1 ]]; then
  713. SINGLE_PATCH="yes";
  714. set -- "$1";
  715. local EPATCH_SUFFIX=$1;
  716. else
  717. if [[ -d $1 ]]; then
  718. evar_push_set LC_COLLATE C;
  719. set -- "$1"/*${EPATCH_SUFFIX:+."${EPATCH_SUFFIX}"};
  720. evar_pop;
  721. else
  722. if [[ -f ${EPATCH_SOURCE}/$1 ]]; then
  723. epatch "${EPATCH_SOURCE}/$1";
  724. return $?;
  725. else
  726. [[ $# -ne 0 ]] && EPATCH_SOURCE=$1;
  727. echo;
  728. eerror "Cannot find \$EPATCH_SOURCE! Value for \$EPATCH_SOURCE is:";
  729. eerror;
  730. eerror " ${EPATCH_SOURCE}";
  731. eerror " ( ${EPATCH_SOURCE##*/} )";
  732. echo;
  733. die "Cannot find \$EPATCH_SOURCE!";
  734. fi;
  735. fi;
  736. fi;
  737. EPATCH_OPTS="${EPATCH_COMMON_OPTS} ${EPATCH_OPTS[*]}";
  738. local PIPE_CMD;
  739. case ${EPATCH_SUFFIX##*\.} in
  740. xz)
  741. PIPE_CMD="xz -dc"
  742. ;;
  743. lzma)
  744. PIPE_CMD="lzma -dc"
  745. ;;
  746. bz2)
  747. PIPE_CMD="bzip2 -dc"
  748. ;;
  749. gz | Z | z)
  750. PIPE_CMD="gzip -dc"
  751. ;;
  752. ZIP | zip)
  753. PIPE_CMD="unzip -p"
  754. ;;
  755. *)
  756.  
  757. ;;
  758. esac;
  759. [[ ${SINGLE_PATCH} == "no" ]] && einfo "${EPATCH_MULTI_MSG}";
  760. local x;
  761. for x in "$@";
  762. do
  763. [[ ! -f ${x} ]] && continue;
  764. local patchname=${x##*/};
  765. local a=${patchname#*_};
  766. a=${a%%_*};
  767. if ! [[ ${SINGLE_PATCH} == "yes" || ${EPATCH_FORCE} == "yes" || ${a} == all || ${a} == ${ARCH} ]]; then
  768. continue;
  769. fi;
  770. if [[ -n ${EPATCH_EXCLUDE}${EPATCH_USER_EXCLUDE} ]]; then
  771. eshopts_push -o noglob;
  772. local ex;
  773. for ex in ${EPATCH_EXCLUDE};
  774. do
  775. if [[ ${patchname} == ${ex} ]]; then
  776. einfo " Skipping ${patchname} due to EPATCH_EXCLUDE ...";
  777. eshopts_pop;
  778. continue 2;
  779. fi;
  780. done;
  781. for ex in ${EPATCH_USER_EXCLUDE};
  782. do
  783. if [[ ${patchname} == ${ex} ]]; then
  784. einfo " Skipping ${patchname} due to EPATCH_USER_EXCLUDE ...";
  785. eshopts_pop;
  786. continue 2;
  787. fi;
  788. done;
  789. eshopts_pop;
  790. fi;
  791. if [[ ${SINGLE_PATCH} == "yes" ]]; then
  792. if [[ -n ${EPATCH_SINGLE_MSG} ]]; then
  793. einfo "${EPATCH_SINGLE_MSG}";
  794. else
  795. einfo "Applying ${patchname} ...";
  796. fi;
  797. else
  798. einfo " ${patchname} ...";
  799. fi;
  800. local STDERR_TARGET="${T}/${patchname}.out";
  801. if [[ -e ${STDERR_TARGET} ]]; then
  802. STDERR_TARGET="${T}/${patchname}-$$.out";
  803. fi;
  804. printf "***** %s *****\nPWD: %s\n\n" "${patchname}" "${PWD}" > "${STDERR_TARGET}";
  805. local count=0;
  806. local PATCH_TARGET;
  807. if [[ -n ${PIPE_CMD} ]]; then
  808. PATCH_TARGET="${T}/$$.patch";
  809. echo "PIPE_COMMAND: ${PIPE_CMD} ${x} > ${PATCH_TARGET}" >> "${STDERR_TARGET}";
  810. if ! ( ${PIPE_CMD} "${x}" > "${PATCH_TARGET}" ) >> "${STDERR_TARGET}" 2>&1; then
  811. echo;
  812. eerror "Could not extract patch!";
  813. count=5;
  814. break;
  815. fi;
  816. else
  817. PATCH_TARGET=${x};
  818. fi;
  819. local abs_paths=$(egrep -n '^[-+]{3} /' "${PATCH_TARGET}" | awk '$2 != "/dev/null" { print }');
  820. if [[ -n ${abs_paths} ]]; then
  821. count=1;
  822. printf "NOTE: skipping -p0 due to absolute paths in patch:\n%s\n" "${abs_paths}" >> "${STDERR_TARGET}";
  823. fi;
  824. local rel_paths=$(egrep -n '^[-+]{3} [^ ]*[.][.]/' "${PATCH_TARGET}");
  825. if [[ -n ${rel_paths} ]]; then
  826. echo;
  827. eerror "Rejected Patch: ${patchname} !";
  828. eerror " ( ${PATCH_TARGET} )";
  829. eerror;
  830. eerror "Your patch uses relative paths '../':";
  831. eerror "${rel_paths}";
  832. echo;
  833. die "you need to fix the relative paths in patch";
  834. fi;
  835. local patch_cmd;
  836. local patch="patch";
  837. eval $(alias patch 2>/dev/null | sed 's:^alias ::');
  838. while [[ ${count} -lt 5 ]]; do
  839. patch_cmd="${patch} -p${count} ${EPATCH_OPTS}";
  840. ( _epatch_draw_line "***** ${patchname} *****";
  841. echo;
  842. echo "PATCH COMMAND: ${patch_cmd} < '${PATCH_TARGET}'";
  843. echo;
  844. _epatch_draw_line "***** ${patchname} *****";
  845. ${patch_cmd} --dry-run -f < "${PATCH_TARGET}" 2>&1;
  846. ret=$?;
  847. echo;
  848. echo "patch program exited with status ${ret}";
  849. exit ${ret} ) >> "${STDERR_TARGET}";
  850. if [ $? -eq 0 ]; then
  851. ( _epatch_draw_line "***** ${patchname} *****";
  852. echo;
  853. echo "ACTUALLY APPLYING ${patchname} ...";
  854. echo;
  855. _epatch_draw_line "***** ${patchname} *****";
  856. ${patch_cmd} < "${PATCH_TARGET}" 2>&1;
  857. ret=$?;
  858. echo;
  859. echo "patch program exited with status ${ret}";
  860. exit ${ret} ) >> "${STDERR_TARGET}";
  861. if [ $? -ne 0 ]; then
  862. echo;
  863. eerror "A dry-run of patch command succeeded, but actually";
  864. eerror "applying the patch failed!";
  865. count=5;
  866. fi;
  867. break;
  868. fi;
  869. : $(( count++ ));
  870. done;
  871. if [[ -n ${PIPE_CMD} ]]; then
  872. rm -f "${PATCH_TARGET}";
  873. fi;
  874. if [[ ${count} -ge 5 ]]; then
  875. echo;
  876. eerror "Failed Patch: ${patchname} !";
  877. eerror " ( ${PATCH_TARGET} )";
  878. eerror;
  879. eerror "Include in your bugreport the contents of:";
  880. eerror;
  881. eerror " ${STDERR_TARGET}";
  882. echo;
  883. die "Failed Patch: ${patchname}!";
  884. fi;
  885. rm -f "${STDERR_TARGET}";
  886. cat >> "${T}/epatch.log" <<-EOF
  887. PATCH: ${x}
  888. CMD: ${patch_cmd}
  889. PWD: ${PWD}
  890.  
  891. EOF
  892.  
  893. eend 0;
  894. done;
  895. [[ ${SINGLE_PATCH} == "no" ]] && einfo "Done with patching";
  896. :
  897. }
  898. epatch_user ()
  899. {
  900. [[ $# -ne 0 ]] && die "epatch_user takes no options";
  901. local applied="${T}/epatch_user.log";
  902. [[ -e ${applied} ]] && return 2;
  903. local EPATCH_SOURCE check base=${PORTAGE_CONFIGROOT%/}/etc/portage/patches;
  904. for check in ${CATEGORY}/{${P}-${PR},${P},${PN}}{,:${SLOT}};
  905. do
  906. EPATCH_SOURCE=${base}/${CTARGET}/${check};
  907. [[ -r ${EPATCH_SOURCE} ]] || EPATCH_SOURCE=${base}/${CHOST}/${check};
  908. [[ -r ${EPATCH_SOURCE} ]] || EPATCH_SOURCE=${base}/${check};
  909. if [[ -d ${EPATCH_SOURCE} ]]; then
  910. EPATCH_SOURCE=${EPATCH_SOURCE} EPATCH_SUFFIX="patch" EPATCH_FORCE="yes" EPATCH_MULTI_MSG="Applying user patches from ${EPATCH_SOURCE} ..." epatch;
  911. echo "${EPATCH_SOURCE}" > "${applied}";
  912. return 0;
  913. fi;
  914. done;
  915. echo "none" > "${applied}";
  916. return 1
  917. }
  918. epause ()
  919. {
  920. [[ -z ${EPAUSE_IGNORE} ]] && sleep ${1:-5}
  921. }
  922. epunt_cxx ()
  923. {
  924. local dir=$1;
  925. [[ -z ${dir} ]] && dir=${S};
  926. ebegin "Removing useless C++ checks";
  927. local f p any_found;
  928. while IFS= read -r -d '' f; do
  929. for p in "${PORTDIR}"/eclass/ELT-patches/nocxx/*.patch;
  930. do
  931. if patch --no-backup-if-mismatch -p1 "${f}" "${p}" > /dev/null; then
  932. any_found=1;
  933. break;
  934. fi;
  935. done;
  936. done < <(find "${dir}" -name configure -print0);
  937. if [[ -z ${any_found} ]]; then
  938. eqawarn "epunt_cxx called unnecessarily (no C++ checks to punt).";
  939. fi;
  940. eend 0
  941. }
  942. eshopts_pop ()
  943. {
  944. local s;
  945. estack_pop eshopts s || die "${FUNCNAME}: unbalanced push";
  946. if [[ ${s} == "shopt -"* ]]; then
  947. eval "${s}" || die "${FUNCNAME}: sanity: invalid shopt options: ${s}";
  948. else
  949. set +$- || die "${FUNCNAME}: sanity: invalid shell settings: $-";
  950. set -${s} || die "${FUNCNAME}: sanity: unable to restore saved shell settings: ${s}";
  951. fi
  952. }
  953. eshopts_push ()
  954. {
  955. if [[ $1 == -[su] ]]; then
  956. estack_push eshopts "$(shopt -p)";
  957. [[ $# -eq 0 ]] && return 0;
  958. shopt "$@" || die "${FUNCNAME}: bad options to shopt: $*";
  959. else
  960. estack_push eshopts $-;
  961. [[ $# -eq 0 ]] && return 0;
  962. set "$@" || die "${FUNCNAME}: bad options to set: $*";
  963. fi
  964. }
  965. estack_pop ()
  966. {
  967. [[ $# -eq 0 || $# -gt 2 ]] && die "estack_pop: incorrect # of arguments";
  968. local _estack_name="_ESTACK_$1_";
  969. shift;
  970. local _estack_retvar=$1;
  971. shift;
  972. eval local _estack_i=\${#${_estack_name}\[@\]};
  973. [[ $(( --_estack_i )) -eq -1 ]] && return 1;
  974. if [[ -n ${_estack_retvar} ]]; then
  975. eval ${_estack_retvar}=\"\${${_estack_name}\[${_estack_i}\]}\";
  976. fi;
  977. eval unset ${_estack_name}\[${_estack_i}\]
  978. }
  979. estack_push ()
  980. {
  981. [[ $# -eq 0 ]] && die "estack_push: incorrect # of arguments";
  982. local stack_name="_ESTACK_$1_";
  983. shift;
  984. eval ${stack_name}+=\( \"\$@\" \)
  985. }
  986. esvn_clean ()
  987. {
  988. [[ -z $* ]] && set -- .;
  989. find "$@" -type d -name '.svn' -prune -print0 | xargs -0 rm -rf
  990. }
  991. eumask_pop ()
  992. {
  993. [[ $# -eq 0 ]] || die "${FUNCNAME}: we take no options";
  994. local s;
  995. estack_pop eumask s || die "${FUNCNAME}: unbalanced push";
  996. umask ${s} || die "${FUNCNAME}: sanity: could not restore umask: ${s}"
  997. }
  998. eumask_push ()
  999. {
  1000. estack_push eumask "$(umask)";
  1001. umask "$@" || die "${FUNCNAME}: bad options to umask: $*"
  1002. }
  1003. evar_pop ()
  1004. {
  1005. local cnt=${1:-bad};
  1006. case $# in
  1007. 0)
  1008. cnt=1
  1009. ;;
  1010. 1)
  1011. isdigit "${cnt}" || die "${FUNCNAME}: first arg must be a number: $*"
  1012. ;;
  1013. *)
  1014. die "${FUNCNAME}: only accepts one arg: $*"
  1015. ;;
  1016. esac;
  1017. local var val;
  1018. while (( cnt-- )); do
  1019. estack_pop evar val || die "${FUNCNAME}: unbalanced push";
  1020. estack_pop evar var || die "${FUNCNAME}: unbalanced push";
  1021. [[ ${val} == "unset_76fc3c462065bb4ca959f939e6793f94" ]] && unset ${var} || printf -v "${var}" '%s' "${val}";
  1022. done
  1023. }
  1024. evar_push ()
  1025. {
  1026. local var val;
  1027. for var in "$@";
  1028. do
  1029. [[ ${!var+set} == "set" ]] && val=${!var} || val="unset_76fc3c462065bb4ca959f939e6793f94";
  1030. estack_push evar "${var}" "${val}";
  1031. done
  1032. }
  1033. evar_push_set ()
  1034. {
  1035. local var=$1;
  1036. evar_push ${var};
  1037. case $# in
  1038. 1)
  1039. unset ${var}
  1040. ;;
  1041. 2)
  1042. printf -v "${var}" '%s' "$2"
  1043. ;;
  1044. *)
  1045. die "${FUNCNAME}: incorrect # of args: $*"
  1046. ;;
  1047. esac
  1048. }
  1049. gcc-fullversion ()
  1050. {
  1051. _gcc_fullversion '$1.$2.$3' "$@"
  1052. }
  1053. gcc-major-version ()
  1054. {
  1055. _gcc_fullversion '$1' "$@"
  1056. }
  1057. gcc-micro-version ()
  1058. {
  1059. _gcc_fullversion '$3' "$@"
  1060. }
  1061. gcc-minor-version ()
  1062. {
  1063. _gcc_fullversion '$2' "$@"
  1064. }
  1065. gcc-specs-directive ()
  1066. {
  1067. local directive subdname subdirective;
  1068. directive="$(_gcc-specs-directive_raw $1)";
  1069. while [[ ${directive} == *%\(*\)* ]]; do
  1070. subdname=${directive/*%\(};
  1071. subdname=${subdname/\)*};
  1072. subdirective="$(_gcc-specs-directive_raw ${subdname})";
  1073. directive="${directive//\%(${subdname})/${subdirective}}";
  1074. done;
  1075. echo "${directive}";
  1076. return 0
  1077. }
  1078. gcc-specs-nostrict ()
  1079. {
  1080. local directive;
  1081. directive=$(gcc-specs-directive cc1);
  1082. [[ "${directive/\{!fstrict-overflow:}" != "${directive}" ]]
  1083. }
  1084. gcc-specs-now ()
  1085. {
  1086. local directive;
  1087. directive=$(gcc-specs-directive link_command);
  1088. [[ "${directive/\{!nonow:}" != "${directive}" ]]
  1089. }
  1090. gcc-specs-pie ()
  1091. {
  1092. local directive;
  1093. directive=$(gcc-specs-directive cc1);
  1094. [[ "${directive/\{!nopie:}" != "${directive}" ]]
  1095. }
  1096. gcc-specs-relro ()
  1097. {
  1098. local directive;
  1099. directive=$(gcc-specs-directive link_command);
  1100. [[ "${directive/\{!norelro:}" != "${directive}" ]]
  1101. }
  1102. gcc-specs-ssp ()
  1103. {
  1104. local directive;
  1105. directive=$(gcc-specs-directive cc1);
  1106. [[ "${directive/\{!fno-stack-protector:}" != "${directive}" ]]
  1107. }
  1108. gcc-specs-ssp-to-all ()
  1109. {
  1110. local directive;
  1111. directive=$(gcc-specs-directive cc1);
  1112. [[ "${directive/\{!fno-stack-protector-all:}" != "${directive}" ]]
  1113. }
  1114. gcc-specs-stack-check ()
  1115. {
  1116. local directive;
  1117. directive=$(gcc-specs-directive cc1);
  1118. [[ "${directive/\{!fno-stack-check:}" != "${directive}" ]]
  1119. }
  1120. gcc-version ()
  1121. {
  1122. _gcc_fullversion '$1.$2' "$@"
  1123. }
  1124. gen_usr_ldscript ()
  1125. {
  1126. local lib libdir=$(get_libdir) output_format="" auto=false suffix=$(get_libname);
  1127. [[ -z ${ED+set} ]] && local ED=${D%/}${EPREFIX}/;
  1128. tc-is-static-only && return;
  1129. case ${CTARGET:-${CHOST}} in
  1130. *-darwin*)
  1131.  
  1132. ;;
  1133. *linux* | *-freebsd* | *-openbsd* | *-netbsd*)
  1134. use prefix && return 0
  1135. ;;
  1136. *)
  1137. return 0
  1138. ;;
  1139. esac;
  1140. dodir /usr/${libdir};
  1141. if [[ $1 == "-a" ]]; then
  1142. auto=true;
  1143. shift;
  1144. dodir /${libdir};
  1145. fi;
  1146. local flags=(${CFLAGS} ${LDFLAGS} -Wl,--verbose);
  1147. if $(tc-getLD) --version | grep -q 'GNU gold'; then
  1148. local d="${T}/bfd-linker";
  1149. mkdir -p "${d}";
  1150. ln -sf $(which ${CHOST}-ld.bfd) "${d}"/ld;
  1151. flags+=(-B"${d}");
  1152. fi;
  1153. output_format=$($(tc-getCC) "${flags[@]}" 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p');
  1154. [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )";
  1155. for lib in "$@";
  1156. do
  1157. local tlib;
  1158. if ${auto}; then
  1159. lib="lib${lib}${suffix}";
  1160. else
  1161. [[ -r ${ED}/${libdir}/${lib} ]] || continue;
  1162. fi;
  1163. case ${CTARGET:-${CHOST}} in
  1164. *-darwin*)
  1165. if ${auto}; then
  1166. tlib=$(scanmacho -qF'%S#F' "${ED}"/usr/${libdir}/${lib});
  1167. else
  1168. tlib=$(scanmacho -qF'%S#F' "${ED}"/${libdir}/${lib});
  1169. fi;
  1170. [[ -z ${tlib} ]] && die "unable to read install_name from ${lib}";
  1171. tlib=${tlib##*/};
  1172. if ${auto}; then
  1173. mv "${ED}"/usr/${libdir}/${lib%${suffix}}.*${suffix#.} "${ED}"/${libdir}/ || die;
  1174. if [[ ${tlib} != ${lib%${suffix}}.*${suffix#.} ]]; then
  1175. mv "${ED}"/usr/${libdir}/${tlib%${suffix}}.*${suffix#.} "${ED}"/${libdir}/ || die;
  1176. fi;
  1177. rm -f "${ED}"/${libdir}/${lib};
  1178. fi;
  1179. if [[ ! -w "${ED}/${libdir}/${tlib}" ]]; then
  1180. chmod u+w "${ED}${libdir}/${tlib}";
  1181. local nowrite=yes;
  1182. fi;
  1183. install_name_tool -id "${EPREFIX}"/${libdir}/${tlib} "${ED}"/${libdir}/${tlib} || die "install_name_tool failed";
  1184. [[ -n ${nowrite} ]] && chmod u-w "${ED}${libdir}/${tlib}";
  1185. pushd "${ED}/usr/${libdir}" > /dev/null;
  1186. ln -snf "../../${libdir}/${tlib}" "${lib}";
  1187. popd > /dev/null
  1188. ;;
  1189. *)
  1190. if ${auto}; then
  1191. tlib=$(scanelf -qF'%S#F' "${ED}"/usr/${libdir}/${lib});
  1192. [[ -z ${tlib} ]] && die "unable to read SONAME from ${lib}";
  1193. mv "${ED}"/usr/${libdir}/${lib}* "${ED}"/${libdir}/ || die;
  1194. if [[ ${tlib} != ${lib}* ]]; then
  1195. mv "${ED}"/usr/${libdir}/${tlib}* "${ED}"/${libdir}/ || die;
  1196. fi;
  1197. rm -f "${ED}"/${libdir}/${lib};
  1198. else
  1199. tlib=${lib};
  1200. fi;
  1201. cat > "${ED}/usr/${libdir}/${lib}" <<-END_LDSCRIPT
  1202. /* GNU ld script
  1203. Since Gentoo has critical dynamic libraries in /lib, and the static versions
  1204. in /usr/lib, we need to have a "fake" dynamic lib in /usr/lib, otherwise we
  1205. run into linking problems. This "fake" dynamic lib is a linker script that
  1206. redirects the linker to the real lib. And yes, this works in the cross-
  1207. compiling scenario as the sysroot-ed linker will prepend the real path.
  1208.  
  1209. See bug http://bugs.gentoo.org/4411 for more info.
  1210. */
  1211. ${output_format}
  1212. GROUP ( ${EPREFIX}/${libdir}/${tlib} )
  1213. END_LDSCRIPT
  1214.  
  1215. ;;
  1216. esac
  1217. fperms a+x "/usr/${libdir}/${lib}" || die "could not change perms on ${lib}";
  1218. done
  1219. }
  1220. get_abi_CFLAGS ()
  1221. {
  1222. get_abi_var CFLAGS "$@"
  1223. }
  1224. get_abi_CHOST ()
  1225. {
  1226. get_abi_var CHOST "$@"
  1227. }
  1228. get_abi_CTARGET ()
  1229. {
  1230. get_abi_var CTARGET "$@"
  1231. }
  1232. get_abi_FAKE_TARGETS ()
  1233. {
  1234. get_abi_var FAKE_TARGETS "$@"
  1235. }
  1236. get_abi_LDFLAGS ()
  1237. {
  1238. get_abi_var LDFLAGS "$@"
  1239. }
  1240. get_abi_LIBDIR ()
  1241. {
  1242. get_abi_var LIBDIR "$@"
  1243. }
  1244. get_abi_var ()
  1245. {
  1246. local flag=$1;
  1247. local abi=${2:-${ABI:-${DEFAULT_ABI:-default}}};
  1248. local var="${flag}_${abi}";
  1249. echo ${!var}
  1250. }
  1251. get_all_abis ()
  1252. {
  1253. local x order="" mvar dvar;
  1254. mvar="MULTILIB_ABIS";
  1255. dvar="DEFAULT_ABI";
  1256. if [[ -n $1 ]]; then
  1257. mvar="$1_${mvar}";
  1258. dvar="$1_${dvar}";
  1259. fi;
  1260. if [[ -z ${!mvar} ]]; then
  1261. echo "default";
  1262. return 0;
  1263. fi;
  1264. for x in ${!mvar};
  1265. do
  1266. if [[ ${x} != ${!dvar} ]]; then
  1267. order="${order:+${order} }${x}";
  1268. fi;
  1269. done;
  1270. order="${order:+${order} }${!dvar}";
  1271. echo ${order};
  1272. return 0
  1273. }
  1274. get_all_libdirs ()
  1275. {
  1276. local libdirs abi;
  1277. for abi in ${MULTILIB_ABIS};
  1278. do
  1279. libdirs+=" $(get_abi_LIBDIR ${abi})";
  1280. done;
  1281. [[ " ${libdirs} " != *" lib "* ]] && libdirs+=" lib";
  1282. echo "${libdirs}"
  1283. }
  1284. get_install_abis ()
  1285. {
  1286. local x order="";
  1287. if [[ -z ${MULTILIB_ABIS} ]]; then
  1288. echo "default";
  1289. return 0;
  1290. fi;
  1291. if [[ ${EMULTILIB_PKG} == "true" ]]; then
  1292. for x in ${MULTILIB_ABIS};
  1293. do
  1294. if [[ ${x} != "${DEFAULT_ABI}" ]]; then
  1295. has ${x} ${ABI_DENY} || order="${order} ${x}";
  1296. fi;
  1297. done;
  1298. has ${DEFAULT_ABI} ${ABI_DENY} || order="${order} ${DEFAULT_ABI}";
  1299. if [[ -n ${ABI_ALLOW} ]]; then
  1300. local ordera="";
  1301. for x in ${order};
  1302. do
  1303. if has ${x} ${ABI_ALLOW}; then
  1304. ordera="${ordera} ${x}";
  1305. fi;
  1306. done;
  1307. order=${ordera};
  1308. fi;
  1309. else
  1310. order=${DEFAULT_ABI};
  1311. fi;
  1312. if [[ -z ${order} ]]; then
  1313. die "The ABI list is empty. Are you using a proper multilib profile? Perhaps your USE flags or MULTILIB_ABIS are too restrictive for this package.";
  1314. fi;
  1315. echo ${order};
  1316. return 0
  1317. }
  1318. get_libdir ()
  1319. {
  1320. local CONF_LIBDIR;
  1321. if [ -n "${CONF_LIBDIR_OVERRIDE}" ]; then
  1322. echo ${CONF_LIBDIR_OVERRIDE};
  1323. else
  1324. get_abi_LIBDIR;
  1325. fi
  1326. }
  1327. get_libname ()
  1328. {
  1329. local libname;
  1330. local ver=$1;
  1331. case ${CHOST} in
  1332. *-cygwin | mingw* | *-mingw*)
  1333. libname="dll"
  1334. ;;
  1335. *-darwin*)
  1336. libname="dylib"
  1337. ;;
  1338. *-mint*)
  1339. libname="irrelevant"
  1340. ;;
  1341. hppa*-hpux*)
  1342. libname="sl"
  1343. ;;
  1344. *)
  1345. libname="so"
  1346. ;;
  1347. esac;
  1348. if [[ -z $* ]]; then
  1349. echo ".${libname}";
  1350. else
  1351. for ver in "$@";
  1352. do
  1353. case ${CHOST} in
  1354. *-darwin*)
  1355. echo ".${ver}.${libname}"
  1356. ;;
  1357. *-mint*)
  1358. echo ".${libname}"
  1359. ;;
  1360. *)
  1361. echo ".${libname}.${ver}"
  1362. ;;
  1363. esac;
  1364. done;
  1365. fi
  1366. }
  1367. get_modname ()
  1368. {
  1369. local modname;
  1370. local ver=$1;
  1371. case ${CHOST} in
  1372. *-darwin*)
  1373. modname="bundle"
  1374. ;;
  1375. *)
  1376. modname="so"
  1377. ;;
  1378. esac;
  1379. echo ".${modname}"
  1380. }
  1381. has_multilib_profile ()
  1382. {
  1383. [ -n "${MULTILIB_ABIS}" -a "${MULTILIB_ABIS}" != "${MULTILIB_ABIS/ /}" ]
  1384. }
  1385. in_iuse ()
  1386. {
  1387. debug-print-function ${FUNCNAME} "${@}";
  1388. [[ ${#} -eq 1 ]] || die "Invalid args to ${FUNCNAME}()";
  1389. local flag=${1};
  1390. local liuse=(${IUSE});
  1391. has "${flag}" "${liuse[@]#[+-]}"
  1392. }
  1393. is_final_abi ()
  1394. {
  1395. has_multilib_profile || return 0;
  1396. set -- $(get_install_abis);
  1397. local LAST_ABI=$#;
  1398. [[ ${!LAST_ABI} == ${ABI} ]]
  1399. }
  1400. isdigit ()
  1401. {
  1402. local d;
  1403. for d in "$@";
  1404. do
  1405. [[ ${d:-bad} == *[!0-9]* ]] && return 1;
  1406. done;
  1407. return 0
  1408. }
  1409. make_desktop_entry ()
  1410. {
  1411. [[ -z $1 ]] && die "make_desktop_entry: You must specify the executable";
  1412. local exec=${1};
  1413. local name=${2:-${PN}};
  1414. local icon=${3:-${PN}};
  1415. local type=${4};
  1416. local fields=${5};
  1417. if [[ -z ${type} ]]; then
  1418. local catmaj=${CATEGORY%%-*};
  1419. local catmin=${CATEGORY##*-};
  1420. case ${catmaj} in
  1421. app)
  1422. case ${catmin} in
  1423. accessibility)
  1424. type="Utility;Accessibility"
  1425. ;;
  1426. admin)
  1427. type=System
  1428. ;;
  1429. antivirus)
  1430. type=System
  1431. ;;
  1432. arch)
  1433. type="Utility;Archiving"
  1434. ;;
  1435. backup)
  1436. type="Utility;Archiving"
  1437. ;;
  1438. cdr)
  1439. type="AudioVideo;DiscBurning"
  1440. ;;
  1441. dicts)
  1442. type="Office;Dictionary"
  1443. ;;
  1444. doc)
  1445. type=Documentation
  1446. ;;
  1447. editors)
  1448. type="Utility;TextEditor"
  1449. ;;
  1450. emacs)
  1451. type="Development;TextEditor"
  1452. ;;
  1453. emulation)
  1454. type="System;Emulator"
  1455. ;;
  1456. laptop)
  1457. type="Settings;HardwareSettings"
  1458. ;;
  1459. office)
  1460. type=Office
  1461. ;;
  1462. pda)
  1463. type="Office;PDA"
  1464. ;;
  1465. vim)
  1466. type="Development;TextEditor"
  1467. ;;
  1468. xemacs)
  1469. type="Development;TextEditor"
  1470. ;;
  1471. esac
  1472. ;;
  1473. dev)
  1474. type="Development"
  1475. ;;
  1476. games)
  1477. case ${catmin} in
  1478. action | fps)
  1479. type=ActionGame
  1480. ;;
  1481. arcade)
  1482. type=ArcadeGame
  1483. ;;
  1484. board)
  1485. type=BoardGame
  1486. ;;
  1487. emulation)
  1488. type=Emulator
  1489. ;;
  1490. kids)
  1491. type=KidsGame
  1492. ;;
  1493. puzzle)
  1494. type=LogicGame
  1495. ;;
  1496. roguelike)
  1497. type=RolePlaying
  1498. ;;
  1499. rpg)
  1500. type=RolePlaying
  1501. ;;
  1502. simulation)
  1503. type=Simulation
  1504. ;;
  1505. sports)
  1506. type=SportsGame
  1507. ;;
  1508. strategy)
  1509. type=StrategyGame
  1510. ;;
  1511. esac;
  1512. type="Game;${type}"
  1513. ;;
  1514. gnome)
  1515. type="Gnome;GTK"
  1516. ;;
  1517. kde)
  1518. type="KDE;Qt"
  1519. ;;
  1520. mail)
  1521. type="Network;Email"
  1522. ;;
  1523. media)
  1524. case ${catmin} in
  1525. gfx)
  1526. type=Graphics
  1527. ;;
  1528. *)
  1529. case ${catmin} in
  1530. radio)
  1531. type=Tuner
  1532. ;;
  1533. sound)
  1534. type=Audio
  1535. ;;
  1536. tv)
  1537. type=TV
  1538. ;;
  1539. video)
  1540. type=Video
  1541. ;;
  1542. esac;
  1543. type="AudioVideo;${type}"
  1544. ;;
  1545. esac
  1546. ;;
  1547. net)
  1548. case ${catmin} in
  1549. dialup)
  1550. type=Dialup
  1551. ;;
  1552. ftp)
  1553. type=FileTransfer
  1554. ;;
  1555. im)
  1556. type=InstantMessaging
  1557. ;;
  1558. irc)
  1559. type=IRCClient
  1560. ;;
  1561. mail)
  1562. type=Email
  1563. ;;
  1564. news)
  1565. type=News
  1566. ;;
  1567. nntp)
  1568. type=News
  1569. ;;
  1570. p2p)
  1571. type=FileTransfer
  1572. ;;
  1573. voip)
  1574. type=Telephony
  1575. ;;
  1576. esac;
  1577. type="Network;${type}"
  1578. ;;
  1579. sci)
  1580. case ${catmin} in
  1581. astro*)
  1582. type=Astronomy
  1583. ;;
  1584. bio*)
  1585. type=Biology
  1586. ;;
  1587. calc*)
  1588. type=Calculator
  1589. ;;
  1590. chem*)
  1591. type=Chemistry
  1592. ;;
  1593. elec*)
  1594. type=Electronics
  1595. ;;
  1596. geo*)
  1597. type=Geology
  1598. ;;
  1599. math*)
  1600. type=Math
  1601. ;;
  1602. physics)
  1603. type=Physics
  1604. ;;
  1605. visual*)
  1606. type=DataVisualization
  1607. ;;
  1608. esac;
  1609. type="Education;Science;${type}"
  1610. ;;
  1611. sys)
  1612. type="System"
  1613. ;;
  1614. www)
  1615. case ${catmin} in
  1616. client)
  1617. type=WebBrowser
  1618. ;;
  1619. esac;
  1620. type="Network;${type}"
  1621. ;;
  1622. *)
  1623. type=
  1624. ;;
  1625. esac;
  1626. fi;
  1627. local slot=${SLOT%/*};
  1628. if [[ ${slot} == "0" ]]; then
  1629. local desktop_name="${PN}";
  1630. else
  1631. local desktop_name="${PN}-${slot}";
  1632. fi;
  1633. local desktop="${T}/$(echo ${exec} | sed 's:[[:space:]/:]:_:g')-${desktop_name}.desktop";
  1634. type=${type%;}${type:+;};
  1635. eshopts_push -s extglob;
  1636. if [[ -n ${icon} && ${icon} != /* ]] && [[ ${icon} == *.xpm || ${icon} == *.png || ${icon} == *.svg ]]; then
  1637. ewarn "As described in the Icon Theme Specification, icon file extensions are not";
  1638. ewarn "allowed in .desktop files if the value is not an absolute path.";
  1639. icon=${icon%.@(xpm|png|svg)};
  1640. fi;
  1641. eshopts_pop;
  1642. cat > "${desktop}" <<-EOF
  1643. [Desktop Entry]
  1644. Name=${name}
  1645. Type=Application
  1646. Comment=${DESCRIPTION}
  1647. Exec=${exec}
  1648. TryExec=${exec%% *}
  1649. Icon=${icon}
  1650. Categories=${type}
  1651. EOF
  1652.  
  1653. if [[ ${fields:-=} != *=* ]]; then
  1654. ewarn "make_desktop_entry: update your 5th arg to read Path=${fields}";
  1655. fields="Path=${fields}";
  1656. fi;
  1657. [[ -n ${fields} ]] && printf '%b\n' "${fields}" >> "${desktop}";
  1658. ( insinto /usr/share/applications;
  1659. doins "${desktop}" ) || die "installing desktop file failed"
  1660. }
  1661. make_session_desktop ()
  1662. {
  1663. [[ -z $1 ]] && eerror "$0: You must specify the title" && return 1;
  1664. [[ -z $2 ]] && eerror "$0: You must specify the command" && return 1;
  1665. local title=$1;
  1666. local command=$2;
  1667. local desktop=${T}/${wm:-${PN}}.desktop;
  1668. shift 2;
  1669. cat > "${desktop}" <<-EOF
  1670. [Desktop Entry]
  1671. Name=${title}
  1672. Comment=This session logs you into ${title}
  1673. Exec=${command} $*
  1674. TryExec=${command}
  1675. Type=XSession
  1676. EOF
  1677.  
  1678. ( insinto /usr/share/xsessions;
  1679. doins "${desktop}" )
  1680. }
  1681. make_wrapper ()
  1682. {
  1683. _eutils_eprefix_init;
  1684. local wrapper=$1 bin=$2 chdir=$3 libdir=$4 path=$5;
  1685. local tmpwrapper=$(emktemp);
  1686. ( echo '#!/bin/sh';
  1687. [[ -n ${chdir} ]] && printf 'cd "%s"\n' "${EPREFIX}${chdir}";
  1688. if [[ -n ${libdir} ]]; then
  1689. local var;
  1690. if [[ ${CHOST} == *-darwin* ]]; then
  1691. var=DYLD_LIBRARY_PATH;
  1692. else
  1693. var=LD_LIBRARY_PATH;
  1694. fi;
  1695. cat <<-EOF
  1696. if [ "\${${var}+set}" = "set" ] ; then
  1697. export ${var}="\${${var}}:${EPREFIX}${libdir}"
  1698. else
  1699. export ${var}="${EPREFIX}${libdir}"
  1700. fi
  1701. EOF
  1702.  
  1703. fi
  1704. printf 'exec %s "$@"\n' "${bin/#\//${EPREFIX}/}" ) > "${tmpwrapper}";
  1705. chmod go+rx "${tmpwrapper}";
  1706. if [[ -n ${path} ]]; then
  1707. ( exeinto "${path}";
  1708. newexe "${tmpwrapper}" "${wrapper}" ) || die;
  1709. else
  1710. newbin "${tmpwrapper}" "${wrapper}" || die;
  1711. fi
  1712. }
  1713. multilib_env ()
  1714. {
  1715. local CTARGET=${1:-${CTARGET}};
  1716. local cpu=${CTARGET%%*-};
  1717. case ${cpu} in
  1718. aarch64*)
  1719. export CFLAGS_arm=${CFLAGS_arm-};
  1720. case ${cpu} in
  1721. aarch64*be)
  1722. export CHOST_arm="armv8b-${CTARGET#*-}"
  1723. ;;
  1724. *)
  1725. export CHOST_arm="armv8l-${CTARGET#*-}"
  1726. ;;
  1727. esac;
  1728. CHOST_arm=${CHOST_arm/%-gnu/-gnueabi};
  1729. export CTARGET_arm=${CHOST_arm};
  1730. export LIBDIR_arm="lib";
  1731. export CFLAGS_arm64=${CFLAGS_arm64-};
  1732. export CHOST_arm64=${CTARGET};
  1733. export CTARGET_arm64=${CHOST_arm64};
  1734. export LIBDIR_arm64="lib64";
  1735. : ${MULTILIB_ABIS=arm64};
  1736. : ${DEFAULT_ABI=arm64}
  1737. ;;
  1738. x86_64*)
  1739. export CFLAGS_x86=${CFLAGS_x86--m32};
  1740. export CHOST_x86=${CTARGET/x86_64/i686};
  1741. CHOST_x86=${CHOST_x86/%-gnux32/-gnu};
  1742. export CTARGET_x86=${CHOST_x86};
  1743. if [[ ${SYMLINK_LIB} == "yes" ]]; then
  1744. export LIBDIR_x86="lib32";
  1745. else
  1746. export LIBDIR_x86="lib";
  1747. fi;
  1748. export CFLAGS_amd64=${CFLAGS_amd64--m64};
  1749. export CHOST_amd64=${CTARGET/%-gnux32/-gnu};
  1750. export CTARGET_amd64=${CHOST_amd64};
  1751. export LIBDIR_amd64="lib64";
  1752. export CFLAGS_x32=${CFLAGS_x32--mx32};
  1753. export CHOST_x32=${CTARGET/%-gnu/-gnux32};
  1754. export CTARGET_x32=${CHOST_x32};
  1755. export LIBDIR_x32="libx32";
  1756. case ${CTARGET} in
  1757. *-gnux32)
  1758. : ${MULTILIB_ABIS=x32 amd64 x86};
  1759. : ${DEFAULT_ABI=x32}
  1760. ;;
  1761. *)
  1762. : ${MULTILIB_ABIS=amd64 x86};
  1763. : ${DEFAULT_ABI=amd64}
  1764. ;;
  1765. esac
  1766. ;;
  1767. mips64*)
  1768. export CFLAGS_o32=${CFLAGS_o32--mabi=32};
  1769. export CHOST_o32=${CTARGET/mips64/mips};
  1770. export CTARGET_o32=${CHOST_o32};
  1771. export LIBDIR_o32="lib";
  1772. export CFLAGS_n32=${CFLAGS_n32--mabi=n32};
  1773. export CHOST_n32=${CTARGET};
  1774. export CTARGET_n32=${CHOST_n32};
  1775. export LIBDIR_n32="lib32";
  1776. export CFLAGS_n64=${CFLAGS_n64--mabi=64};
  1777. export CHOST_n64=${CTARGET};
  1778. export CTARGET_n64=${CHOST_n64};
  1779. export LIBDIR_n64="lib64";
  1780. : ${MULTILIB_ABIS=n64 n32 o32};
  1781. : ${DEFAULT_ABI=n32}
  1782. ;;
  1783. powerpc64*)
  1784. export CFLAGS_ppc=${CFLAGS_ppc--m32};
  1785. export CHOST_ppc=${CTARGET/powerpc64/powerpc};
  1786. export CTARGET_ppc=${CHOST_ppc};
  1787. export LIBDIR_ppc="lib";
  1788. export CFLAGS_ppc64=${CFLAGS_ppc64--m64};
  1789. export CHOST_ppc64=${CTARGET};
  1790. export CTARGET_ppc64=${CHOST_ppc64};
  1791. export LIBDIR_ppc64="lib64";
  1792. : ${MULTILIB_ABIS=ppc64 ppc};
  1793. : ${DEFAULT_ABI=ppc64}
  1794. ;;
  1795. s390x*)
  1796. export CFLAGS_s390=${CFLAGS_s390--m31};
  1797. export CHOST_s390=${CTARGET/s390x/s390};
  1798. export CTARGET_s390=${CHOST_s390};
  1799. export LIBDIR_s390="lib";
  1800. export CFLAGS_s390x=${CFLAGS_s390x--m64};
  1801. export CHOST_s390x=${CTARGET};
  1802. export CTARGET_s390x=${CHOST_s390x};
  1803. export LIBDIR_s390x="lib64";
  1804. : ${MULTILIB_ABIS=s390x s390};
  1805. : ${DEFAULT_ABI=s390x}
  1806. ;;
  1807. sparc64*)
  1808. export CFLAGS_sparc32=${CFLAGS_sparc32--m32};
  1809. export CHOST_sparc32=${CTARGET/sparc64/sparc};
  1810. export CTARGET_sparc32=${CHOST_sparc32};
  1811. export LIBDIR_sparc32="lib";
  1812. export CFLAGS_sparc64=${CFLAGS_sparc64--m64};
  1813. export CHOST_sparc64=${CTARGET};
  1814. export CTARGET_sparc64=${CHOST_sparc64};
  1815. export LIBDIR_sparc64="lib64";
  1816. : ${MULTILIB_ABIS=sparc64 sparc32};
  1817. : ${DEFAULT_ABI=sparc64}
  1818. ;;
  1819. *)
  1820. : ${MULTILIB_ABIS=default};
  1821. : ${DEFAULT_ABI=default}
  1822. ;;
  1823. esac;
  1824. export MULTILIB_ABIS DEFAULT_ABI
  1825. }
  1826. multilib_toolchain_setup ()
  1827. {
  1828. local v vv;
  1829. export ABI=$1;
  1830. if [[ ${_DEFAULT_ABI_SAVED} == "true" ]]; then
  1831. for v in CHOST CBUILD AS CC CXX LD PKG_CONFIG_{LIBDIR,PATH};
  1832. do
  1833. vv="_abi_saved_${v}";
  1834. [[ ${!vv+set} == "set" ]] && export ${v}="${!vv}" || unset ${v};
  1835. unset ${vv};
  1836. done;
  1837. unset _DEFAULT_ABI_SAVED;
  1838. fi;
  1839. if [[ ${ABI} != ${DEFAULT_ABI} ]]; then
  1840. for v in CHOST CBUILD AS CC CXX LD PKG_CONFIG_{LIBDIR,PATH};
  1841. do
  1842. vv="_abi_saved_${v}";
  1843. [[ ${!v+set} == "set" ]] && export ${vv}="${!v}" || unset ${vv};
  1844. done;
  1845. export _DEFAULT_ABI_SAVED="true";
  1846. export CHOST=$(get_abi_CHOST ${DEFAULT_ABI});
  1847. export CC="$(tc-getCC) $(get_abi_CFLAGS)";
  1848. export CXX="$(tc-getCXX) $(get_abi_CFLAGS)";
  1849. export LD="$(tc-getLD) $(get_abi_LDFLAGS)";
  1850. export CHOST=$(get_abi_CHOST $1);
  1851. export CBUILD=$(get_abi_CHOST $1);
  1852. export PKG_CONFIG_LIBDIR=${EPREFIX}/usr/$(get_libdir)/pkgconfig;
  1853. export PKG_CONFIG_PATH=${EPREFIX}/usr/share/pkgconfig;
  1854. fi
  1855. }
  1856. newicon ()
  1857. {
  1858. _iconins ${FUNCNAME} "$@"
  1859. }
  1860. newmenu ()
  1861. {
  1862. ( insinto /usr/share/applications;
  1863. newins "$@" )
  1864. }
  1865. number_abis ()
  1866. {
  1867. set -- `get_install_abis`;
  1868. echo $#
  1869. }
  1870. optfeature ()
  1871. {
  1872. debug-print-function ${FUNCNAME} "$@";
  1873. local i j msg;
  1874. local desc=$1;
  1875. local flag=0;
  1876. shift;
  1877. for i in "$@";
  1878. do
  1879. for j in ${i};
  1880. do
  1881. if has_version "${j}"; then
  1882. flag=1;
  1883. else
  1884. flag=0;
  1885. break;
  1886. fi;
  1887. done;
  1888. if [[ ${flag} -eq 1 ]]; then
  1889. break;
  1890. fi;
  1891. done;
  1892. if [[ ${flag} -eq 0 ]]; then
  1893. for i in "$@";
  1894. do
  1895. msg=" ";
  1896. for j in ${i};
  1897. do
  1898. msg+=" ${j} and";
  1899. done;
  1900. msg="${msg:0: -4} for ${desc}";
  1901. elog "${msg}";
  1902. done;
  1903. fi
  1904. }
  1905. path_exists ()
  1906. {
  1907. local opt=$1;
  1908. [[ ${opt} == -[ao] ]] && shift || opt="-a";
  1909. [[ $# -eq 0 ]] && return 1;
  1910. local p r=0;
  1911. for p in "$@";
  1912. do
  1913. [[ -e ${p} ]];
  1914. : $(( r += $? ));
  1915. done;
  1916. case ${opt} in
  1917. -a)
  1918. return $(( r != 0 ))
  1919. ;;
  1920. -o)
  1921. return $(( r == $# ))
  1922. ;;
  1923. esac
  1924. }
  1925. pkg_nofetch ()
  1926. {
  1927. default
  1928. }
  1929. preserve_old_lib ()
  1930. {
  1931. _eutils_eprefix_init;
  1932. if [[ ${EBUILD_PHASE} != "preinst" ]]; then
  1933. eerror "preserve_old_lib() must be called from pkg_preinst() only";
  1934. die "Invalid preserve_old_lib() usage";
  1935. fi;
  1936. [[ -z $1 ]] && die "Usage: preserve_old_lib <library to preserve> [more libraries to preserve]";
  1937. has preserve-libs ${FEATURES} && return 0;
  1938. local lib dir;
  1939. for lib in "$@";
  1940. do
  1941. [[ -e ${EROOT}/${lib} ]] || continue;
  1942. dir=${lib%/*};
  1943. dodir ${dir} || die "dodir ${dir} failed";
  1944. cp "${EROOT}"/${lib} "${ED}"/${lib} || die "cp ${lib} failed";
  1945. touch "${ED}"/${lib};
  1946. done
  1947. }
  1948. preserve_old_lib_notify ()
  1949. {
  1950. if [[ ${EBUILD_PHASE} != "postinst" ]]; then
  1951. eerror "preserve_old_lib_notify() must be called from pkg_postinst() only";
  1952. die "Invalid preserve_old_lib_notify() usage";
  1953. fi;
  1954. has preserve-libs ${FEATURES} && return 0;
  1955. _eutils_eprefix_init;
  1956. local lib notice=0;
  1957. for lib in "$@";
  1958. do
  1959. [[ -e ${EROOT}/${lib} ]] || continue;
  1960. if [[ ${notice} -eq 0 ]]; then
  1961. notice=1;
  1962. ewarn "Old versions of installed libraries were detected on your system.";
  1963. ewarn "In order to avoid breaking packages that depend on these old libs,";
  1964. ewarn "the libraries are not being removed. You need to run revdep-rebuild";
  1965. ewarn "in order to remove these old dependencies. If you do not have this";
  1966. ewarn "helper program, simply emerge the 'gentoolkit' package.";
  1967. ewarn;
  1968. fi;
  1969. ewarn " # revdep-rebuild --library '${lib}' && rm '${lib}'";
  1970. done
  1971. }
  1972. prune_libtool_files ()
  1973. {
  1974. debug-print-function ${FUNCNAME} "$@";
  1975. local removing_all removing_modules opt;
  1976. _eutils_eprefix_init;
  1977. for opt in "$@";
  1978. do
  1979. case "${opt}" in
  1980. --all)
  1981. removing_all=1;
  1982. removing_modules=1
  1983. ;;
  1984. --modules)
  1985. removing_modules=1
  1986. ;;
  1987. *)
  1988. die "Invalid argument to ${FUNCNAME}(): ${opt}"
  1989. ;;
  1990. esac;
  1991. done;
  1992. local f;
  1993. local queue=();
  1994. while IFS= read -r -d '' f; do
  1995. local archivefile=${f/%.la/.a};
  1996. if ! sed -n -e '/^# Generated by .*libtool/q0;4q1' "${f}"; then
  1997. continue;
  1998. fi;
  1999. [[ ${f} != ${archivefile} ]] || die 'regex sanity check failed';
  2000. local reason= pkgconfig_scanned=;
  2001. local snotlink=$(sed -n -e 's:^shouldnotlink=::p' "${f}");
  2002. if [[ ${snotlink} == yes ]]; then
  2003. if [[ -f ${archivefile} ]]; then
  2004. einfo "Removing unnecessary ${archivefile#${D%/}} (static plugin)";
  2005. queue+=("${archivefile}");
  2006. fi;
  2007. if [[ -n ${removing_modules} ]]; then
  2008. reason='module';
  2009. fi;
  2010. else
  2011. if [[ -n ${removing_all} ]]; then
  2012. reason='requested';
  2013. else
  2014. if [[ ! -f ${archivefile} ]]; then
  2015. reason='no static archive';
  2016. else
  2017. if [[ ! -n $(sed -nre "s/^(dependency_libs|inherited_linker_flags)='(.*)'$/\2/p" "${f}") ]]; then
  2018. reason='no libs & flags';
  2019. else
  2020. if [[ ! -n ${pkgconfig_scanned} ]]; then
  2021. local pc_libs=();
  2022. if [[ ! -n ${removing_all} ]]; then
  2023. local pc;
  2024. local tf=${T}/prune-lt-files.pc;
  2025. local pkgconf=$(tc-getPKG_CONFIG);
  2026. while IFS= read -r -d '' pc; do
  2027. local arg libs;
  2028. if ${pkgconf} --exists "${pc}" &>/dev/null; then
  2029. sed -e '/^Requires:/d' "${pc}" > "${tf}";
  2030. libs=$(${pkgconf} --libs "${tf}");
  2031. else
  2032. libs=$(sed -ne 's/^Libs://p' "${pc}");
  2033. fi;
  2034. for arg in ${libs};
  2035. do
  2036. if [[ ${arg} == -l* ]]; then
  2037. if [[ ${arg} == '*$*' ]]; then
  2038. eqawarn "${FUNCNAME}: variable substitution likely failed in ${pc}";
  2039. eqawarn "(arg: ${arg})";
  2040. eqawarn "Most likely, you need to add virtual/pkgconfig to DEPEND.";
  2041. fi;
  2042. pc_libs+=(lib${arg#-l}.la);
  2043. fi;
  2044. done;
  2045. done < <(find "${D}" -type f -name '*.pc' -print0);
  2046. rm -f "${tf}";
  2047. fi;
  2048. pkgconfig_scanned=1;
  2049. fi;
  2050. has "${f##*/}" "${pc_libs[@]}" && reason='covered by .pc';
  2051. fi;
  2052. fi;
  2053. fi;
  2054. fi;
  2055. if [[ -n ${reason} ]]; then
  2056. einfo "Removing unnecessary ${f#${D%/}} (${reason})";
  2057. queue+=("${f}");
  2058. fi;
  2059. done < <(find "${ED}" -xtype f -name '*.la' -print0);
  2060. if [[ -n ${queue[@]} ]]; then
  2061. rm -f "${queue[@]}";
  2062. fi
  2063. }
  2064. src_compile ()
  2065. {
  2066. export -n CFLAGS;
  2067. export -n CXXFLAGS;
  2068. [ -n "$(tc-getCC)" ] || CC="gcc";
  2069. emake PREFIX=/usr MANDIR=share/man CC="$(tc-getCC)" || die
  2070. }
  2071. src_configure ()
  2072. {
  2073. default
  2074. }
  2075. src_install ()
  2076. {
  2077. sed -i -e 's/\/local//' etc/yaboot.conf;
  2078. make ROOT="${D}" PREFIX=/usr MANDIR=share/man install || die;
  2079. mv "${D}/etc/yaboot.conf" "${D}/etc/yaboot.conf.sample"
  2080. }
  2081. src_prepare ()
  2082. {
  2083. epatch "${FILESDIR}/yabootconfig-1.3.13.patch";
  2084. epatch "${FILESDIR}/chrpfix.patch";
  2085. if [[ "$(gcc-major-version)" -eq "3" ]]; then
  2086. epatch "${FILESDIR}/${PN}-nopiessp.patch";
  2087. fi;
  2088. if [[ "$(gcc-major-version)" -eq "4" ]]; then
  2089. epatch "${FILESDIR}/${P}-nopiessp-gcc4.patch";
  2090. fi;
  2091. sed -i "s:-Werror:-Wno-error:g" Makefile;
  2092. epatch "${FILESDIR}/${PN}-stubfuncs.patch";
  2093. epatch "${FILESDIR}/new-ofpath-devspec.patch"
  2094. }
  2095. src_test ()
  2096. {
  2097. default
  2098. }
  2099. src_unpack ()
  2100. {
  2101. unpack ${A};
  2102. cd "${S}";
  2103. cp "${FILESDIR}/new-ofpath" "${S}/ybin/ofpath"
  2104. }
  2105. strip-linguas ()
  2106. {
  2107. local ls newls nols;
  2108. if [[ $1 == "-i" ]] || [[ $1 == "-u" ]]; then
  2109. local op=$1;
  2110. shift;
  2111. ls=$(find "$1" -name '*.po' -exec basename {} .po ';');
  2112. shift;
  2113. local d f;
  2114. for d in "$@";
  2115. do
  2116. if [[ ${op} == "-u" ]]; then
  2117. newls=${ls};
  2118. else
  2119. newls="";
  2120. fi;
  2121. for f in $(find "$d" -name '*.po' -exec basename {} .po ';');
  2122. do
  2123. if [[ ${op} == "-i" ]]; then
  2124. has ${f} ${ls} && newls="${newls} ${f}";
  2125. else
  2126. has ${f} ${ls} || newls="${newls} ${f}";
  2127. fi;
  2128. done;
  2129. ls=${newls};
  2130. done;
  2131. else
  2132. ls="$@";
  2133. fi;
  2134. nols="";
  2135. newls="";
  2136. for f in ${LINGUAS};
  2137. do
  2138. if has ${f} ${ls}; then
  2139. newls="${newls} ${f}";
  2140. else
  2141. nols="${nols} ${f}";
  2142. fi;
  2143. done;
  2144. [[ -n ${nols} ]] && einfo "Sorry, but ${PN} does not support the LINGUAS:" ${nols};
  2145. export LINGUAS=${newls:1}
  2146. }
  2147. tc-arch ()
  2148. {
  2149. tc-ninja_magic_to_arch portage "$@"
  2150. }
  2151. tc-arch-kernel ()
  2152. {
  2153. tc-ninja_magic_to_arch kern "$@"
  2154. }
  2155. tc-endian ()
  2156. {
  2157. local host=$1;
  2158. [[ -z ${host} ]] && host=${CTARGET:-${CHOST}};
  2159. host=${host%%-*};
  2160. case ${host} in
  2161. aarch64*be)
  2162. echo big
  2163. ;;
  2164. aarch64)
  2165. echo little
  2166. ;;
  2167. alpha*)
  2168. echo big
  2169. ;;
  2170. arm*b*)
  2171. echo big
  2172. ;;
  2173. arm*)
  2174. echo little
  2175. ;;
  2176. cris*)
  2177. echo little
  2178. ;;
  2179. hppa*)
  2180. echo big
  2181. ;;
  2182. i?86*)
  2183. echo little
  2184. ;;
  2185. ia64*)
  2186. echo little
  2187. ;;
  2188. m68*)
  2189. echo big
  2190. ;;
  2191. mips*l*)
  2192. echo little
  2193. ;;
  2194. mips*)
  2195. echo big
  2196. ;;
  2197. powerpc*le)
  2198. echo little
  2199. ;;
  2200. powerpc*)
  2201. echo big
  2202. ;;
  2203. s390*)
  2204. echo big
  2205. ;;
  2206. sh*b*)
  2207. echo big
  2208. ;;
  2209. sh*)
  2210. echo little
  2211. ;;
  2212. sparc*)
  2213. echo big
  2214. ;;
  2215. x86_64*)
  2216. echo little
  2217. ;;
  2218. *)
  2219. echo wtf
  2220. ;;
  2221. esac
  2222. }
  2223. tc-env_build ()
  2224. {
  2225. tc-export_build_env;
  2226. CFLAGS=${BUILD_CFLAGS} CXXFLAGS=${BUILD_CXXFLAGS} CPPFLAGS=${BUILD_CPPFLAGS} LDFLAGS=${BUILD_LDFLAGS} AR=$(tc-getBUILD_AR) AS=$(tc-getBUILD_AS) CC=$(tc-getBUILD_CC) CPP=$(tc-getBUILD_CPP) CXX=$(tc-getBUILD_CXX) LD=$(tc-getBUILD_LD) NM=$(tc-getBUILD_NM) PKG_CONFIG=$(tc-getBUILD_PKG_CONFIG) RANLIB=$(tc-getBUILD_RANLIB) "$@"
  2227. }
  2228. tc-export ()
  2229. {
  2230. local var;
  2231. for var in "$@";
  2232. do
  2233. [[ $(type -t tc-get${var}) != "function" ]] && die "tc-export: invalid export variable '${var}'";
  2234. eval tc-get${var} > /dev/null;
  2235. done
  2236. }
  2237. tc-export_build_env ()
  2238. {
  2239. tc-export "$@";
  2240. : ${BUILD_CFLAGS:=-O1 -pipe};
  2241. : ${BUILD_CXXFLAGS:=-O1 -pipe};
  2242. : ${BUILD_CPPFLAGS:=};
  2243. : ${BUILD_LDFLAGS:=};
  2244. export BUILD_{C,CXX,CPP,LD}FLAGS;
  2245. local v;
  2246. for v in BUILD_{C,CXX,CPP,LD}FLAGS;
  2247. do
  2248. export ${v#BUILD_}_FOR_BUILD="${!v}";
  2249. done
  2250. }
  2251. tc-getAR ()
  2252. {
  2253. tc-getPROG AR ar "$@"
  2254. }
  2255. tc-getAS ()
  2256. {
  2257. tc-getPROG AS as "$@"
  2258. }
  2259. tc-getBUILD_AR ()
  2260. {
  2261. tc-getBUILD_PROG AR ar "$@"
  2262. }
  2263. tc-getBUILD_AS ()
  2264. {
  2265. tc-getBUILD_PROG AS as "$@"
  2266. }
  2267. tc-getBUILD_CC ()
  2268. {
  2269. tc-getBUILD_PROG CC gcc "$@"
  2270. }
  2271. tc-getBUILD_CPP ()
  2272. {
  2273. tc-getBUILD_PROG CPP cpp "$@"
  2274. }
  2275. tc-getBUILD_CXX ()
  2276. {
  2277. tc-getBUILD_PROG CXX g++ "$@"
  2278. }
  2279. tc-getBUILD_LD ()
  2280. {
  2281. tc-getBUILD_PROG LD ld "$@"
  2282. }
  2283. tc-getBUILD_NM ()
  2284. {
  2285. tc-getBUILD_PROG NM nm "$@"
  2286. }
  2287. tc-getBUILD_OBJCOPY ()
  2288. {
  2289. tc-getBUILD_PROG OBJCOPY objcopy "$@"
  2290. }
  2291. tc-getBUILD_PKG_CONFIG ()
  2292. {
  2293. tc-getBUILD_PROG PKG_CONFIG pkg-config "$@"
  2294. }
  2295. tc-getBUILD_PROG ()
  2296. {
  2297. _tc-getPROG CBUILD "BUILD_$1 $1_FOR_BUILD HOST$1" "${@:2}"
  2298. }
  2299. tc-getBUILD_RANLIB ()
  2300. {
  2301. tc-getBUILD_PROG RANLIB ranlib "$@"
  2302. }
  2303. tc-getBUILD_STRIP ()
  2304. {
  2305. tc-getBUILD_PROG STRIP strip "$@"
  2306. }
  2307. tc-getCC ()
  2308. {
  2309. tc-getPROG CC gcc "$@"
  2310. }
  2311. tc-getCPP ()
  2312. {
  2313. tc-getPROG CPP cpp "$@"
  2314. }
  2315. tc-getCXX ()
  2316. {
  2317. tc-getPROG CXX g++ "$@"
  2318. }
  2319. tc-getDLLWRAP ()
  2320. {
  2321. tc-getPROG DLLWRAP dllwrap "$@"
  2322. }
  2323. tc-getF77 ()
  2324. {
  2325. tc-getPROG F77 gfortran "$@"
  2326. }
  2327. tc-getFC ()
  2328. {
  2329. tc-getPROG FC gfortran "$@"
  2330. }
  2331. tc-getGCJ ()
  2332. {
  2333. tc-getPROG GCJ gcj "$@"
  2334. }
  2335. tc-getLD ()
  2336. {
  2337. tc-getPROG LD ld "$@"
  2338. }
  2339. tc-getNM ()
  2340. {
  2341. tc-getPROG NM nm "$@"
  2342. }
  2343. tc-getOBJCOPY ()
  2344. {
  2345. tc-getPROG OBJCOPY objcopy "$@"
  2346. }
  2347. tc-getOBJDUMP ()
  2348. {
  2349. tc-getPROG OBJDUMP objdump "$@"
  2350. }
  2351. tc-getPKG_CONFIG ()
  2352. {
  2353. tc-getPROG PKG_CONFIG pkg-config "$@"
  2354. }
  2355. tc-getPROG ()
  2356. {
  2357. _tc-getPROG CHOST "$@"
  2358. }
  2359. tc-getRANLIB ()
  2360. {
  2361. tc-getPROG RANLIB ranlib "$@"
  2362. }
  2363. tc-getRC ()
  2364. {
  2365. tc-getPROG RC windres "$@"
  2366. }
  2367. tc-getSTRIP ()
  2368. {
  2369. tc-getPROG STRIP strip "$@"
  2370. }
  2371. tc-has-openmp ()
  2372. {
  2373. local base="${T}/test-tc-openmp";
  2374. cat > "${base}.c" <<-EOF
  2375. #include <omp.h>
  2376. int main() {
  2377. int nthreads, tid, ret = 0;
  2378. #pragma omp parallel private(nthreads, tid)
  2379. {
  2380. tid = omp_get_thread_num();
  2381. nthreads = omp_get_num_threads(); ret += tid + nthreads;
  2382. }
  2383. return ret;
  2384. }
  2385. EOF
  2386.  
  2387. $(tc-getCC "$@") -fopenmp "${base}.c" -o "${base}" &>/dev/null;
  2388. local ret=$?;
  2389. rm -f "${base}"*;
  2390. return ${ret}
  2391. }
  2392. tc-has-tls ()
  2393. {
  2394. local base="${T}/test-tc-tls";
  2395. cat > "${base}.c" <<-EOF
  2396. int foo(int *i) {
  2397. static __thread int j = 0;
  2398. return *i ? j : *i;
  2399. }
  2400. EOF
  2401.  
  2402. local flags;
  2403. case $1 in
  2404. -s)
  2405. flags="-S"
  2406. ;;
  2407. -c)
  2408. flags="-c"
  2409. ;;
  2410. -l)
  2411.  
  2412. ;;
  2413. -*)
  2414. die "Usage: tc-has-tls [-c|-l] [toolchain prefix]"
  2415. ;;
  2416. esac;
  2417. : ${flags:=-fPIC -shared -Wl,-z,defs};
  2418. [[ $1 == -* ]] && shift;
  2419. $(tc-getCC "$@") ${flags} "${base}.c" -o "${base}" &>/dev/null;
  2420. local ret=$?;
  2421. rm -f "${base}"*;
  2422. return ${ret}
  2423. }
  2424. tc-is-cross-compiler ()
  2425. {
  2426. [[ ${CBUILD:-${CHOST}} != ${CHOST} ]]
  2427. }
  2428. tc-is-softfloat ()
  2429. {
  2430. local CTARGET=${CTARGET:-${CHOST}};
  2431. case ${CTARGET} in
  2432. bfin* | h8300*)
  2433. echo "only"
  2434. ;;
  2435. *)
  2436. if [[ ${CTARGET//_/-} == *-softfloat-* ]]; then
  2437. echo "yes";
  2438. else
  2439. if [[ ${CTARGET//_/-} == *-softfp-* ]]; then
  2440. echo "softfp";
  2441. else
  2442. echo "no";
  2443. fi;
  2444. fi
  2445. ;;
  2446. esac
  2447. }
  2448. tc-is-static-only ()
  2449. {
  2450. local host=${CTARGET:-${CHOST}};
  2451. [[ ${host} == *-mint* ]]
  2452. }
  2453. tc-ld-disable-gold ()
  2454. {
  2455. if ! tc-ld-is-gold "$@"; then
  2456. return;
  2457. fi;
  2458. ewarn "Forcing usage of the BFD linker instead of GOLD";
  2459. local bfd_ld="$(tc-getLD "$@").bfd";
  2460. local path_ld=$(which "${bfd_ld}" 2>/dev/null);
  2461. [[ -e ${path_ld} ]] && export LD=${bfd_ld};
  2462. local major=$(gcc-major-version "$@");
  2463. local minor=$(gcc-minor-version "$@");
  2464. if [[ ${major} -lt 4 ]] || [[ ${major} -eq 4 && ${minor} -lt 8 ]]; then
  2465. if [[ -e ${path_ld} ]]; then
  2466. local d="${T}/bfd-linker";
  2467. mkdir -p "${d}";
  2468. ln -sf "${path_ld}" "${d}"/ld;
  2469. export LDFLAGS="${LDFLAGS} -B${d}";
  2470. else
  2471. die "unable to locate a BFD linker to bypass gold";
  2472. fi;
  2473. else
  2474. export LDFLAGS="${LDFLAGS} -fuse-ld=bfd";
  2475. fi
  2476. }
  2477. tc-ld-is-gold ()
  2478. {
  2479. local out;
  2480. out=$($(tc-getLD "$@") --version 2>&1);
  2481. if [[ ${out} == *"GNU gold"* ]]; then
  2482. return 0;
  2483. fi;
  2484. local base="${T}/test-tc-gold";
  2485. cat > "${base}.c" <<-EOF
  2486. int main() { return 0; }
  2487. EOF
  2488.  
  2489. out=$($(tc-getCC "$@") ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -Wl,--version "${base}.c" -o "${base}" 2>&1);
  2490. rm -f "${base}"*;
  2491. if [[ ${out} == *"GNU gold"* ]]; then
  2492. return 0;
  2493. fi;
  2494. return 1
  2495. }
  2496. tc-ninja_magic_to_arch ()
  2497. {
  2498. function ninj ()
  2499. {
  2500. [[ ${type} == "kern" ]] && echo $1 || echo $2
  2501. };
  2502. local type=$1;
  2503. local host=$2;
  2504. [[ -z ${host} ]] && host=${CTARGET:-${CHOST}};
  2505. local KV=${KV:-${KV_FULL}};
  2506. [[ ${type} == "kern" ]] && [[ -z ${KV} ]] && ewarn "QA: Kernel version could not be determined, please inherit kernel-2 or linux-info";
  2507. case ${host} in
  2508. aarch64*)
  2509. echo arm64
  2510. ;;
  2511. alpha*)
  2512. echo alpha
  2513. ;;
  2514. arm*)
  2515. echo arm
  2516. ;;
  2517. avr*)
  2518. ninj avr32 avr
  2519. ;;
  2520. bfin*)
  2521. ninj blackfin bfin
  2522. ;;
  2523. c6x*)
  2524. echo c6x
  2525. ;;
  2526. cris*)
  2527. echo cris
  2528. ;;
  2529. frv*)
  2530. echo frv
  2531. ;;
  2532. hexagon*)
  2533. echo hexagon
  2534. ;;
  2535. hppa*)
  2536. ninj parisc hppa
  2537. ;;
  2538. i?86*)
  2539. if [[ ${type} == "kern" ]] && [[ $(KV_to_int ${KV}) -lt $(KV_to_int 2.6.24) || ${host} == *freebsd* ]]; then
  2540. echo i386;
  2541. else
  2542. echo x86;
  2543. fi
  2544. ;;
  2545. ia64*)
  2546. echo ia64
  2547. ;;
  2548. m68*)
  2549. echo m68k
  2550. ;;
  2551. metag*)
  2552. echo metag
  2553. ;;
  2554. microblaze*)
  2555. echo microblaze
  2556. ;;
  2557. mips*)
  2558. echo mips
  2559. ;;
  2560. nios2*)
  2561. echo nios2
  2562. ;;
  2563. nios*)
  2564. echo nios
  2565. ;;
  2566. or32*)
  2567. echo openrisc
  2568. ;;
  2569. powerpc*)
  2570. if [[ ${type} == "kern" ]] && [[ $(KV_to_int ${KV}) -ge $(KV_to_int 2.6.16) ]]; then
  2571. echo powerpc;
  2572. else
  2573. if [[ ${type} == "kern" ]] && [[ $(KV_to_int ${KV}) -eq $(KV_to_int 2.6.15) ]]; then
  2574. if [[ ${host} == powerpc64* ]] || [[ ${PROFILE_ARCH} == "ppc64" ]]; then
  2575. echo powerpc;
  2576. else
  2577. echo ppc;
  2578. fi;
  2579. else
  2580. if [[ ${host} == powerpc64* ]]; then
  2581. echo ppc64;
  2582. else
  2583. if [[ ${PROFILE_ARCH} == "ppc64" ]]; then
  2584. ninj ppc64 ppc;
  2585. else
  2586. echo ppc;
  2587. fi;
  2588. fi;
  2589. fi;
  2590. fi
  2591. ;;
  2592. riscv*)
  2593. echo riscv
  2594. ;;
  2595. s390*)
  2596. echo s390
  2597. ;;
  2598. score*)
  2599. echo score
  2600. ;;
  2601. sh64*)
  2602. ninj sh64 sh
  2603. ;;
  2604. sh*)
  2605. echo sh
  2606. ;;
  2607. sparc64*)
  2608. ninj sparc64 sparc
  2609. ;;
  2610. sparc*)
  2611. [[ ${PROFILE_ARCH} == "sparc64" ]] && ninj sparc64 sparc || echo sparc
  2612. ;;
  2613. tile*)
  2614. echo tile
  2615. ;;
  2616. vax*)
  2617. echo vax
  2618. ;;
  2619. x86_64*freebsd*)
  2620. echo amd64
  2621. ;;
  2622. x86_64*)
  2623. if [[ ${type} == "kern" ]] && [[ $(KV_to_int ${KV}) -ge $(KV_to_int 2.6.24) ]]; then
  2624. echo x86;
  2625. else
  2626. ninj x86_64 amd64;
  2627. fi
  2628. ;;
  2629. xtensa*)
  2630. echo xtensa
  2631. ;;
  2632. *)
  2633. echo unknown
  2634. ;;
  2635. esac
  2636. }
  2637. use_if_iuse ()
  2638. {
  2639. in_iuse $1 || return 1;
  2640. use $1
  2641. }
  2642. usex ()
  2643. {
  2644. use "$1" && echo "${2-yes}$4" || echo "${3-no}$5"
  2645. }
  2646. validate_desktop_entries ()
  2647. {
  2648. _eutils_eprefix_init;
  2649. if [[ -x "${EPREFIX}"/usr/bin/desktop-file-validate ]]; then
  2650. einfo "Checking desktop entry validity";
  2651. local directories="";
  2652. for d in /usr/share/applications $@;
  2653. do
  2654. [[ -d ${ED}${d} ]] && directories="${directories} ${ED}${d}";
  2655. done;
  2656. if [[ -n ${directories} ]]; then
  2657. for FILE in $(find ${directories} -name "*\.desktop" -not -path '*.hidden*' | sort -u 2>/dev/null);
  2658. do
  2659. local temp=$(desktop-file-validate ${FILE} | grep -v "warning:" | sed -e "s|error: ||" -e "s|${FILE}:|--|g" );
  2660. [[ -n $temp ]] && elog ${temp/--/${FILE/${ED}/}:};
  2661. done;
  2662. fi;
  2663. echo "";
  2664. else
  2665. einfo "Passing desktop entry validity check. Install dev-util/desktop-file-utils, if you want to help to improve Gentoo.";
  2666. fi
  2667. }
  2668.  
  2669. EMERGE --INFO
  2670.  
  2671. Portage 2.2.14 (python 2.7.9-final-0, default/linux/powerpc/ppc32/13.0/desktop, gcc-4.8.3, glibc-2.19-r1, 3.12.21-gentoo-r1-ppc32 ppc)
  2672. =================================================================
  2673. System Settings
  2674. =================================================================
  2675. System uname: Linux-3.12.21-gentoo-r1-ppc32-ppc-7447A,_altivec_supported-with-gentoo-2.2
  2676. KiB Mem: 253184 total, 58540 free
  2677. KiB Swap: 524284 total, 462920 free
  2678. Timestamp of tree: Tue, 17 Mar 2015 00:45:01 +0000
  2679. ld GNU ld (Gentoo 2.24 p1.4) 2.24
  2680. app-shells/bash: 4.2_p53
  2681. dev-lang/perl: 5.20.1-r4
  2682. dev-lang/python: 2.7.9-r1, 3.3.5-r1
  2683. dev-util/pkgconfig: 0.28-r1
  2684. sys-apps/baselayout: 2.2
  2685. sys-apps/openrc: 0.13.11
  2686. sys-apps/sandbox: 2.6-r1
  2687. sys-devel/autoconf: 2.69
  2688. sys-devel/automake: 1.13.4
  2689. sys-devel/binutils: 2.24-r3
  2690. sys-devel/gcc: 4.8.3
  2691. sys-devel/gcc-config: 1.7.3
  2692. sys-devel/libtool: 2.4.4
  2693. sys-devel/make: 4.1-r1
  2694. sys-kernel/linux-headers: 3.16 (virtual/os-headers)
  2695. sys-libs/glibc: 2.19-r1
  2696. Repositories: gentoo
  2697. ACCEPT_KEYWORDS="ppc"
  2698. ACCEPT_LICENSE="* -@EULA"
  2699. CBUILD="powerpc-unknown-linux-gnu"
  2700. CFLAGS="-O2 -mcpu=powerpc -mtune=powerpc"
  2701. CHOST="powerpc-unknown-linux-gnu"
  2702. CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
  2703. CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/sandbox.d /etc/terminfo"
  2704. CXXFLAGS="-O2 -mcpu=powerpc -mtune=powerpc"
  2705. DISTDIR="/usr/portage/distfiles"
  2706. FCFLAGS="-O2 -pipe"
  2707. FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
  2708. FFLAGS="-O2 -pipe"
  2709. GENTOO_MIRRORS="http://www.gtlib.gatech.edu/pub/gentoo http://mirrors.rit.edu/gentoo/ http://mirror.lug.udel.edu/pub/gentoo/"
  2710. LANG="en_US.utf8"
  2711. LDFLAGS="-Wl,-O1 -Wl,--as-needed"
  2712. MAKEOPTS="-j2"
  2713. PKGDIR="/usr/portage/packages"
  2714. PORTAGE_CONFIGROOT="/"
  2715. PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
  2716. PORTAGE_TMPDIR="/var/tmp"
  2717. PORTDIR="/usr/portage"
  2718. PORTDIR_OVERLAY=""
  2719. SYNC="rsync://rsync5.us.gentoo.org/gentoo-portage"
  2720. USE="X a52 aac acl alsa berkdb bindist bluetooth branding bzip2 cairo cdda cdr cli consolekit cracklib crypt cups cxx dbus dri dts dvd dvdr emboss encode exif fam firefox flac fortran gdbm gif glamor gpm gtk iconv ipv6 jpeg lcms ldap libav libnotify mad mng modules mp3 mp4 mpeg ncurses nls nptl ogg opengl openmp pam pango pcre pdf png policykit ppc ppds qt3support qt4 readline sdl session spell ssl startup-notification svg tcpd tiff truetype udev udisks unicode upower usb vorbis wxwidgets x264 xcb xml xv xvid zlib" ABI_PPC="32" ALSA_CARDS="aoa aoa-fabric-layout aoa-onyx aoa-soundbus aoa-soundbus-i2s aoa-tas aoa-toonie powermac usb-audio via82xx" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="fbdev glint mach64 mga nv r128 radeon savage tdfx trident dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
  2721. Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement