direct-io.hg

view extras/mini-os/Makefile @ 11356:af7c87d42bc6

[XEN][POWERPC] Fix PHDR issues with large .data.percpu sections

This patch tells the link to only create one PHDR and place all sections
in it, also removing an unrequired mapping for the .data.percpu section.

This avoids the "Not enough room for program headers (allocated 2, need 3)"

Booted on a JS20.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
author Jimi Xenidis <jimix@watson.ibm.com>
date Thu Aug 17 07:10:57 2006 -0400 (2006-08-17)
parents ec4979587156
children 1c3455182cee
line source
1 debug ?= y
2 pae ?= n
4 XEN_ROOT = ../..
5 include $(XEN_ROOT)/Config.mk
7 # Set TARGET_ARCH
8 override TARGET_ARCH := $(XEN_TARGET_ARCH)
10 # NB. '-Wcast-qual' is nasty, so I omitted it.
11 CFLAGS := -fno-builtin -Wall -Werror -Wredundant-decls -Wno-format
12 CFLAGS += -Wstrict-prototypes -Wnested-externs -Wpointer-arith -Winline
14 ASFLAGS = -D__ASSEMBLY__
16 LDLIBS = -L. -lminios
17 LDFLAGS := -N -T minios-$(TARGET_ARCH).lds
19 # For possible special source directories.
20 EXTRA_SRC =
21 # For possible special header directories.
22 EXTRA_INC =
24 # Standard name for architecture specific subdirectories.
25 TARGET_ARCH_DIR = $(TARGET_ARCH)
26 # This is used for architecture specific links.
27 ARCH_LINKS =
29 ifeq ($(TARGET_ARCH),x86_32)
30 CFLAGS += -m32 -march=i686
31 LDFLAGS += -m elf_i386
32 TARGET_ARCH_DIR = x86
33 EXTRA_INC += $(TARGET_ARCH_DIR)/$(TARGET_ARCH)
34 EXTRA_SRC += arch/$(EXTRA_INC)
35 endif
37 ifeq ($(TARGET_ARCH)$(pae),x86_32y)
38 CFLAGS += -DCONFIG_X86_PAE=1
39 ASFLAGS += -DCONFIG_X86_PAE=1
40 TARGET_ARCH_DIR = x86
41 EXTRA_INC += $(TARGET_ARCH_DIR)/$(TARGET_ARCH)
42 EXTRA_SRC += arch/$(EXTRA_INC)
43 endif
45 ifeq ($(TARGET_ARCH),x86_64)
46 CFLAGS += -m64 -mno-red-zone -fpic -fno-reorder-blocks
47 CFLAGS += -fno-asynchronous-unwind-tables
48 LDFLAGS += -m elf_x86_64
49 TARGET_ARCH_DIR = x86
50 EXTRA_INC += $(TARGET_ARCH_DIR)/$(TARGET_ARCH)
51 EXTRA_SRC += arch/$(EXTRA_INC)
52 endif
54 ifeq ($(TARGET_ARCH),ia64)
55 CFLAGS += -mfixed-range=f12-f15,f32-f127
56 ASFLAGS += -x assembler-with-cpp -ansi -Wall
57 ASFLAGS += -mfixed-range=f12-f15,f32-f127
58 ARCH_LINKS = IA64_LINKS # Special link on ia64 needed
59 define arch_links
60 [ -e include/ia64/asm-xsi-offsets.h ] || ln -sf ../../../../xen/include/asm-ia64/asm-xsi-offsets.h include/ia64/asm-xsi-offsets.h
61 endef
62 endif
64 ifeq ($(debug),y)
65 CFLAGS += -g
66 else
67 CFLAGS += -O3
68 endif
70 # Add the special header directories to the include paths.
71 extra_incl := $(foreach dir,$(EXTRA_INC),-Iinclude/$(dir))
72 override CPPFLAGS := -Iinclude $(CPPFLAGS) -Iinclude/$(TARGET_ARCH_DIR) $(extra_incl)
74 TARGET := mini-os
76 HEAD := $(TARGET_ARCH).o
77 OBJS := $(patsubst %.c,%.o,$(wildcard *.c))
78 OBJS += $(patsubst %.c,%.o,$(wildcard lib/*.c))
79 OBJS += $(patsubst %.c,%.o,$(wildcard xenbus/*.c))
80 OBJS += $(patsubst %.c,%.o,$(wildcard console/*.c))
81 OBJS += $(patsubst %.S,%.o,$(wildcard arch/$(TARGET_ARCH_DIR)/*.S))
82 OBJS += $(patsubst %.c,%.o,$(wildcard arch/$(TARGET_ARCH_DIR)/*.c))
83 # For special wanted source directories.
84 extra_objs := $(foreach dir,$(EXTRA_SRC),$(patsubst %.c,%.o,$(wildcard $(dir)/*.c)))
85 OBJS += $(extra_objs)
86 extra_objs := $(foreach dir,$(EXTRA_SRC),$(patsubst %.S,%.o,$(wildcard $(dir)/*.S)))
87 OBJS += $(extra_objs)
89 HDRS := $(wildcard include/*.h)
90 HDRS += $(wildcard include/xen/*.h)
91 HDRS += $(wildcard include/$(TARGET_ARCH_DIR)/*.h)
92 # For special wanted header directories.
93 extra_heads := $(foreach dir,$(EXTRA_INC),$(wildcard $(dir)/*.h))
94 HDRS += $(extra_heads)
96 .PHONY: default
97 default: $(TARGET)
99 # Create special architecture specific links.
100 ifneq ($(ARCH_LINKS),)
101 $(ARCH_LINKS):
102 $(arch_links)
103 endif
105 .PHONY: links
106 links: $(ARCH_LINKS)
107 [ -e include/xen ] || ln -sf ../../../xen/include/public include/xen
109 libminios.a: links $(OBJS) $(HEAD)
110 $(AR) r libminios.a $(HEAD) $(OBJS)
112 $(TARGET): libminios.a $(HEAD)
113 $(LD) $(LDFLAGS) $(HEAD) $(LDLIBS) -o $@.elf
114 gzip -f -9 -c $@.elf >$@.gz
116 .PHONY: clean
117 clean:
118 find . -type f -name '*.o' | xargs rm -f
119 rm -f *.o *~ core $(TARGET).elf $(TARGET).raw $(TARGET) $(TARGET).gz
120 rm -f libminios.a
121 find . -type l | xargs rm -f
123 %.o: %.c $(HDRS) Makefile
124 $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
126 %.o: %.S $(HDRS) Makefile
127 $(CC) $(ASFLAGS) $(CPPFLAGS) -c $< -o $@
129 define all_sources
130 ( find . -follow -name SCCS -prune -o -name '*.[chS]' -print )
131 endef
133 .PHONY: cscope
134 cscope:
135 $(all_sources) > cscope.files
136 cscope -k -b -q