forked from Minki/linux
65c5ec11c2
Historically the boot wrapper was always built 32-bit big endian, even
for 64-bit kernels. That was because old firmwares didn't necessarily
support booting a 64-bit image. Because of that arch/powerpc/boot/Makefile
uses CROSS32CC for compilation.
However when we added 64-bit little endian support, we also added
support for building the boot wrapper 64-bit. However we kept using
CROSS32CC, because in most cases it is just CC and everything works.
However if the user doesn't specify CROSS32_COMPILE (which no one ever
does AFAIK), and CC is *not* biarch (32/64-bit capable), then CROSS32CC
becomes just "gcc". On native systems that is probably OK, but if we're
cross building it definitely isn't, leading to eg:
gcc ... -m64 -mlittle-endian -mabi=elfv2 ... arch/powerpc/boot/cpm-serial.c
gcc: error: unrecognized argument in option ‘-mabi=elfv2’
gcc: error: unrecognized command line option ‘-mlittle-endian’
make: *** [zImage] Error 2
To fix it, stop using CROSS32CC, because we may or may not be building
32-bit. Instead setup a BOOTCC, which defaults to CC, and only use
CROSS32_COMPILE if it's set and we're building for 32-bit.
Fixes:
|
||
---|---|---|
.. | ||
dts | ||
.gitignore | ||
4xx.c | ||
4xx.h | ||
44x.h | ||
addnote.c | ||
bamboo.c | ||
cpm-serial.c | ||
crt0.S | ||
crtsavres.S | ||
cuboot-8xx.c | ||
cuboot-52xx.c | ||
cuboot-83xx.c | ||
cuboot-85xx-cpm2.c | ||
cuboot-85xx.c | ||
cuboot-824x.c | ||
cuboot-acadia.c | ||
cuboot-amigaone.c | ||
cuboot-bamboo.c | ||
cuboot-c2k.c | ||
cuboot-ebony.c | ||
cuboot-hotfoot.c | ||
cuboot-katmai.c | ||
cuboot-kilauea.c | ||
cuboot-mpc7448hpc2.c | ||
cuboot-pq2.c | ||
cuboot-rainier.c | ||
cuboot-sam440ep.c | ||
cuboot-sequoia.c | ||
cuboot-taishan.c | ||
cuboot-warp.c | ||
cuboot-yosemite.c | ||
cuboot.c | ||
cuboot.h | ||
dcr.h | ||
decompress.c | ||
devtree.c | ||
div64.S | ||
dummy.c | ||
ebony.c | ||
elf_util.c | ||
elf.h | ||
ep88xc.c | ||
ep405.c | ||
ep8248e.c | ||
epapr-wrapper.c | ||
epapr.c | ||
fixed-head.S | ||
fixup-headers.sed | ||
fsl-soc.c | ||
fsl-soc.h | ||
gamecube-head.S | ||
gamecube.c | ||
hack-coff.c | ||
holly.c | ||
install.sh | ||
io.h | ||
libfdt_env.h | ||
libfdt-wrapper.c | ||
main.c | ||
Makefile | ||
mktree.c | ||
motload-head.S | ||
mpc8xx.c | ||
mpc8xx.h | ||
mpc52xx-psc.c | ||
mpsc.c | ||
mv64x60_i2c.c | ||
mv64x60.c | ||
mv64x60.h | ||
mvme5100.c | ||
mvme7100.c | ||
ns16550.c | ||
of.c | ||
of.h | ||
ofconsole.c | ||
oflib.c | ||
opal-calls.S | ||
opal.c | ||
ops.h | ||
page.h | ||
planetcore.c | ||
planetcore.h | ||
ppc_asm.h | ||
ppcboot-hotfoot.h | ||
ppcboot.h | ||
pq2.c | ||
pq2.h | ||
ps3-head.S | ||
ps3-hvcall.S | ||
ps3.c | ||
pseries-head.S | ||
README | ||
redboot-8xx.c | ||
redboot-83xx.c | ||
redboot.h | ||
reg.h | ||
rs6000.h | ||
serial.c | ||
simple_alloc.c | ||
simpleboot.c | ||
stdbool.h | ||
stdint.h | ||
stdio.c | ||
stdio.h | ||
stdlib.c | ||
stdlib.h | ||
string.h | ||
string.S | ||
swab.h | ||
treeboot-akebono.c | ||
treeboot-bamboo.c | ||
treeboot-currituck.c | ||
treeboot-ebony.c | ||
treeboot-iss4xx.c | ||
treeboot-walnut.c | ||
types.h | ||
uartlite.c | ||
ugecon.c | ||
ugecon.h | ||
util.S | ||
virtex405-head.S | ||
virtex.c | ||
wii-head.S | ||
wii.c | ||
wrapper | ||
xz_config.h | ||
zImage.coff.lds.S | ||
zImage.lds.S | ||
zImage.ps3.lds.S |
To extract the kernel vmlinux, System.map, .config or initrd from the zImage binary: objcopy -j .kernel:vmlinux -O binary zImage vmlinux.gz objcopy -j .kernel:System.map -O binary zImage System.map.gz objcopy -j .kernel:.config -O binary zImage config.gz objcopy -j .kernel:initrd -O binary zImage.initrd initrd.gz Peter