Skip to content

Commit

Permalink
[PATCH] xtensa: Removed local copy of zlib and fixed O= support
Browse files Browse the repository at this point in the history
Removed an unnecessary local copy of zlib (sorry for the add'l traffic).
Fixed 'O=' support (thanks to Jan Dittmer for pointing it out).  Some minor
clean-ups in the make files.

Signed-off-by: Chris Zankel <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Chris Zankel authored and Linus Torvalds committed Jun 30, 2005
1 parent 82300bf commit e7d163f
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 2,671 deletions.
48 changes: 25 additions & 23 deletions arch/xtensa/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,17 @@ export CPU

# Platform configuration

platform-y := common
platform-$(CONFIG_XTENSA_PLATFORM_XT2000) := xt2000
platform-$(CONFIG_XTENSA_PLATFORM_ISS) := iss

PLATFORM = $(platform-y)
export PLATFORM

#LDFLAGS_vmlinux := -T$(word 1,$(LINKSCRIPT))
AFLAGS_vmlinux.lds.o := -Uxtensa
CPPFLAGS += -Iarch/xtensa -Iinclude/asm -mlongcalls -g
AFLAGS += -Iarch/xtensa -Iinclude/asm
CPP = $(CC) -E $(CFLAGS)
CPPFLAGS += $(if $(KBUILD_SRC),-I$(srctree)/include/asm-xtensa/)
CPPFLAGS += -Iinclude/asm
CFLAGS += -pipe -mlongcalls

cflags-y += -Iarch/xtensa -pipe -mlongcalls


KBUILD_DEFCONFIG := common_defconfig
KBUILD_DEFCONFIG := iss_defconfig

# ramdisk/initrd support
# You need a compressed ramdisk image, named ramdisk.gz in
Expand All @@ -62,30 +56,36 @@ endif
LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)

head-y := arch/xtensa/kernel/head.o
core-y += arch/xtensa/kernel/ \
arch/xtensa/mm/ arch/xtensa/platform-$(PLATFORM)/
core-y += arch/xtensa/kernel/ arch/xtensa/mm/
ifneq ($(PLATFORM),)
core-y += arch/xtensa/platform-$(PLATFORM)/
endif
libs-y += arch/xtensa/lib/ $(LIBGCC)

boot := arch/xtensa/boot
boot := arch/xtensa/boot

archinc := include/asm-xtensa

arch/xtensa/kernel/asm-offsets.s: \
arch/xtensa/kernel/asm-offsets.c \
include/asm-xtensa/.platform
arch/xtensa/kernel/asm-offsets.c $(archinc)/.platform

include/asm-xtensa/offsets.h: arch/xtensa/kernel/asm-offsets.s
$(call filechk,gen-asm-offsets)

prepare: include/asm-xtensa/.platform include/asm-xtensa/offsets.h
prepare: $(archinc)/.platform $(archinc)/offsets.h

# Update machine cpu and platform symlinks if something which affects
# them changed.

include/asm-xtensa/.platform: $(wildcard include/config/arch/*.h)
@echo ' Setting up cpu ($(CPU)) and platform ($(PLATFORM)) symlinks'
$(Q)rm -f include/asm-xtensa/platform
$(Q)rm -f include/asm-xtensa/xtensa/config
$(Q)(cd include/asm-xtensa/; ln -sf platform-$(PLATFORM) platform)
$(Q)(cd include/asm-xtensa/xtensa; ln -sf config-$(CPU) config)
$(archinc)/.platform: $(wildcard include/config/arch/*.h) include/config/MARKER
@echo ' SYMLINK $(archinc)/xtensa/config -> $(archinc)/xtensa/config-$(CPU)'
$(Q)mkdir -p $(archinc)
$(Q)mkdir -p $(archinc)/xtensa
$(Q)ln -fsn $(srctree)/$(archinc)/xtensa/config-$(CPU) $(archinc)/xtensa/config
@echo ' SYMLINK $(archinc)/platform -> $(archinc)/platform-$(PLATFORM)'
$(Q)ln -fsn $(srctree)/$(archinc)/platform-$(PLATFORM) $(archinc)/platform
@touch $@


all: zImage

Expand All @@ -94,7 +94,9 @@ bzImage : zImage
zImage zImage.initrd: vmlinux
$(Q)$(MAKE) $(build)=$(boot) $@

CLEAN_FILES += arch/xtensa/vmlinux.lds include/asm-xtensa/offset.h
CLEAN_FILES += arch/xtensa/vmlinux.lds $(archinc)/offset.h \
$(archinc)/platform $(archinc)/xtensa/config \
$(archinc)/.platform

define archhelp
@echo '* zImage - Compressed kernel image (arch/xtensa/boot/images/zImage.*)'
Expand Down
10 changes: 3 additions & 7 deletions arch/xtensa/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,23 @@
CFLAGS += -fno-builtin -Iarch/$(ARCH)/boot/include
HOSTFLAGS += -Iarch/$(ARCH)/boot/include

BIG_ENDIAN := $(shell echo -e "\#ifdef __XTENSA_EL__\nint little;\n\#else\nint big;\n\#endif" | $(CC) -E -|grep -c big)

BIG_ENDIAN := $(shell echo -e __XTENSA_EB__ | $(CC) -E - | grep -v "\#")

export CFLAGS
export AFLAGS
export BIG_ENDIAN

subdir-y := lib

# Subdirs for the boot loader(s)

bootdir-$(CONFIG_XTENSA_PLATFORM_ISS) += boot-elf
bootdir-$(CONFIG_XTENSA_PLATFORM_XT2000) += boot-redboot boot-elf

subdir-y := lib/

subdir-y += boot-elf/ boot-redboot/

zImage zImage.initrd Image Image.initrd: $(bootdir-y)

$(bootdir-y): $(addprefix $(obj)/,$(subdir-y)) \
$(addprefix $(obj)/,$(host-progs))
$(Q)$(MAKE) $(build)=$(obj)/$@ $(MAKECMDGOALS)



4 changes: 2 additions & 2 deletions arch/xtensa/boot/boot-elf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Image: vmlinux $(OBJS)
--set-section-flags image=contents,alloc,load,load,data \
$(OBJS) $@.tmp
$(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) \
-T arch/$(ARCH)/boot/boot-elf/boot.ld \
-T $(srctree)/arch/$(ARCH)/boot/boot-elf/boot.ld \
-o arch/$(ARCH)/boot/$@.elf $@.tmp
rm -f $@.tmp vmlinux.tmp

Expand All @@ -41,7 +41,7 @@ Image.initrd: vmlinux $(OBJS)
--set-section-flags image=contents,alloc,load,load,data \
$(OBJS) $@.tmp
$(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) \
-T arch/$(ARCH)/boot/boot-elf/boot.ld \
-T $(srctree)/arch/$(ARCH)/boot/boot-elf/boot.ld \
-o arch/$(ARCH)/boot/$@.elf $@.tmp
rm -f $@.tmp vmlinux.tmp

Expand Down
10 changes: 5 additions & 5 deletions arch/xtensa/boot/boot-redboot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,24 @@ else
OBJCOPY_ARGS := -O elf32-xtensa-le
endif

LD_ARGS = -T $(obj)/boot.ld
LD_ARGS = -T $(srctree)/$(obj)/boot.ld

boot-y := bootstrap.o

OBJS := $(addprefix $(obj)/,$(boot-y))
LIBS := arch/$(ARCH)/boot/lib/lib.a arch/$(ARCH)/lib/lib.a
LIBS := arch/xtensa/boot/lib/lib.a arch/xtensa/lib/lib.a

LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)

zImage: vmlinux $(OBJS) $(LIBS)
$(OBJCOPY) --strip-all -R .comment -R .xt.insn -O binary \
$(TOPDIR)/vmlinux vmlinux.tmp
vmlinux vmlinux.tmp
gzip -vf9 vmlinux.tmp
$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
--add-section image=vmlinux.tmp.gz \
--set-section-flags image=contents,alloc,load,load,data \
$(OBJS) $@.tmp
$(LD) $(LD_ARGS) -o $@.elf $@.tmp $(LIBS) -L/xtensa-elf/lib $(LIBGCC)
$(OBJCOPY) -S -O binary $@.elf arch/$(ARCH)/boot/images/$@.redboot
# rm -f [email protected] [email protected] vmlinux.tmp.gz
$(OBJCOPY) -S -O binary $@.elf arch/$(ARCH)/boot/$@.redboot
rm -f $@.tmp $@.elf vmlinux.tmp.gz

Loading

0 comments on commit e7d163f

Please sign in to comment.