source: rtems/make/compilers/gcc-no_bsp.cfg @ 0162910

4.104.114.84.95
Last change on this file since 0162910 was 98100d2, checked in by Joel Sherrill <joel.sherrill@…>, on 06/27/98 at 17:09:47

Monstrous patch from Ralf Corsepius <corsepiu@…>. I have
made no attempt to divide the comments up and place them with just
the appropriate files. Here is an excerpt from Ralf's email:

Changes including comments on changes I made after cycling through
all the targets:

  • Added ranlib support. Now all targets use "ranlib" instead of "ar -s" to build an index for a library. If ranlib isn't detected during configuration, check if ar -s is working and try "ar -s" instead of
  • Removed $(XXX_FOR_TARGET) from make/target.cfg.in, use $(XXX) instead now.
  • gcc-target-default.cfg: LINK_XXXX-defines reworked to solve the -l problem under posix (cf gcc-target-default.cfg)
  • rtems-glom replaced by Makefile-rules inside of the wrapup/Makefile.in that has been using rtems-glom until now.
  • Removed CCC and friends in gcc-target-default.cfg, as they have been breaking CXX support.
  • Removed CONFIG.$(TARGET_ARCH).CC lines from several custom/*.cfg files, because this is now set in custom/default.cfg.
  • Added aclocal/ar-s.m4, check whether "ar -s" is working
  • Added aclocal/cygwin.m4 and aclocal/exeext.m4.
  • Reworked aclocal/canonicalize-tools.m4: Added ar -s check; fixes for problems when XXX_FOR_TARGET is given via environment variables (didn't work for gcc until now), adding cygwin check, improved autoconf-cache handling.
  • Removed -l from make rule dependencies. LINK_LIBS is now allowed to contain -L and -l. LINK_OBJS and LINK_FILES must not contain -L or -l. gcc28 make-exe rules now link using $(LINK_OBJS) $(LINK_LIBS) => Almost all custom/*.cfg are modified. This is very likely to break something because of typos or having missed to edit a file.

Open problems, known bugs, things I didn't do:

  • custom/p4000.cfg seems to be out of date and requires to be reviewed.

(JRS NOTE: It is subordinate p4650 and p4600 -- both of which build ok

after minor changes.)

  • custom/psim.cfg needs to be reviewed, I added some changes to it, I am insecure about.

(JRS NOTE: psim had a minor problem endif/endef swapped but runs fine.)

  • rtems-glom.in can now be removed.
  • gcc*.cfg files "make depend" rules don't honor language specific flags (e.g CXXFLAGS is ignored for *.cc) - Nothing to worry about now, but may cause problems for hosts/targets not using gcc or rtems-add-ons that use external packages.
  • AFAIS, the no_bsp BSP can't be build anymore, i.e. configure refused to configure for it whatever I tried.
  • The toplevel and toplevel+1 README files are quite out-dated
  • cygwin.m4 isn't of much use for rtems. In most cases (cf. aclocal/*.m4) it is worked around by directly using $host_os. I think I'll remove it soon after the next snapshot
  • Before release the cygwin patch needs to be tested under cygwin. I may have broken/missed something (esp. the sed-pattern to convert
    into / may be broken).
  • You should try to build/run the posix-BSP under solaris - I don't expect problems, but I am not 100% sure, esp. with regard to ranlib/ar -s.
  • You should consider to convert all make/compilers/*.cfg files into make/compilers/*.cfg.in files and let autoconf generate the *.cfg. This may help getting rid of some if/then/else statements and help hard-coding some defines into those files in future and shouldn't disturb now.
  • Not having installed libc.a/libm.a on a host may still break building rtems, esp. when using -disable-gcc28 as the gcc27-configuration scheme directly accesses libc.a and libm.a. The problem should not appear when using gcc28 because it references libc/libm only through -lc and -lm which may be static or dynamic (I didn't test this).
  • shgen is not yet included (I didn't yet have enough time to integrate it).
  • I know about a few more configure-probs (esp. cross-checking --enable-* flags).

+ warn/refuse to configure when --enable-libcdir and

--enable-gcc28 are given.

+ force --enable-libcdir when --disable-gcc28 is given

  • Replaced KSHELL with @KSH@ in some shell scripts generated by configure.in.
  • Added a dependency to aclocal/*.m4 in the toplevel Makefile => configure and aclocal.m4 will now be rebuild when any aclocal/*.m4 file is changed
  • Some changes to aclocal/gcc-pipe.m4 and aclocal/gcc-specs.m4
  • Replaced i3456?86-unknown-freebsd2.12? with i3456?86-*freebsd2.* in configure.in, as I suppose there might exist a variety of valid vendors (2nd field of the name-tripple)
  • Disabled override MAKEFLAGS in toplevel Makefile.in - Potential side-effects are not really clear to me.
  • In mvme162.cfg, $(LINK_LIBS) is missing in the CC line in gcc28's make-exe rule (yet another one I missed to edit). Just append $(LINK_LIBS) to the "CC" line, like I hopefully did to ALL other custom/*.cfg files.
  • the problem with mvme162lx.cfg is a follow-up problem of the mvme162.cfg-bug.
  • mvme162/console and idp/console had variables named Buffer which conflicted with similarly named variables in some tests.
  • Property mode set to 100644
File size: 7.3 KB
Line 
1#
2#  $Id$
3#
4# gcc 2.6.x compiler for a "native" nocpu/nobsp system
5# Compiler (and tools) configuration
6#
7
8# Prefix on the installed GNU tools
9#  Just use the native tools
10GNU_TOOLS_PREFIX=
11
12# Additional target names (other than debug, profile)
13TARGET_VARIANTS +=
14
15#
16# Pre-processor defines using the target options header file.
17#
18# Local tailoring (on the command line) can be done by setting XCFLAGS
19# or XCPPFLAGS -- neither of which are never set in the Makefile's
20#
21
22CPPFLAGS=$(CFLAGS) $(XCPPFLAGS) $(DEFINES)
23
24CPLUS_CPPFLAGS=$(CFLAGS) $(XCPPFLAGS) $(DEFINES)
25
26#  This section makes the target dependent options file.
27
28#  NDEBUG (C library)
29#     if defined asserts do not generate code.  This is commonly used
30#     as a command line option.
31#
32#  RTEMS_TEST_NO_PAUSE (RTEMS tests)
33#     do not pause between screens of output in the rtems tests
34#
35#  NO_TABLE_MOVE (SPARC PORT)
36#     do not have a second trap table -- use the BSP's
37#
38#  STACK_CHECKER_ON (RTEMS support code)
39#     If defined, stack bounds checking is enabled.
40#
41#  RTEMS_DEBUG (RTEMS)
42#     If defined, debug checks in RTEMS and support library code are enabled.
43
44define make-target-options
45        echo "/* #define NDEBUG 1 */ "                     >>$@
46        echo "#define RTEMS_TEST_NO_PAUSE 1"               >>$@
47        echo "/* #define STACK_CHECKER_ON  1 */"           >>$@
48        echo "/* #define RTEMS_DEBUG  1 */"                >>$@
49endef
50
51#
52# Local tailoring (on the command line) can be done by setting XCFLAGS
53# which is never set in the Makefile's
54#
55
56#
57# CFLAGS_OPTIMIZE_V, CFLAGS_DEBUG_V, CFLAGS_PROFILE_V are the values we
58# would want the corresponding macros to be set to.
59#
60# CFLAGS_OPTIMIZE, CFLAGS_DEBUG, CFLAGS_PROFILE are set in the leaf
61# Makefiles by the 'debug:' and 'profile:' targets to their _V values.
62#
63
64# default flags
65
66#
67#  This contains the compiler options necessary to select the CPU model
68#  and (hopefully) optimize for it.
69#
70CPU_CFLAGS =
71
72CFLAGS_DEFAULT = $(CPU_CFLAGS) -Wall -ansi -fasm
73
74# optimize flag: typically -0, could use -O4 or -fast
75# -O4 is ok for RTEMS
76CFLAGS_OPTIMIZE_V=-O4 -fomit-frame-pointer
77
78# debug flag; typically -g
79CFLAGS_DEBUG_V=-g -Wno-unused
80
81# when debugging, optimize flag: typically empty
82# some compilers do allow optimization with their "-g"
83CFLAGS_DEBUG_OPTIMIZE_V=
84
85# profile flag; use gprof(1)
86CFLAGS_PROFILE_V=-pg
87
88# default is to optimize
89CFLAGS_OPTIMIZE=$(CFLAGS_OPTIMIZE_V)
90
91# dynamic libraries
92CFLAGS_DYNAMIC_V=-fpic
93ASFLAGS_DYNAMIC_V=
94
95CFLAGS=$(CFLAGS_DEFAULT) $(CFLAGS_OPTIMIZE) $(CFLAGS_DEBUG) $(CFLAGS_PROFILE) \
96       -I $(PROJECT_INCLUDE)
97
98# List of library paths without -L
99LD_PATHS= $(PROJECT_RELEASE)/lib
100
101# libraries you want EVERYONE to link with
102LD_LIBS=
103
104# ld flag to ensure pure-text
105LDFLAGS_MUST_BE_PURE_V =
106
107# ld flag for [un]shared objects
108LDFLAGS_STATIC_LIBRARIES_V =
109LDFLAGS_SHARED_LIBRARIES_V =
110
111# ld flag for incomplete link
112LDFLAGS_INCOMPLETE = -r
113
114# Special linker options when building lib.so
115LDFLAGS_DYNAMIC_V = ??
116
117# Some dynamic linking systems want the preferred name recorded in the binary
118# ref: src/libxil/Makefile
119LDFLAGS_DYNAMIC_LIBNAME_V = -h $(DYNAMIC_VERSION_LIBNAME)
120
121# ld flags for profiling, debugging
122LDFLAGS_PROFILE_V =
123LDFLAGS_DEBUG_V =
124
125LDFLAGS=$(LDFLAGS_PROFILE) $(LDFLAGS_DEBUG) $(LD_PATHS:%=-L %)
126
127#
128# Stuff to clean and clobber for the compiler and its tools
129#
130
131CLEAN_CC = a.out *.o *.BAK
132CLOBBER_CC =
133
134#
135# Client compiler and support tools
136#
137
138CC=gcc
139CXX=$(CC)
140CCC=$(CXX)
141
142# CPP command to write file to standard output
143CPP=$(CC) -E
144
145# flags set by cc when running cpp
146CPP_CC_FLAGS=-D__STDC__
147
148AS=as
149ASPP=ERROR_NO_ASPP
150
151ASFLAGS=
152ASM4FLAGS := -I $(PROJECT_INCLUDE)
153
154
155# NOTE: should never use full path .. but there is no guarantee ld, etc
156#       will be in the same directory as gcc.. so hope they are in the path
157#       Don't do this on a real target!!!
158LD=ld
159NM=nm
160AR=ar
161# egrep regexp to ignore symbol table entries in ar archives.
162# Only used to make sure we skip them when coalescing libraries.
163# skip __.SYMDEF and empty names (maybe bug in ranlib??).
164AR_SYMBOL_TABLE="HIGHLY-UNLIKELY-TO-CONFLICT"
165ARFLAGS=ruv
166
167# NOTE: see comment on ld, nm, ar
168SIZE=size
169
170#
171# Command to convert a normal archive to one searchable by $(LD)
172# Not needed on SVR4
173#
174
175MKLIB=echo library is complete:
176
177#
178# How to compile stuff into ${ARCH} subdirectory
179#
180# NOTE: we override COMPILE.c
181#
182
183COMPILE.c=$(CC) $(CFLAGS) $(CPPFLAGS) $(XCFLAGS) -c
184
185${ARCH}/%.o: %.c
186        ${COMPILE.c} -o $@ $<
187
188${ARCH}/%.o: %.cc
189        ${COMPILE.c} -o $@ $<
190
191${ARCH}/%.o: %.S
192        ${COMPILE.c} -DASM -o $@ $<
193
194${ARCH}/%.o: %.s
195        $(CPP) $(CPPFLAGS) - <$*.s  >$(ARCH)/$*.i
196        $(AS) $(ASFLAGS) -o $@ $(ARCH)/$*.i
197#       $(RM) $(ARCH)/$*.i
198
199# Specify our own default rule for this to prevent having CFLAGS and
200#  CPPFLAGS being passed to linker
201${ARCH}/%: ${ARCH}/%.o
202        ${CC} ${LDFLAGS} -o $@ $@.o ${LD_LIBS}
203
204# Make foo.rel from foo.o
205${ARCH}/%.rel: ${ARCH}/%.o
206        ${LD} $(LDFLAGS_INCOMPLETE) -o $@ $^
207
208# create $(ARCH)/pgm from pgm.sh
209${ARCH}/%: %.sh
210        $(RM) $@
211        $(CP) $< $@
212        $(CHMOD) +x $@
213
214# Dependency files for use by gmake
215# NOTE: we don't put in $(TARGET_ARCH)
216#       so that 'make clean' doesn't blow it away
217
218DEPEND=Depends-$(TARGET_ARCH:o-%=%)
219
220CLEAN_DEPEND=$(DEPEND).tmp
221CLOBBER_DEPEND=$(DEPEND)
222
223# We deliberately don't have anything depend on the
224# $(DEPEND) file; otherwise it will get rebuilt even
225# on 'make clean'
226#
227
228depend: $(C_FILES) $(CC_FILES) $(S_FILES)
229ifneq ($(words $(C_FILES) $(CC_FILES) $(S_FILES)), 0)
230#       Use gcc -M to generate dependencies
231#       Replace foo.o with $(ARCH)/foo.o
232#       Replace $(ARCH) value with string $(ARCH)
233#           so that it will for debug and profile cases
234        $(COMPILE.c) -M   $^    |  \
235        $(SED) -e 's?^\(.*\)\.o[ ]*:?$$(ARCH)/\1.o:?' \
236            -e 's?$(ARCH)/?$$(ARCH)/?'   >$(DEPEND).tmp
237        $(MV) $(DEPEND).tmp $(DEPEND)
238endif
239
240
241# List (possibly empty) of required managers
242# We require:
243#    region  -- used by lib/libcsupport for malloc()
244#    ext     -- used by libc for libc reentrancy hooks
245
246MANAGERS_REQUIRED=region ext sem
247
248# Create a RTEMS executable based on MANAGERS which was set in
249#  app's Makefile
250
251MANAGERS_NOT_WANTED=$(filter-out $(MANAGERS), $(MANAGER_LIST))
252MANAGERS_NOT_WANTED:=$(filter-out $(MANAGERS_REQUIRED), $(MANAGERS_NOT_WANTED))
253
254# spell out all the LINK_FILE's, rather than using -lbsp, so
255#  that $(LINK_FILES) can be a dependency
256
257# Start file must be one of
258#    $(PROJECT_RELEASE)/lib/start$(LIB_VARIANT).o
259#    $(PROJECT_RELEASE)/lib/asmiface$(LIB_VARIANT).o
260# It defaults to start.o, but an app can override it.
261
262# Note:  Normally RTEMS provides a start file...
263START_FILE=
264
265CONSTRUCTOR=
266
267LIBGCC = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name $(GCCSED))
268
269LINK_FILES= $(START_FILE) \
270    $(CONSTRUCTOR) \
271    $(OBJS) \
272    $(MANAGERS_NOT_WANTED:%=$(PROJECT_RELEASE)/lib/no-%$(LIB_VARIANT).rel) \
273    $(LD_LIBS) \
274    $(LIBC_EXTRA_LIBS)  \
275    $(PROJECT_RELEASE)/lib/libtest$(LIBSUFFIX_VA) \
276    $(PROJECT_RELEASE)/lib/librtemsall$(LIBSUFFIX_VA) \
277    $(LIBC_LIBM) $(LIBC_LIBC) $(LIBGCC)
278
279# Here is the rule to actually build a $(ARCH)/foo.exe
280# It also builds $(ARCH)/foo.sr and $(ARCH)/foo.nm
281# Usage ref: src/tests/sptest/sp1/Makefile
282
283# On Solaris at least you need to had /usr/ucblib/libucb.a
284
285define make-exe
286        $(CC) -o $(basename $@).exe $(LINK_FILES) -lc -lm
287        $(NM) -n $(basename $@).exe > $(basename $@).num
288        $(SIZE) $(basename $@).exe
289endef
290
291define make-rel
292        $(LD) $(LDFLAGS_INCOMPLETE) $(XLDFLAGS) -o $@ $(OBJS)
293endef
Note: See TracBrowser for help on using the repository browser.