zyxmon / entware-arm

GNU General Public License v2.0
41 stars 13 forks source link

toolchain fails to compile on debian/Kali x64 #5

Closed pjvenda-zz closed 9 years ago

pjvenda-zz commented 9 years ago

In reverse order, these are the symptoms of the issue:

[DEBUG] Entering '/home/pjvenda/cross/.build/src/gcc-4.8.4' [EXTRA] Patching 'gcc-4.8.4' [DEBUG] Looking for patches in '/home/pjvenda/cross/arm/crosstool-ng-1.20.0/patches/gcc/4.8.4'... [DEBUG] ==> Executing: 'patch' '--no-backup-if-mismatch' '-g0' '-F1' '-p1' '-f' '-i' '/home/pjvenda/cross/arm/crosstool-ng-1.20.0/patches/gcc/4.8.4/001_gcc_bug_62231.patch' [ALL ] patching file gcc/defaults.h [ALL ] patching file gcc/dwarf2cfi.c [ALL ] patching file libgcc/unwind-dw2.c [ALL ] patching file gcc/defaults.h [ALL ] Hunk #1 succeeded at 443 with fuzz 1 (offset 5 lines). [ALL ] patching file gcc/dwarf2cfi.c [ALL ] Hunk #1 FAILED at 225. [ALL ] Hunk #2 FAILED at 238. [ALL ] 2 out of 2 hunks FAILED -- saving rejects to file gcc/dwarf2cfi.c.rej [ALL ] patching file libgcc/unwind-dw2.c [ALL ] Hunk #1 FAILED at 55. [ALL ] 1 out of 1 hunk FAILED -- saving rejects to file libgcc/unwind-dw2.c.rej [ALL ] patching file gcc/defaults.h [ALL ] Hunk #1 succeeded at 448 with fuzz 1 (offset 10 lines). [ALL ] patching file gcc/dwarf2cfi.c [ALL ] Hunk #1 FAILED at 225. [ALL ] Hunk #2 FAILED at 238. [ALL ] 2 out of 2 hunks FAILED -- saving rejects to file gcc/dwarf2cfi.c.rej [ALL ] patching file libgcc/unwind-dw2.c [ALL ] Hunk #1 FAILED at 55. [ALL ] 1 out of 1 hunk FAILED -- saving rejects to file libgcc/unwind-dw2.c.rej [ALL ] patching file gcc/defaults.h [ALL ] Hunk #1 succeeded at 453 with fuzz 1 (offset 15 lines). [ALL ] patching file gcc/dwarf2cfi.c [ALL ] Hunk #1 FAILED at 225. [ALL ] Hunk #2 FAILED at 238. [ALL ] 2 out of 2 hunks FAILED -- saving rejects to file gcc/dwarf2cfi.c.rej [ALL ] patching file libgcc/unwind-dw2.c [ALL ] Hunk #1 FAILED at 55. [ALL ] 1 out of 1 hunk FAILED -- saving rejects to file libgcc/unwind-dw2.c.rej [ERROR] [ERROR] >> [ERROR] >> Build failed in step 'Extracting and patching toolchain components' [ERROR] >> called in step '(top-level)' [ERROR] >> [ERROR] >> Error happened in: CT_DoExecLog[scripts/functions@257] [ERROR] >> called from: CT_Patch[scripts/functions@1098] [ERROR] >> called from: do_cc_extract[scripts/build/cc/gcc.sh@53] [ERROR] >> called from: main[scripts/crosstool-NG.sh@608] [ERROR] >> [ERROR] >> For more info on this error, look at the file: 'build.log' [ERROR] >> There is a list of known issues, some with workarounds, in: [ERROR] >> 'crosstool-ng-1.20.0/docs/B - Known issues.txt' [ERROR] [ERROR](elapsed: 0:27.34)

It would appear that the first patch file is being applied multiple times?

The patches will apply cleanly to the gcc-4.8.4 if done individually. I have compared the file with the one on crosstool-ng master branch and they are the same.

Running the crosstool-ng build process individually with entware-arm's configuration files works at least past this stage.

zyxmon commented 9 years ago

I've never had the problems with crosstool-ng. My log looks like

[DEBUG]    Entering '/media/ware/Entware-arm.2015.02/cross/.build/src/gcc-4.8.4'
[EXTRA]    Patching 'gcc-4.8.4'
[DEBUG]    Looking for patches in '/media/ware/Entware-arm.2015.02/cross/arm/crosstool-ng-1.20.0/patches/gcc/4.8.4'...
[DEBUG]    ==> Executing: 'patch' '--no-backup-if-mismatch' '-g0' '-F1' '-p1' '-f' '-i' '/media/ware/Entware-arm.2015.02/cross
[ALL  ]    patching file gcc/defaults.h
[ALL  ]    patching file gcc/dwarf2cfi.c
[ALL  ]    patching file libgcc/unwind-dw2.c
[DEBUG]    ==> Executing: 'patch' '--no-backup-if-mismatch' '-g0' '-F1' '-p1' '-f' '-i' '/media/ware/Entware-arm.2015.02/cross
[ALL  ]    patching file gcc/config/rs6000/rs6000.c
[ALL  ]    Hunk #1 succeeded at 1675 (offset 2 lines).
[DEBUG]    ==> Executing: 'patch' '--no-backup-if-mismatch' '-g0' '-F1' '-p1' '-f' '-i' '/media/ware/Entware-arm.2015.02/cross
[ALL  ]    patching file gcc/config/rs6000/rs6000.c
[DEBUG]    Looking for patches in ''...
[ALL  ]    Overiding config.guess and config.sub

Entware-arm Makefile located in toolchain dir just calls ct-ng build. I have builded entware.arm on debian 6 & 7 hosts. I hope you can find - what is wrong in your case and propose a fix.

pjvenda-zz commented 9 years ago

Got it. crosstool-ng was being patched every time 'make' was run in a way that the patch files for gcc 4.8.4 were being duplicated at every occurrence. Therefore any run past the first would fail to patch gcc. I've come up with a fix and issued a pull request.

zyxmon commented 9 years ago

Good news. Closing for now.