Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

Corrupted bzip2 with bad march: Illegal instruction

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
15 posts • Page 1 of 1
Author
Message
jmanko
Tux's lil' helper
Tux's lil' helper
Posts: 139
Joined: Sun Sep 11, 2005 5:41 pm
Location: NEPA, USA

Corrupted bzip2 with bad march: Illegal instruction

  • Quote

Post by jmanko » Fri Aug 06, 2021 1:06 am

Today I upgraded machines from an i5-2400 to Xeon E-2236. I wanted to recompile system/world, so I changed my "march".

Intel lists teh E-2236 as Coffee Lake: https://www.intel.com/content/www/us/en ... tions.html

So, according this post, https://stackoverflow.com/questions/943 ... s-for-xeon, I changed the march to "skylake-avxs512".

GCC states that "skylake-avxs512" (https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html):
Intel Skylake Server CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA, BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC, XSAVES, AVX512F, CLWB, AVX512VL, AVX512BW, AVX512DQ and AVX512CD instruction set support.

Code: Select all

# cat /proc/cpuinfo
processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 158
model name	: Intel(R) Xeon(R) E-2236 CPU @ 3.40GHz
stepping	: 10
microcode	: 0xea
cpu MHz		: 3400.000
cache size	: 12288 KB
physical id	: 0
siblings	: 12
core id		: 0
cpu cores	: 6
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 22
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts md_clear flush_l1d
vmx flags	: vnmi preemption_timer invvpid ept_x_only ept_ad ept_1gb flexpriority tsc_offset vtpr mtf vapic ept vpid unrestricted_guest ple shadow_vmcs pml ept_mode_based_exec
bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs taa itlb_multihit srbds
bogomips	: 6799.81
clflush size	: 64
cache_alignment	: 64
address sizes	: 39 bits physical, 48 bits virtual
power management:
I started to compile

Code: Select all

emerge --ask --emptytree --usepkg=n @system
After a few packages in I starting hitting (I had to rerun in order to get this output, but it's the same for the packages that started to fail):

Code: Select all

bzip2: Compressed file ends unexpectedly;
	perhaps it is corrupted?  *Possible* reason follows.
bzip2: Success
	Input file = /var/db/pkg/sys-devel/gnuconfig-20210107/environment.bz2, output file = (stdout)

It is possible that the compressed file(s) have become corrupted.
You can use the -tvv option to test integrity of such files.

You can use the `bzip2recover' program to attempt to recover
data from undamaged sections of corrupted files.

!!! FAILED prerm: 2
/var/tmp/portage/._portage_reinstall_.r972a1bi/bin/phase-functions.sh: line 981: 31900 Done                    __save_ebuild_env --exclude-init-phases
     31901                       | __filter_readonly_variables --filter-path --filter-sandbox --allow-extra-vars
     31902 Illegal instruction     | ${PORTAGE_BZIP2_COMMAND} -c -f9 > "$PORTAGE_UPDATE_ENV"
 * ERROR: sys-devel/gnuconfig-20210107::gentoo failed (postinst phase):
 *   __save_ebuild_env failed
 * 
 * Call stack:
 *               ebuild.sh, line  809:  Called __ebuild_main 'postinst'
 *      phase-functions.sh, line 1007:  Called assert '__save_ebuild_env failed'
 *   isolated-functions.sh, line   18:  Called die
 * The specific snippet of code:
 *   		[[ $x -eq 0 ]] || die "$@"
 * 
 * If you need support, post the output of `emerge --info '=sys-devel/gnuconfig-20210107::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-devel/gnuconfig-20210107::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/sys-devel/gnuconfig-20210107/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-devel/gnuconfig-20210107/temp/environment'.
 * Working directory: '/var/tmp/portage/._portage_reinstall_.r972a1bi/lib'
 * S: '/var/tmp/portage/sys-devel/gnuconfig-20210107/work'
 * FAILED postinst: 1

So, that lead me to think that the recommended march was wrong. So, I ask gcc what it wants:

Code: Select all

# gcc -march=native -Q --help=target
The following options are target specific:
  -m128bit-long-double        		[enabled]
  -m16                        		[disabled]
  -m32                        		[disabled]
  -m3dnow                     		[disabled]
  -m3dnowa                    		[disabled]
  -m64                        		[enabled]
  -m80387                     		[enabled]
  -m8bit-idiv                 		[disabled]
  -m96bit-long-double         		[disabled]
  -mabi=                      		sysv
  -mabm                       		[enabled]
  -maccumulate-outgoing-args  		[disabled]
  -maddress-mode=             		long
  -madx                       		[enabled]
  -maes                       		[enabled]
  -malign-data=               		compat
  -malign-double              		[disabled]
  -malign-functions=          		0
  -malign-jumps=              		0
  -malign-loops=              		0
  -malign-stringops           		[enabled]
  -mamx-bf16                  		[disabled]
  -mamx-int8                  		[disabled]
  -mamx-tile                  		[disabled]
  -mandroid                   		[disabled]
  -march=                     		skylake
  -masm=                      		att
  -mavx                       		[enabled]
  -mavx2                      		[enabled]
  -mavx256-split-unaligned-load 	[disabled]
  -mavx256-split-unaligned-store 	[disabled]
  -mavx5124fmaps              		[disabled]
  -mavx5124vnniw              		[disabled]
  -mavx512bf16                		[disabled]
  -mavx512bitalg              		[disabled]
  -mavx512bw                  		[disabled]
  -mavx512cd                  		[disabled]
  -mavx512dq                  		[disabled]
  -mavx512er                  		[disabled]
  -mavx512f                   		[disabled]
  -mavx512ifma                		[disabled]
  -mavx512pf                  		[disabled]
  -mavx512vbmi                		[disabled]
  -mavx512vbmi2               		[disabled]
  -mavx512vl                  		[disabled]
  -mavx512vnni                		[disabled]
  -mavx512vp2intersect        		[disabled]
  -mavx512vpopcntdq           		[disabled]
  -mavxvnni                   		[disabled]
  -mbionic                    		[disabled]
  -mbmi                       		[enabled]
  -mbmi2                      		[enabled]
  -mbranch-cost=<0,5>         		3
  -mcall-ms2sysv-xlogues      		[disabled]
  -mcet-switch                		[disabled]
  -mcld                       		[disabled]
  -mcldemote                  		[disabled]
  -mclflushopt                		[enabled]
  -mclwb                      		[disabled]
  -mclzero                    		[disabled]
  -mcmodel=                   		[default]
  -mcpu=                      		
  -mcrc32                     		[disabled]
  -mcx16                      		[enabled]
  -mdispatch-scheduler        		[disabled]
  -mdump-tune-features        		[disabled]
  -menqcmd                    		[disabled]
  -mf16c                      		[enabled]
  -mfancy-math-387            		[enabled]
  -mfentry                    		[disabled]
  -mfentry-name=              		
  -mfentry-section=           		
  -mfma                       		[enabled]
  -mfma4                      		[disabled]
  -mforce-drap                		[disabled]
  -mforce-indirect-call       		[disabled]
  -mfp-ret-in-387             		[enabled]
  -mfpmath=                   		sse
  -mfsgsbase                  		[enabled]
  -mfunction-return=          		keep
  -mfused-madd                		-ffp-contract=fast
  -mfxsr                      		[enabled]
  -mgeneral-regs-only         		[disabled]
  -mgfni                      		[disabled]
  -mglibc                     		[enabled]
  -mhard-float                		[enabled]
  -mhle                       		[enabled]
  -mhreset                    		[disabled]
  -miamcu                     		[disabled]
  -mieee-fp                   		[enabled]
  -mincoming-stack-boundary=  		0
  -mindirect-branch-register  		[disabled]
  -mindirect-branch=          		keep
  -minline-all-stringops      		[disabled]
  -minline-stringops-dynamically 	[disabled]
  -minstrument-return=        		none
  -mintel-syntax              		-masm=intel
  -mkl                        		[disabled]
  -mlarge-data-threshold=<number> 	65536
  -mlong-double-128           		[disabled]
  -mlong-double-64            		[disabled]
  -mlong-double-80            		[enabled]
  -mlwp                       		[disabled]
  -mlzcnt                     		[enabled]
  -mmanual-endbr              		[disabled]
  -mmemcpy-strategy=          		
  -mmemset-strategy=          		
  -mmitigate-rop              		[disabled]
  -mmmx                       		[enabled]
  -mmovbe                     		[enabled]
  -mmovdir64b                 		[disabled]
  -mmovdiri                   		[disabled]
  -mmpx                       		[disabled]
  -mms-bitfields              		[disabled]
  -mmusl                      		[disabled]
  -mmwaitx                    		[disabled]
  -mneeded                    		[disabled]
  -mno-align-stringops        		[disabled]
  -mno-default                		[disabled]
  -mno-fancy-math-387         		[disabled]
  -mno-push-args              		[disabled]
  -mno-red-zone               		[disabled]
  -mno-sse4                   		[disabled]
  -mnop-mcount                		[disabled]
  -momit-leaf-frame-pointer   		[disabled]
  -mpc32                      		[disabled]
  -mpc64                      		[disabled]
  -mpc80                      		[disabled]
  -mpclmul                    		[enabled]
  -mpcommit                   		[disabled]
  -mpconfig                   		[disabled]
  -mpku                       		[disabled]
  -mpopcnt                    		[enabled]
  -mprefer-avx128             		-mprefer-vector-width=128
  -mprefer-vector-width=      		none
  -mpreferred-stack-boundary= 		0
  -mprefetchwt1               		[disabled]
  -mprfchw                    		[enabled]
  -mptwrite                   		[disabled]
  -mpush-args                 		[enabled]
  -mrdpid                     		[disabled]
  -mrdrnd                     		[enabled]
  -mrdseed                    		[enabled]
  -mrecip                     		[disabled]
  -mrecip=                    		
  -mrecord-mcount             		[disabled]
  -mrecord-return             		[disabled]
  -mred-zone                  		[enabled]
  -mregparm=                  		6
  -mrtd                       		[disabled]
  -mrtm                       		[enabled]
  -msahf                      		[enabled]
  -mserialize                 		[disabled]
  -msgx                       		[disabled]
  -msha                       		[disabled]
  -mshstk                     		[disabled]
  -mskip-rax-setup            		[disabled]
  -msoft-float                		[disabled]
  -msse                       		[enabled]
  -msse2                      		[enabled]
  -msse2avx                   		[disabled]
  -msse3                      		[enabled]
  -msse4                      		[enabled]
  -msse4.1                    		[enabled]
  -msse4.2                    		[enabled]
  -msse4a                     		[disabled]
  -msse5                      		-mavx
  -msseregparm                		[disabled]
  -mssse3                     		[enabled]
  -mstack-arg-probe           		[disabled]
  -mstack-protector-guard-offset= 	
  -mstack-protector-guard-reg= 		
  -mstack-protector-guard-symbol= 	
  -mstack-protector-guard=    		tls
  -mstackrealign              		[disabled]
  -mstringop-strategy=        		[default]
  -mstv                       		[enabled]
  -mtbm                       		[disabled]
  -mtls-dialect=              		gnu
  -mtls-direct-seg-refs       		[enabled]
  -mtsxldtrk                  		[disabled]
  -mtune-ctrl=                		
  -mtune=                     		skylake
  -muclibc                    		[disabled]
  -muintr                     		[disabled]
  -mvaes                      		[disabled]
  -mveclibabi=                		[default]
  -mvect8-ret-in-mem          		[disabled]
  -mvpclmulqdq                		[disabled]
  -mvzeroupper                		[enabled]
  -mwaitpkg                   		[disabled]
  -mwbnoinvd                  		[disabled]
  -mwidekl                    		[disabled]
  -mx32                       		[disabled]
  -mxop                       		[disabled]
  -mxsave                     		[enabled]
  -mxsavec                    		[enabled]
  -mxsaveopt                  		[enabled]
  -mxsaves                    		[enabled]

  Known assembler dialects (for use with the -masm= option):
    att intel

  Known ABIs (for use with the -mabi= option):
    ms sysv

  Known code models (for use with the -mcmodel= option):
    32 kernel large medium small

  Valid arguments to -mfpmath=:
    387 387+sse 387,sse both sse sse+387 sse,387

  Known indirect branch choices (for use with the -mindirect-branch=/-mfunction-return= options):
    keep thunk thunk-extern thunk-inline

  Known choices for return instrumentation with -minstrument-return=:
    call none nop5

  Known data alignment choices (for use with the -malign-data= option):
    abi cacheline compat

  Known vectorization library ABIs (for use with the -mveclibabi= option):
    acml svml

  Known address mode (for use with the -maddress-mode= option):
    long short

  Known preferred register vector length (to use with the -mprefer-vector-width= option):
    128 256 512 none

  Known stack protector guard (for use with the -mstack-protector-guard= option):
    global tls

  Valid arguments to -mstringop-strategy=:
    byte_loop libcall loop rep_4byte rep_8byte rep_byte unrolled_loop vector_loop

  Known TLS dialects (for use with the -mtls-dialect= option):
    gnu gnu2

  Known valid arguments for -march= option:
    i386 i486 i586 pentium lakemont pentium-mmx winchip-c6 winchip2 c3 samuel-2 c3-2 nehemiah c7 esther i686 pentiumpro pentium2 pentium3 pentium3m pentium-m pentium4 pentium4m prescott nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 cannonlake icelake-client rocketlake icelake-server cascadelake tigerlake cooperlake sapphirerapids alderlake bonnell atom silvermont slm goldmont goldmont-plus tremont knl knm intel geode k6 k6-2 k6-3 athlon athlon-tbird athlon-4 athlon-xp athlon-mp x86-64 x86-64-v2 x86-64-v3 x86-64-v4 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 znver2 znver3 btver1 btver2 generic native

  Known valid arguments for -mtune= option:
    generic i386 i486 pentium lakemont pentiumpro pentium4 nocona core2 nehalem sandybridge haswell bonnell silvermont goldmont goldmont-plus tremont knl knm skylake skylake-avx512 cannonlake icelake-client icelake-server cascadelake tigerlake cooperlake sapphirerapids alderlake rocketlake intel geode k6 athlon k8 amdfam10 bdver1 bdver2 bdver3 bdver4 btver1 btver2 znver1 znver2 znver3

I now see that "avx512" flags are disabled!

hmm, how can fix bzip2 so that I can restart the system compile? I don't mind doing things manually and copying files, if that's required. I current am doing all of this remotely, so that's a factor.

# emerge app-arch/bzip2

Code: Select all

Calculating dependencies... done!

>>> Verifying ebuild manifests

>>> Emerging (1 of 1) app-arch/bzip2-1.0.8-r1::gentoo
 * bzip2-1.0.8.tar.gz BLAKE2B SHA512 size ;-) ...                                                                                                                                                                                                                             [ ok ]
>>> Unpacking source...
>>> Unpacking bzip2-1.0.8.tar.gz to /var/tmp/portage/app-arch/bzip2-1.0.8-r1/work
>>> Source unpacked in /var/tmp/portage/app-arch/bzip2-1.0.8-r1/work
>>> Preparing source in /var/tmp/portage/app-arch/bzip2-1.0.8-r1/work/bzip2-1.0.8 ...
 * Applying bzip2-1.0.4-makefile-CFLAGS.patch ...                                                                                                                                                                                                                             [ ok ]
 * Applying bzip2-1.0.8-saneso.patch ...                                                                                                                                                                                                                                      [ ok ]
 * Applying bzip2-1.0.4-man-links.patch ...
patching file Makefile
Hunk #1 succeeded at 85 with fuzz 2.                                                                                                                                                                                                                                          [ ok ]
 * Applying bzip2-1.0.6-progress.patch ...
patching file bzip2.1
patching file bzip2.c
Hunk #1 succeeded at 53 (offset -92 lines).
Hunk #2 succeeded at 210 with fuzz 2 (offset -92 lines).
Hunk #3 succeeded at 336 (offset -91 lines).
Hunk #4 succeeded at 349 (offset -91 lines).
Hunk #5 succeeded at 372 (offset -91 lines).
Hunk #6 succeeded at 472 with fuzz 2 (offset -87 lines).
Hunk #7 succeeded at 481 (offset -87 lines).
Hunk #8 succeeded at 509 (offset -87 lines).
Hunk #9 succeeded at 1858 (offset -69 lines).
Hunk #10 succeeded at 1936 (offset -69 lines).
Hunk #11 succeeded at 1973 (offset -69 lines).                                                                                                                                                                                                                                [ ok ]
 * Applying bzip2-1.0.3-no-test.patch ...                                                                                                                                                                                                                                     [ ok ]
 * Applying bzip2-1.0.8-mingw.patch ...                                                                                                                                                                                                                                       [ ok ]
 * Applying bzip2-1.0.8-out-of-tree-build.patch ...                                                                                                                                                                                                                           [ ok ]
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/app-arch/bzip2-1.0.8-r1/work/bzip2-1.0.8 ...
 * abi_x86_64.amd64: running multilib-minimal_abi_src_configure
>>> Source configured.
>>> Compiling source in /var/tmp/portage/app-arch/bzip2-1.0.8-r1/work/bzip2-1.0.8 ...
 * abi_x86_64.amd64: running multilib-minimal_abi_src_compile
make -j2 VPATH=/var/tmp/portage/app-arch/bzip2-1.0.8-r1/work/bzip2-1.0.8 CC=x86_64-pc-linux-gnu-gcc AR=x86_64-pc-linux-gnu-ar RANLIB=x86_64-pc-linux-gnu-ranlib -f /var/tmp/portage/app-arch/bzip2-1.0.8-r1/work/bzip2-1.0.8/Makefile-libbz2_so all 
x86_64-pc-linux-gnu-gcc -march=skylake -O2 -pipe -fpic -fPIC -Wall -Winline -D_FILE_OFFSET_BITS=64  -c /var/tmp/portage/app-arch/bzip2-1.0.8-r1/work/bzip2-1.0.8/blocksort.c
x86_64-pc-linux-gnu-gcc -march=skylake -O2 -pipe -fpic -fPIC -Wall -Winline -D_FILE_OFFSET_BITS=64  -c /var/tmp/portage/app-arch/bzip2-1.0.8-r1/work/bzip2-1.0.8/huffman.c
x86_64-pc-linux-gnu-gcc -march=skylake -O2 -pipe -fpic -fPIC -Wall -Winline -D_FILE_OFFSET_BITS=64  -c /var/tmp/portage/app-arch/bzip2-1.0.8-r1/work/bzip2-1.0.8/crctable.c
x86_64-pc-linux-gnu-gcc -march=skylake -O2 -pipe -fpic -fPIC -Wall -Winline -D_FILE_OFFSET_BITS=64  -c /var/tmp/portage/app-arch/bzip2-1.0.8-r1/work/bzip2-1.0.8/randtable.c
x86_64-pc-linux-gnu-gcc -march=skylake -O2 -pipe -fpic -fPIC -Wall -Winline -D_FILE_OFFSET_BITS=64  -c /var/tmp/portage/app-arch/bzip2-1.0.8-r1/work/bzip2-1.0.8/compress.c
/var/tmp/portage/app-arch/bzip2-1.0.8-r1/work/bzip2-1.0.8/blocksort.c: In function ‘mainSort’:
/var/tmp/portage/app-arch/bzip2-1.0.8-r1/work/bzip2-1.0.8/blocksort.c:347:6: warning: inlining failed in call to ‘mainGtU’: --param max-inline-insns-single limit reached [-Winline]
  347 | Bool mainGtU ( UInt32  i1,
      |      ^~~~~~~
/var/tmp/portage/app-arch/bzip2-1.0.8-r1/work/bzip2-1.0.8/blocksort.c:514:18: note: called from here
  514 |          while ( mainGtU (
      |                  ^~~~~~~~~
  515 |                     ptr[j-h]+d, v+d, block, quadrant, nblock, budget
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  516 |                  ) ) {
      |                  ~
/var/tmp/portage/app-arch/bzip2-1.0.8-r1/work/bzip2-1.0.8/blocksort.c:347:6: warning: inlining failed in call to ‘mainGtU’: --param max-inline-insns-single limit reached [-Winline]
  347 | Bool mainGtU ( UInt32  i1,
      |      ^~~~~~~
/var/tmp/portage/app-arch/bzip2-1.0.8-r1/work/bzip2-1.0.8/blocksort.c:528:18: note: called from here
  528 |          while ( mainGtU (
      |                  ^~~~~~~~~
  529 |                     ptr[j-h]+d, v+d, block, quadrant, nblock, budget
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  530 |                  ) ) {
      |                  ~
/var/tmp/portage/app-arch/bzip2-1.0.8-r1/work/bzip2-1.0.8/blocksort.c:347:6: warning: inlining failed in call to ‘mainGtU’: --param max-inline-insns-single limit reached [-Winline]
  347 | Bool mainGtU ( UInt32  i1,
      |      ^~~~~~~
/var/tmp/portage/app-arch/bzip2-1.0.8-r1/work/bzip2-1.0.8/blocksort.c:542:18: note: called from here
  542 |          while ( mainGtU (
      |                  ^~~~~~~~~
  543 |                     ptr[j-h]+d, v+d, block, quadrant, nblock, budget
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  544 |                  ) ) {
      |                  ~
x86_64-pc-linux-gnu-gcc -march=skylake -O2 -pipe -fpic -fPIC -Wall -Winline -D_FILE_OFFSET_BITS=64  -c /var/tmp/portage/app-arch/bzip2-1.0.8-r1/work/bzip2-1.0.8/decompress.c
x86_64-pc-linux-gnu-gcc -march=skylake -O2 -pipe -fpic -fPIC -Wall -Winline -D_FILE_OFFSET_BITS=64  -c /var/tmp/portage/app-arch/bzip2-1.0.8-r1/work/bzip2-1.0.8/bzlib.c
x86_64-pc-linux-gnu-gcc -Wl,-O1 -Wl,--as-needed -shared -Wl,-soname -Wl,libbz2.so.1 -o libbz2.so.1.0.8 blocksort.o huffman.o crctable.o randtable.o compress.o decompress.o bzlib.o
ln -sf libbz2.so.1.0.8 libbz2.so.1.0
make -j2 VPATH=/var/tmp/portage/app-arch/bzip2-1.0.8-r1/work/bzip2-1.0.8 CC=x86_64-pc-linux-gnu-gcc AR=x86_64-pc-linux-gnu-ar RANLIB=x86_64-pc-linux-gnu-ranlib -f /var/tmp/portage/app-arch/bzip2-1.0.8-r1/work/bzip2-1.0.8/Makefile all 'LDFLAGS=-Wl,-O1 -Wl,--as-needed ' 
rm -f libbz2.a
x86_64-pc-linux-gnu-gcc -march=skylake -O2 -pipe -Wall -Winline -D_FILE_OFFSET_BITS=64  -c /var/tmp/portage/app-arch/bzip2-1.0.8-r1/work/bzip2-1.0.8/bzip2.c
x86_64-pc-linux-gnu-ar cq libbz2.a blocksort.o huffman.o crctable.o randtable.o compress.o decompress.o bzlib.o
x86_64-pc-linux-gnu-ranlib libbz2.a
x86_64-pc-linux-gnu-gcc -march=skylake -O2 -pipe -Wall -Winline -D_FILE_OFFSET_BITS=64  -c /var/tmp/portage/app-arch/bzip2-1.0.8-r1/work/bzip2-1.0.8/bzip2recover.c
/var/tmp/portage/app-arch/bzip2-1.0.8-r1/work/bzip2-1.0.8/bzip2.c: In function ‘applySavedFileAttrToOutputFile’:
/var/tmp/portage/app-arch/bzip2-1.0.8-r1/work/bzip2-1.0.8/bzip2.c:1128:11: warning: ignoring return value of ‘fchown’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
 1128 |    (void) fchown ( fd, fileMetaInfo.st_uid, fileMetaInfo.st_gid );
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
x86_64-pc-linux-gnu-gcc -march=skylake -O2 -pipe -Wall -Winline -D_FILE_OFFSET_BITS=64  -Wl,-O1 -Wl,--as-needed  -o bzip2recover bzip2recover.o
x86_64-pc-linux-gnu-gcc -march=skylake -O2 -pipe -Wall -Winline -D_FILE_OFFSET_BITS=64  -Wl,-O1 -Wl,--as-needed  -o bzip2 bzip2.o -L. -lbz2
>>> Source compiled.
>>> Test phase [not enabled]: app-arch/bzip2-1.0.8-r1

>>> Install app-arch/bzip2-1.0.8-r1 into /var/tmp/portage/app-arch/bzip2-1.0.8-r1/image
 * abi_x86_64.amd64: running multilib-minimal_abi_src_install
>>> Completed installing app-arch/bzip2-1.0.8-r1 into /var/tmp/portage/app-arch/bzip2-1.0.8-r1/image

 * Final size of build directory: 3556 KiB (3.4 MiB)
 * Final size of installed tree:   672 KiB

/usr/lib/portage/python3.9/phase-functions.sh: line 639:   224 Illegal instruction     ${PORTAGE_BZIP2_COMMAND} -f9 environment
/usr/lib/portage/python3.9/ecompress-file: line 7: 18072 Illegal instruction     "${PORTAGE_COMPRESS}" ${PORTAGE_COMPRESS_FLAGS} "$@"
 * ERROR: app-arch/bzip2-1.0.8-r1::gentoo failed:
 *   ecompress-file failed
 * 
 * If you need support, post the output of `emerge --info '=app-arch/bzip2-1.0.8-r1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=app-arch/bzip2-1.0.8-r1::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/app-arch/bzip2-1.0.8-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-arch/bzip2-1.0.8-r1/temp/environment'.
 * Working directory: '/var/tmp/portage/app-arch/bzip2-1.0.8-r1/image'
 * S: '/var/tmp/portage/app-arch/bzip2-1.0.8-r1/work/bzip2-1.0.8'
/usr/lib/portage/python3.9/ecompress-file: line 7: 18127 Illegal instruction     "${PORTAGE_COMPRESS}" ${PORTAGE_COMPRESS_FLAGS} "$@"
 * ERROR: app-arch/bzip2-1.0.8-r1::gentoo failed:
 *   ecompress-file failed
 * 
 * If you need support, post the output of `emerge --info '=app-arch/bzip2-1.0.8-r1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=app-arch/bzip2-1.0.8-r1::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/app-arch/bzip2-1.0.8-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-arch/bzip2-1.0.8-r1/temp/environment'.
 * Working directory: '/var/tmp/portage/app-arch/bzip2-1.0.8-r1/image'
 * S: '/var/tmp/portage/app-arch/bzip2-1.0.8-r1/work/bzip2-1.0.8'
/usr/lib/portage/python3.9/ecompress-file: line 7: 18174 Illegal instruction     "${PORTAGE_COMPRESS}" ${PORTAGE_COMPRESS_FLAGS} "$@"
 * ERROR: app-arch/bzip2-1.0.8-r1::gentoo failed:
 *   ecompress-file failed
 * 
 * If you need support, post the output of `emerge --info '=app-arch/bzip2-1.0.8-r1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=app-arch/bzip2-1.0.8-r1::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/app-arch/bzip2-1.0.8-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-arch/bzip2-1.0.8-r1/temp/environment'.
 * Working directory: '/var/tmp/portage/app-arch/bzip2-1.0.8-r1/image'
 * S: '/var/tmp/portage/app-arch/bzip2-1.0.8-r1/work/bzip2-1.0.8'
/usr/lib/portage/python3.9/ecompress-file: line 7: 18238 Illegal instruction     "${PORTAGE_COMPRESS}" ${PORTAGE_COMPRESS_FLAGS} "$@"
 * ERROR: app-arch/bzip2-1.0.8-r1::gentoo failed:
 *   ecompress-file failed
 * 
 * If you need support, post the output of `emerge --info '=app-arch/bzip2-1.0.8-r1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=app-arch/bzip2-1.0.8-r1::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/app-arch/bzip2-1.0.8-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-arch/bzip2-1.0.8-r1/temp/environment'.
 * Working directory: '/var/tmp/portage/app-arch/bzip2-1.0.8-r1/image'
 * S: '/var/tmp/portage/app-arch/bzip2-1.0.8-r1/work/bzip2-1.0.8'
 * ERROR: app-arch/bzip2-1.0.8-r1::gentoo failed:
 *   ecompress failed
 * 
 * If you need support, post the output of `emerge --info '=app-arch/bzip2-1.0.8-r1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=app-arch/bzip2-1.0.8-r1::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/app-arch/bzip2-1.0.8-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-arch/bzip2-1.0.8-r1/temp/environment'.
 * Working directory: '/var/tmp/portage/app-arch/bzip2-1.0.8-r1/image'
 * S: '/var/tmp/portage/app-arch/bzip2-1.0.8-r1/work/bzip2-1.0.8'
!!! post install failed; exiting.

>>> Failed to emerge app-arch/bzip2-1.0.8-r1, Log file:

>>>  '/var/tmp/portage/app-arch/bzip2-1.0.8-r1/temp/build.log'

 * Messages for package app-arch/bzip2-1.0.8-r1:

 * ERROR: app-arch/bzip2-1.0.8-r1::gentoo failed:
 *   ecompress-file failed
 * 
 * If you need support, post the output of `emerge --info '=app-arch/bzip2-1.0.8-r1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=app-arch/bzip2-1.0.8-r1::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/app-arch/bzip2-1.0.8-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-arch/bzip2-1.0.8-r1/temp/environment'.
 * Working directory: '/var/tmp/portage/app-arch/bzip2-1.0.8-r1/image'
 * S: '/var/tmp/portage/app-arch/bzip2-1.0.8-r1/work/bzip2-1.0.8'
 * ERROR: app-arch/bzip2-1.0.8-r1::gentoo failed:
 *   ecompress-file failed
 * 
 * If you need support, post the output of `emerge --info '=app-arch/bzip2-1.0.8-r1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=app-arch/bzip2-1.0.8-r1::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/app-arch/bzip2-1.0.8-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-arch/bzip2-1.0.8-r1/temp/environment'.
 * Working directory: '/var/tmp/portage/app-arch/bzip2-1.0.8-r1/image'
 * S: '/var/tmp/portage/app-arch/bzip2-1.0.8-r1/work/bzip2-1.0.8'
 * ERROR: app-arch/bzip2-1.0.8-r1::gentoo failed:
 *   ecompress-file failed
 * 
 * If you need support, post the output of `emerge --info '=app-arch/bzip2-1.0.8-r1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=app-arch/bzip2-1.0.8-r1::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/app-arch/bzip2-1.0.8-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-arch/bzip2-1.0.8-r1/temp/environment'.
 * Working directory: '/var/tmp/portage/app-arch/bzip2-1.0.8-r1/image'
 * S: '/var/tmp/portage/app-arch/bzip2-1.0.8-r1/work/bzip2-1.0.8'
 * ERROR: app-arch/bzip2-1.0.8-r1::gentoo failed:
 *   ecompress-file failed
 * 
 * If you need support, post the output of `emerge --info '=app-arch/bzip2-1.0.8-r1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=app-arch/bzip2-1.0.8-r1::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/app-arch/bzip2-1.0.8-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-arch/bzip2-1.0.8-r1/temp/environment'.
 * Working directory: '/var/tmp/portage/app-arch/bzip2-1.0.8-r1/image'
 * S: '/var/tmp/portage/app-arch/bzip2-1.0.8-r1/work/bzip2-1.0.8'
 * ERROR: app-arch/bzip2-1.0.8-r1::gentoo failed:
 *   ecompress failed
 * 
 * If you need support, post the output of `emerge --info '=app-arch/bzip2-1.0.8-r1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=app-arch/bzip2-1.0.8-r1::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/app-arch/bzip2-1.0.8-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-arch/bzip2-1.0.8-r1/temp/environment'.
 * Working directory: '/var/tmp/portage/app-arch/bzip2-1.0.8-r1/image'
 * S: '/var/tmp/portage/app-arch/bzip2-1.0.8-r1/work/bzip2-1.0.8'

Top
sam_
Developer
Developer
User avatar
Posts: 2820
Joined: Fri Aug 14, 2020 12:33 am

  • Quote

Post by sam_ » Fri Aug 06, 2021 2:23 am

I reckon your best bet would be to wget a stage3, chroot in, run

Code: Select all

quickpkg app-arch/bzip2
then install the binpkg on your real install.
Top
Jaglover
Watchman
Watchman
User avatar
Posts: 8291
Joined: Sun May 29, 2005 1:57 am
Location: Saint Amant, Acadiana

  • Quote

Post by Jaglover » Fri Aug 06, 2021 2:24 am

http://packages.gentooexperimental.org/packages/
My Gentoo installation notes.
Please learn how to denote units correctly!
Top
mike155
Advocate
Advocate
Posts: 4438
Joined: Fri Sep 17, 2010 11:33 pm
Location: Frankfurt, Germany

Re: Corrupted bzip2 with bad march: Illegal instruction

  • Quote

Post by mike155 » Fri Aug 06, 2021 3:01 am

jmanko wrote:I changed the march to "skylake-avxs512".
So why don't you just use "-march=native" -- and let GCC figure out which instructions your CPU supports?
Top
jmanko
Tux's lil' helper
Tux's lil' helper
Posts: 139
Joined: Sun Sep 11, 2005 5:41 pm
Location: NEPA, USA

  • Quote

Post by jmanko » Fri Aug 06, 2021 4:02 am

sam_ wrote:I reckon your best bet would be to wget a stage3, chroot in, run

Code: Select all

quickpkg app-arch/bzip2
then install the binpkg on your real install.
sam_, thanks for your guidance.

I was able to get to quickpkg part:

Code: Select all

/mnt/stage3 # chroot /mnt/stage3 /bin/bash
/ # source /etc/profile
/ # quickpkg app-arch/bzip2
 * Building package for app-arch/bzip2-1.0.8-r1 ...                                                                                                                                                                                                                           [ ok ]

 * Packages now in '/usr/portage/packages':
 * app-arch/bzip2-1.0.8-r1: 308K

/ # ls -al /usr/portage/packages/app-arch/
total 320
drwx------ 2 root root   4096 Aug  6 03:56 .
drwx------ 3 root root   4096 Aug  6 03:56 ..
-rw------- 1 root root 315997 Aug  6 03:56 bzip2-1.0.8-r1.tbz2

/ # exit
/mnt/stage3 #
I don't know what you mean by install the binpkg. How is that done?
Last edited by jmanko on Fri Aug 06, 2021 4:22 am, edited 2 times in total.
Top
jmanko
Tux's lil' helper
Tux's lil' helper
Posts: 139
Joined: Sun Sep 11, 2005 5:41 pm
Location: NEPA, USA

Re: Corrupted bzip2 with bad march: Illegal instruction

  • Quote

Post by jmanko » Fri Aug 06, 2021 4:07 am

mike155 wrote:
jmanko wrote:I changed the march to "skylake-avxs512".
So why don't you just use "-march=native" -- and let GCC figure out which instructions your CPU supports?
hindsight, right?
Top
sam_
Developer
Developer
User avatar
Posts: 2820
Joined: Fri Aug 14, 2020 12:33 am

  • Quote

Post by sam_ » Fri Aug 06, 2021 4:08 am

jmanko wrote:
sam_ wrote:I reckon your best bet would be to wget a stage3, chroot in, run

Code: Select all

quickpkg app-arch/bzip2
then install the binpkg on your real install.
sam_, thanks for your guidance.

I was able to get to quickpkg part:

Code: Select all

/mnt/stage3 # chroot /mnt/stage3 /bin/bash
/ # source /etc/profile
/ # quickpkg app-arch/bzip2
 * Building package for app-arch/bzip2-1.0.8-r1 ...                                                                                                                                                                                                                           [ ok ]

 * Packages now in '/usr/portage/packages':
 * app-arch/bzip2-1.0.8-r1: 308K

/ # ls -al /usr/portage/packages/app-arch/
total 320
drwx------ 2 root root   4096 Aug  6 03:56 .
drwx------ 3 root root   4096 Aug  6 03:56 ..
-rw------- 1 root root 315997 Aug  6 03:56 bzip2-1.0.8-r1.tbz2

/ # exit
/mnt/stage3 #
I don't know what you mean by install the binpkg. How is that done?
Hi!

What I'd usually do is then just

Code: Select all

tar bzip2-1.0.8-r1.tbz2 -C /tmp/test/
If it looks good there, mv it out to / (on your main install) to merge it (or just -C /). But I admit that this is a rather naive approach and I might be missing some fancy tool which does it for you.

The alternative is that you mv the binpkg (the .tbz2 file) into /usr/portage/packages/app-arch/ (so that Portage can find it) on your broken/main install, then

Code: Select all

emerge -v1 --usepkg=y "=app-arch/bzip2-1.0.8-r1"
and it should install using the binpkg.
Top
jmanko
Tux's lil' helper
Tux's lil' helper
Posts: 139
Joined: Sun Sep 11, 2005 5:41 pm
Location: NEPA, USA

  • Quote

Post by jmanko » Fri Aug 06, 2021 4:23 am

sam_ wrote: The alternative is that you mv the binpkg (the .tbz2 file) into /usr/portage/packages/app-arch/ (so that Portage can find it) on your broken/main install, then

Code: Select all

emerge -v1 --usepkg=y "=app-arch/bzip2-1.0.8-r1"
and it should install using the binpkg.
I think I found what I need: https://wiki.gentoo.org/wiki/Binary_package_guide

But having a USE flag issue:

Code: Select all

/ # echo "=app-arch/bzip2-1.0.8-r1  static-libs -static" >> /etc/portage/package.use/package.use.main-tree
/ # quickpkg app-arch/bzip2

Code: Select all

/mnt/stage3 # cp /mnt/stage3/usr/portage/packages/app-arch/bzip2-1.0.8-r1.tbz2 /usr/portage/packages/app-arch/ 
/mnt/stage3 # emerge --usepkg -vp app-arch/bzip2 

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] app-arch/bzip2-1.0.8-r1:0/1::gentoo  USE="(split-usr) static-libs -static" ABI_X86="(64) -32 (-x32)" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB

!!! The following binary packages have been ignored due to non matching USE:

    =app-arch/bzip2-1.0.8-r1 -static-libs

NOTE: The --binpkg-respect-use=n option will prevent emerge
      from ignoring these binary packages if possible.
      Using --binpkg-respect-use=y will silence this warning.
Not sure how I get past that. Of course, adding --binpkg-respect-use=y yields

Code: Select all

>>> Emerging binary (1 of 1) app-arch/bzip2-1.0.8-r1::gentoo
 * bzip2-1.0.8-r1.tbz2 size ;-) ...                                      [ ok ]
>>> Extracting info
bash: line 1:  6089 Illegal instruction     ${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d} -c -- /var/tmp/portage/app-arch/bzip2-1.0.8-r1/build-info/environment.bz2 > /var/tmp/portage/app-arch/bzip2-1.0.8-r1/temp/environment
Exception in callback AsynchronousTask._exit_listener_cb(<bound method...7ffaaa02be40>>)
handle: <Handle AsynchronousTask._exit_listener_cb(<bound method...7ffaaa02be40>>)>
Traceback (most recent call last):
  File "/usr/lib/python3.9/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/lib/python3.9/site-packages/_emerge/AsynchronousTask.py", line 201, in _exit_listener_cb
    listener(self)
  File "/usr/lib/python3.9/site-packages/_emerge/Binpkg.py", line 315, in _unpack_metadata_exit
    unpack_metadata.future.result()
  File "/usr/lib/python3.9/site-packages/portage/util/futures/compat_coroutine.py", line 120, in _next
    future = self._generator.send(previous.result())
  File "/usr/lib/python3.9/site-packages/_emerge/Binpkg.py", line 311, in _unpack_metadata
    raise portage.exception.PortageException('failed to extract environment for {}'.format(self.pkg.cpv))
portage.exception.PortageException: failed to extract environment for app-arch/bzip2-1.0.8-r1
Terminated
"What stands in the way becomes the way." -- Marcus Aurelius
Top
jmanko
Tux's lil' helper
Tux's lil' helper
Posts: 139
Joined: Sun Sep 11, 2005 5:41 pm
Location: NEPA, USA

  • Quote

Post by jmanko » Fri Aug 06, 2021 4:45 am

Using the helper script https://github.com/zoobab/quickunpkg/bl ... quickunpkg

Code: Select all

# ~/scripts/quickunpkg bzip2-1.0.8-r1.tbz2 
================================================================
Create the workdir, tbz2file
================================================================
TBZ2FILE=bzip2-1.0.8-r1.tbz2
TBZ2FILE_XPAK=bzip2-1.0.8-r1.xpak
WORKDIR=/tmp/20210806_004320
mkdir: created directory '/tmp/20210806_004320'
================================================================
Copying the file to the workdir
================================================================
'bzip2-1.0.8-r1.tbz2' -> '/tmp/20210806_004320/bzip2-1.0.8-r1.tbz2'
================================================================
Uncompressing the tbz2file
================================================================
input tbz2: bzip2-1.0.8-r1.tbz2 (308.6K)
output tar.bz2: (null) (286.1K)
output xpak: bzip2-1.0.8-r1.xpak (22.5K)
PF=bzip2-1.0.8-r1
CATEGORY=app-arch
TBZ2FILE_XPAK=bzip2-1.0.8-r1.xpak
================================================================
Emerging bzip2-1.0.8-r1.tbz2
================================================================
mkdir: created directory '/tmp/20210806_004320/All'
'bzip2-1.0.8-r1.tbz2' -> '/tmp/20210806_004320/All/bzip2-1.0.8-r1.tbz2'

!!! Invalid binary package: '/tmp/20210806_004320/bzip2-1.0.8-r1.xpak'
!!! Missing metadata key(s): CATEGORY, PF, SLOT. This binary package is not
!!! recoverable and should be deleted.

!!! Invalid binary package: '/tmp/20210806_004320/bzip2-1.0.8-r1.xpak'
!!! Missing metadata key(s): CATEGORY, PF, SLOT. This binary package is not
!!! recoverable and should be deleted.
Calculating dependencies... done!

!!! The following installed packages are masked:
- dev-util/pkgconfig-0.29.2::gentoo (masked by: package.mask)
/usr/portage/profiles/package.mask:
# David Seifert <soap@gentoo.org> (2021-08-04)
# Last release over 4 years ago, upstream pretty much dead, the
# ecosystem has switched to dev-util/pkgconf, which is alive. Testing
# and prefix bugs, blocks WANT_AUTOMAKE=1.12 removal.
# (If you hit blockers, please run:
# $ emerge --deselect dev-util/pkgconfig
# This is necessary as your world file should not contain dependencies.)
# Bug #245228, #632124, #691268, #767853, removal in 30 days.

For more information, see the MASKED PACKAGES section in the emerge
man page or refer to the Gentoo Handbook.


>>> Emerging binary (1 of 1) app-arch/bzip2-1.0.8-r1::gentoo
 * bzip2-1.0.8-r1.tbz2 size ;-) ...                                      [ ok ]
>>> Extracting info
bash: line 1:  9692 Illegal instruction     ${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d} -c -- /var/tmp/portage/app-arch/bzip2-1.0.8-r1/build-info/environment.bz2 > /var/tmp/portage/app-arch/bzip2-1.0.8-r1/temp/environment
Exception in callback AsynchronousTask._exit_listener_cb(<bound method...7f6b2ff42d40>>)
handle: <Handle AsynchronousTask._exit_listener_cb(<bound method...7f6b2ff42d40>>)>
Traceback (most recent call last):
  File "/usr/lib/python3.9/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/lib/python3.9/site-packages/_emerge/AsynchronousTask.py", line 201, in _exit_listener_cb
    listener(self)
  File "/usr/lib/python3.9/site-packages/_emerge/Binpkg.py", line 315, in _unpack_metadata_exit
    unpack_metadata.future.result()
  File "/usr/lib/python3.9/site-packages/portage/util/futures/compat_coroutine.py", line 120, in _next
    future = self._generator.send(previous.result())
  File "/usr/lib/python3.9/site-packages/_emerge/Binpkg.py", line 311, in _unpack_metadata
    raise portage.exception.PortageException('failed to extract environment for {}'.format(self.pkg.cpv))
portage.exception.PortageException: failed to extract environment for app-arch/bzip2-1.0.8-r1
Terminated
"What stands in the way becomes the way." -- Marcus Aurelius
Top
sam_
Developer
Developer
User avatar
Posts: 2820
Joined: Fri Aug 14, 2020 12:33 am

  • Quote

Post by sam_ » Fri Aug 06, 2021 12:34 pm

Aha. I should've spotted this last night: your quickpkg was compressed using bzip2. I'm sure you can see the problem (we need bzip2 to decompress it).

Let's remake it from the stage3 with BINPKG_COMPRESS="gzip" quickpkg bzip2, (may need to put BINPKG_COMPRESS in make.conf within the stage3) and try again?

If necessary, we can manually decompress/recompress within the stage3.
Top
jmanko
Tux's lil' helper
Tux's lil' helper
Posts: 139
Joined: Sun Sep 11, 2005 5:41 pm
Location: NEPA, USA

  • Quote

Post by jmanko » Fri Aug 06, 2021 1:02 pm

sam_ wrote:Aha. I should've spotted this last night: your quickpkg was compressed using bzip2. I'm sure you can see the problem (we need bzip2 to decompress it).

Let's remake it from the stage3 with BINPKG_COMPRESS="gzip" quickpkg bzip2, (may need to put BINPKG_COMPRESS in make.conf within the stage3) and try again?

If necessary, we can manually decompress/recompress within the stage3.
Using BINPKG_COMPRESS on the commandline, and adding it to /etc/portage/make.conf still results in /usr/portage/packages/app-arch/bzip2-1.0.8-r1.tbz2 and no gzip, but it appears that it's just an invalid filename:

Code: Select all

# mv bzip2-1.0.8-r1.tbz2 bzip2-1.0.8-r1.tgz
# tar -xz -f bzip2-1.0.8-r1.tgz 

gzip: stdin: decompression OK, trailing garbage ignored
tar: Child returned status 2
tar: Error is not recoverable: exiting now

# ls *
bzip2-1.0.8-r1.tgz

bin:
bunzip2  bzcat  bzip2

lib64:
libbz2.so.1  libbz2.so.1.0  libbz2.so.1.0.8

usr:
bin  include  lib64  share
So, renaming the file to tgz and copying over

Code: Select all

cp /mnt/stage3/usr/portage/packages/app-arch/bzip2-1.0.8-r1.tgz /usr/portage/packages/app-arch/ 

Code: Select all

# emerge --usepkgonly -vp app-arch/bzip2 

These are the packages that would be merged, in order:

Calculating dependencies... done!

emerge: there are no binary packages to satisfy "app-arch/bzip2"
I manually copied the contents of bzip2-1.0.8-r1.tgz/bin and bzip2-1.0.8-r1.tgz/usr/bin to /usr/bin, and bzip2-1.0.8-r1.tgz/lib64 and bzip2-1.0.8-r1.tgz/usr/lib64 to /usr/lib64, but still getting

Code: Select all

/usr/lib/portage/python3.9/phase-functions.sh: line 639:   224 Illegal instruction     ${PORTAGE_BZIP2_COMMAND} -f9 environment
/usr/lib/portage/python3.9/ecompress-file: line 7: 17949 Illegal instruction     "${PORTAGE_COMPRESS}" ${PORTAGE_COMPRESS_FLAGS} "$@"
 * ERROR: app-arch/bzip2-1.0.8-r1::gentoo failed:
 *   ecompress-file failed
Top
sam_
Developer
Developer
User avatar
Posts: 2820
Joined: Fri Aug 14, 2020 12:33 am

  • Quote

Post by sam_ » Fri Aug 06, 2021 1:27 pm

jmanko wrote:
sam_ wrote:Aha. I should've spotted this last night: your quickpkg was compressed using bzip2. I'm sure you can see the problem (we need bzip2 to decompress it).

Let's remake it from the stage3 with BINPKG_COMPRESS="gzip" quickpkg bzip2, (may need to put BINPKG_COMPRESS in make.conf within the stage3) and try again?

If necessary, we can manually decompress/recompress within the stage3.
Using BINPKG_COMPRESS on the commandline, and adding it to /etc/portage/make.conf still results in /usr/portage/packages/app-arch/bzip2-1.0.8-r1.tbz2 and no gzip, but it appears that it's just an invalid filename:

Code: Select all

# mv bzip2-1.0.8-r1.tbz2 bzip2-1.0.8-r1.tgz
# tar -xz -f bzip2-1.0.8-r1.tgz 

gzip: stdin: decompression OK, trailing garbage ignored
tar: Child returned status 2
tar: Error is not recoverable: exiting now

# ls *
bzip2-1.0.8-r1.tgz

bin:
bunzip2  bzcat  bzip2

lib64:
libbz2.so.1  libbz2.so.1.0  libbz2.so.1.0.8

usr:
bin  include  lib64  share
So, renaming the file to tgz and copying over

Code: Select all

cp /mnt/stage3/usr/portage/packages/app-arch/bzip2-1.0.8-r1.tgz /usr/portage/packages/app-arch/ 

Code: Select all

# emerge --usepkgonly -vp app-arch/bzip2 

These are the packages that would be merged, in order:

Calculating dependencies... done!

emerge: there are no binary packages to satisfy "app-arch/bzip2"
I manually copied the contents of bzip2-1.0.8-r1.tgz/bin and bzip2-1.0.8-r1.tgz/usr/bin to /usr/bin, and bzip2-1.0.8-r1.tgz/lib64 and bzip2-1.0.8-r1.tgz/usr/lib64 to /usr/lib64, but still getting

[snip]
Can you verify that the binary in /usr/bin is definitely the one you expect (etc)? It definitely seems like it shouldn't be, but maybe we compiled bzip2 incorrectly in the stage3 (seems very unlikely).
Top
jmanko
Tux's lil' helper
Tux's lil' helper
Posts: 139
Joined: Sun Sep 11, 2005 5:41 pm
Location: NEPA, USA

  • Quote

Post by jmanko » Fri Aug 06, 2021 1:53 pm

sam_ wrote: Can you verify that the binary in /usr/bin is definitely the one you expect (etc)? It definitely seems like it shouldn't be, but maybe we compiled bzip2 incorrectly in the stage3 (seems very unlikely).
Too late. I was forced to reimage the drive from a copy.

Perhaps I will try to sandbox this scenario in a vm. If it's something you're willing to explore, I can set something up this weekend.
"What stands in the way becomes the way." -- Marcus Aurelius
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56106
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Fri Aug 06, 2021 7:38 pm

sam_,

If you are careful with the $PWD busybox tar can install binary packages.
I don't do it very often though :)
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
sam_
Developer
Developer
User avatar
Posts: 2820
Joined: Fri Aug 14, 2020 12:33 am

  • Quote

Post by sam_ » Sat Aug 07, 2021 3:46 pm

NeddySeagoon wrote:sam_,

If you are careful with the $PWD busybox tar can install binary packages.
I don't do it very often though :)
Thanks for the tip! I'm going to keep this in mind...
Top
Post Reply

15 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic