| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
is long but I hate to lose the information so I am including it here.
> I am still fixing and recompiling but this is the issue that was not the
> result of another patch. This is a fundamental build issue that I value
> your opinion on.
This is difficult issue (I.e. I have no destinct solution for it)
Background:
(gnu-) make's implicit rules apply CFLAGS, CPPFLAGS, CXXFLAGS, ASFLAGS and
LDFLAGS (cf. make.info/Implicit Rules/Catalogue of Rules), only.
In brief:
CPPFLAGS .. passed to the c-preprocessor
CFLAGS ... passed to the c-compiler
CXXFLAGS ... equivalent to CFLAGS but passed to the c++ compiler
(Attention: CFLAGS is not passed to the c++ compiler)
ASFLAGS .. equivalent to CFLAGS, but passed to the assembler
LDFLAGS .. equivalent to CFLAGS, but passed to the linker
A bit oversimplifying, these make rules are as follows
.c.o:
$(CC) $(CPPFLAGS) $(CFLAGS) -c
.cc.o:
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c
.S.s:
$(CPP) $(CPPFLAGS)
.s.o:
$(AS) $(ASFLAGS)
My reading of the documentation (make.info) is that {AS|AR|CC|CXX|CPP}FLAGS
are ment to be passed to the related tools directly, however examinating
the rule set of gmake (gmake -p -f /dev/null") shows that many rules use
$(CC) instead of the related tools (eg. linker rules) etc.
I.e. these flags should not rely on being passed through cpp or gcc. With
gcc being the common frontend for all of these tools of a gnu-toolchain the
situation becomes difficult (Which option is passed to whom and which tool
really uses it?), because these variable can also contain the toolchain's
frontend (eg. AS=gcc, LD=gcc, CPP=gcc -E).
For some commonly used options the situation is quite clear:
* -g -> CFLAGS
* -OX -> CFLAGS
* -D -> CPPFLAGS
* -A -> CPPFLAGS
But where to add -m, -B, -specs, -qrtems_XXX ?
* -B, -specs, -qrtems_XXX are gcc-frontend options
* -m is a combinations of flags to go to different destinations, in many
(all?) cases, the following is valid
-m is expanded by gcc into a set of -D and -A options
-m is interpreted by cc1 as a machine flag to generate a specific
instruction set.
-m is interpreted by gcc as an implicit linker search path for multilibs to
set up calls to LD.
>From my point of view this indicates we can either destingush between these
different usages (= separately add -m to CFLAGS, LDFLAGS etc) or to add it
to CPPFLAGS and use gcc (the frontend) instead of calling each tool
directly (less error prone) -- I vote for CPPFLAGS, but I am not sure.
-----------------
Now, where to add CPU_CFLAGS?
AFAIS, in probably all cases CPU_CFLAGS contain -D -A, and -m options,
only.
* -D and -A are supposed to go to CPPFLAGS
* -mXXX options can have multiple meanings (It can be gcc, collect2/ld and
cc1/cc1plus option simultaneously)
Here, I made a mistake - I destinguished between CPU_DEFINES to be added to
CPPFLAGS and CPU_CFLAGS to be added to CFLAGS and CXXFLAGS (cf.
gcc-target-default.cfg), generally assuming CPU_CFLAGS are CFLAGS.
This breaks preprocessing *.S into *.i files because CPU_CFLAGS flags were
not added to CPPFLAGS. Hence *all* *.S were compiled without taking
-mXX-flags into account. The i960/cvme BSP was the only one which
explicitly checked for a specific -m flag (-mca) and refused to compile
without it -- all other CPUs/BSPs silently swallowed this.
IMO, we can either
1) add CPU_CFLAGS and CPU_DEFINES to CPPFLAGS, thus silently convert
CPU_CFLAGS's meaning into CPU_DEFINES (Alternative solution: rename
CPU_CFLAGS to CPU_DEFINES and merge CPU_FLAGS with CPU_DEFINES).
or
2) destinguish between CPU_DEFINES and CPU_CFLAGS. In this case we would
need to check the contents of each CPU_CFLAGS in custom/*.cfg and move the
some parts of the contents to CPU_DEFINES and keep other parts in
CPU_CFLAGS (CFLAGS must contain options for the c/c++-compiler only!).
Though Solution 2) is the clearer one, I implemented 1) which is the
simplier one (the patch below).
ATTENTION: This patch is small in size, but affects almost everything.
------------
Additional complications araise with linking:
Some BSPs call LD and AS directly (esp. gcc-2.7 make-exe rules). If LD=gcc
then LDFLAGS are supposed to be gcc-options, but if LD=ld then LDFLAGS is
supposed to contain ld-options.
An analog thought is valid for AS, but luckily enough ASFLAGS is not used
of inside the whole source tree.
Most RTEMS' custom/*.cfg use $(CC) $(CFLAGS) to link with gcc-2.8 make-exe
rules. With the patch below (CPU_CFLAGS added to CPPFLAGS) this means
CPU_CFLAGS will not be passed to the linker, which is incorrect for
multilibbed CPU's.
gmake's default rule set contains a variety of rules for linking, all
ending up in calling $(CC) $(LDFLAGS) for linking at their very end.
IMO, this means we should use something like
LINK.o = $(CC) $(LDFLAGS) in gcc-target-default.cfg
+ modify all gcc-2.8 make-exe rules to use
$(LINK.o) .......
+ setup LDFLAGS according to the requirements of the above.
I.e. we should use $(CC) for linking instead of calling the linker (LD)
directly and set LDFLAGS = $(CPPFLAGS) $(CFLAGS) or similar.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
> 5) rtems-rc-19990202-1.diff/reorg-install.sh
>
> reorg-install.sh fixes a Makefile variable name clash of RTEMS
> configuration files and automake/autoconf standards.
> Until now, RTEMS used $(INSTALL) for install-if-change. Automake and
> autoconf use $(INSTALL) for a bsd-compatible install. As
> install-if-change and bsd-install are not compatible, I renamed all
> references to install-if-changed to $(INSTALL_CHANGED) and used
> $(INSTALL) for bsd-install (==automake/autoconf standard). When
> automake will be introduced install-if-change will probably be replaced
> by $(INSTALL) and therefore will slowly vanish. For the moment, this
> patch fixes a very nasty problem which prevents adding any automake file
> until now (There are still more).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
> 2) rtems-rc-19990131-1.diff
>
> Rework of compilers/*.cfg files (esp. gcc-target-default.cfg) to adapt
> the flags/makefile variables to automake and make standards (cf.
> make.info - implicit rules/variables).
>
> This patch is rather risky and may probably break things, but is an
> essential step towards automake.
>
> FWIW: It also reverts the i386-ASMFLAGS/ASFLAGS-patch, which was wrong,
> as I had to experience ;-.
|
|
|
|
|
|
|
| |
> Adds variables to the custom/*cfg files to specify the location of
> tools. The purpose is to remove hard-coded paths from the Makefiles.
>
> In later steps this eases moving the tools to other locations.
|
|
|
|
| |
used in gcc.
|
|
|
|
|
| |
.s files to .S in conformance with GNU conventions. This is a
minor step along the way to supporting automake.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
I have managed to build the bsp ods68302 and the rtti test case I made
with egcs-1.1b and binutils-2.9.1.
I have built our C++ application and got no link errors so it looks like
this is now working. I am yet to test the code but getting the thing to
link was the problem.
Please find a patch attached which removes the -fno-rtti option.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
make solaris target buildable.
> 1. The ipc check fails since solaris does not define union semun.
> The unix port code actually defines this type itself on solaris. Doing
> the same thing lets it get configured. Then...
> 2. It looks like BSDINSTALL is not defined properly.
BSDINSTALL is defined in make/host.cfg.in as
BSDINSTALL=@INSTALL@
@INSTALL@ is generated by autoconf's standard macro AC_PROG_INSTALL, which
is widely used in almost any autoconf/automake configured package. In case
there is really something wrong with it, then it must be considered a bug
in autoconf.
I can see a doubious fragment in AC_PROG_INSTALL, which is used when no
appropriate bsd-install is found.
Finally Ralf saw a problem with the find on solaris which I also saw and
fixed.
|
|
|
|
| |
CPU_ASFLAGS.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Added support for bsd "install" ($(BSDINSTALL)) to host.cfg.in, i.e.
the standard "install" program that most packages (including automake)
use. In Makefiles outside of rtems, "install" normally is referenced by
$(INSTALL), but rtems already uses $(INSTALL) for install-if-change,
hence I used $(BSDINSTALL) instead to keep up backward compatibility.
* Removed references to @GREP@ etc. from host.cfg.in, as configure.in
doesn't check for them (Minor cleanup).
* Added installation flags INST*FLAGS to host.cfg.in, which should
replace -m XXXX flags for installation calls.
*Changes to gcc.cfg to enable it to build host programs from multiple
sources files.
Should not disturb existing sources, but neccessary.
* There was a not-so-minor bug in the configuration files: "make
install" and "make debug_install" don't work in all subdirectories!! I
tried to fix this by adding "install" to MTARGETS in main.cfg, which
seems to solve most of the problems. But there still seem to be rare (?)
cases where "make debug_install" still seems to have problems.
* Changes to many host related tool-Makefiles to demonstrate the
abilities of INST*FLAGS, BSDINSTALL and the new rules in gcc.cfg.
..of cause ... but BSDINSTALL is THE standard method to install files
in most program packages besides rtems. This part of the patch fixes
some minor protection setting problems, but doesn't support
TARGET_VARIANTS
NOTE:
I hope you will like the BSDINSTALL, INST*FLAGS stuff. It is a step to
get rid of "install-if-change" and to rely on a more standard
installation procedure. If you don't like BSDINSTALL, removing it from
the patch isn't difficult- just grep for BSDINSTALL and replace
BSDINSTALL with INSTALL or MKDIR.
FINALLY:
I still have another patch pending (well, not a complete patch yet, it's
a partial patch to demonstrate the principle), which adds automatic
rebuilding of files generated by autoconf/configure. At the moment I
don't dare to submit it, because integrating this patch would require to
modify all Makefile.ins because we'd need to add a new "include " line
to each Makefile.in.
|
|
|
|
|
|
|
|
| |
<corsepiu@faw.uni-ulm.de> and his comments are below:
Joel, obviously you did apply my previous patch to
gcc-target-default.cfg -- This should have been gcc.cfg
(gcc-target-default.cfg should NOT contain any EXEEXT).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
> It seems that rules for %{EXEEXT} don't exist in gcc-target-default.cfg
No, gcc-target-default.cfg is used to compile executables for the target
only, not for the host.
EXEEXT may only be used for programs to be run on the host.
> What should I add please?
This was a bug in my initial configuration patch to rtems-980616. A
correction to this patch I had sent to Joel at 26.06.98 doesn't seem to
have made it into the snapshot.
Please find attached the patch I had sent to Joel, hopefully this patch
fixes this problem.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 i[[3456]]86-unknown-freebsd2.[[12]] with i[[3456]]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.
|
|
|
|
| |
<g_montel@yahoo.com>.
|
| |
|
| |
|
|
|
|
| |
Added CROSS_TARGET conditionals so unix port can share this file.
|
|
|
|
| |
Removed unnecessary definition of "ED".
|
|
|
|
|
| |
This typically indicates a bug in a directory level Makefile or a configure
scrip bug.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Yep, I have a bunch of bug-fixes and additions pending (Yet another monster
patch, ... I can hear you scream :-).
1) configure.in : one AC_CONFIG_HEADER(...) line too much.
2) configure.in: gcc28 support is enabled by default, i.e. if no
--enable-gcc28 option is passed on the command line. I am not sure if this
is intentional.
IMO, AC_ARG_ENABLE for --enable-gcc28 should look like:
AC_ARG_ENABLE(gcc28, \
[ --enable-gcc28 enable use of gcc 2.8.x features], \
[case "${enableval}" in
yes) RTEMS_USE_GCC272=no ;;
no) RTEMS_USE_GCC272=yes ;;
*) AC_MSG_ERROR(bad value ${enableval} for gcc-28 option) ;;
esac],[RTEMS_USE_GCC272=yes])
3) At the end of c/src/exec/score/cpu/m68k/m68k.h
> #ifdef __cplusplus
> }
> #endif
>
> #endif /* !ASM */
in my opinion these two statements should be swapped:
> #endif /* !ASM */
>
> #ifdef __cplusplus
> }
> #endif
I didn't try to compile for m68k, but does't this give an error? Is it
compensated somewhere else - or didn't I look carefully enough?
5) configure.in: --enable-cpp should probably be renamed to --enable-cxx, as
gnu-programs use "cxx" to specify C++ specific configure options, while cpp
is used for the preprocessor (e.g egcs uses --with-cxx-includedir, autoconf
internally uses $CXX),
6) The macro files from aclocal/*.m4 contain the buggy sed-rules formerly
contained in aclocal..m4, i.e. the sed/sort-bug fix to aclocal.m4 didn't
make it to aclocal/*.m4. I think I should feel guilty for that - Obviously I
submitted the contents of an old aclocal-directory last time. - Sorry.
7) For sh-rtems, we currently need to add additional managers to
MANAGERS_REQUIRED (from inside of custom/*.cfg). Currently MANAGERS_REQUIRED
is defined in make/compilers/*.cfg. This seems to prevent overriding
MANAGERS_REQUIRED from custom/*.cfg files - Obviously the files are included
in such a way that the settings from compilers/*cfg always override settings
from custom/*.cfg files.
Furthermore, I think, defining MANAGERS_* inside gcc-<target>.cfg files is
not correct - MANAGERS are not gcc-variant-dependent, but depend
on targets/bsps and therefore should be defined in a bsp/target dependent
file, e.g. in custom/*.cfg or target.cfg.in.
I think defining default settings for MANAGERS* in custom/default.cfg could
be an appropriate location. But this requires all custom/*.cfg files to
include default.cfg, which *-posix.cfg files don't seem to do.
Therefore I would like propose to move MANAGERS* to target.cfg.in - they are
included by all custom/*.cfg files. Perhaps we/you should use this
opportunity to merge parts from custom/default.cfg into target.cfg.in. This
ensures to have the setting included once per target makefile and will open
the opportunity to have autoconf doing additional work on
bsp-configurations.
Peanuts sofar, ... but here it comes ... (:-)
8) I am preparing a major enhancement to autoconf support for
gnutools/compilers. It is not yet finished, but usable and I'll therefore
attach a preliminary version to this mail.
Motivation:
* Fix problems with --enable-gcc28, if target-cc is not gcc28 compatible
* Fix -pipe problems
* Fix problems with hard-coded paths in configuration files (esp. posix)
* Fix consistency problems with explictly given gnutools and gcc's gnutools
Currently included:
* detection and checking of host and target compiler (gcc/g++)
* checking if target gnutools are in path
* checking if <target>-gcc -specs works (autodisabling gcc28 if not)
* checking if <target>-gcc -pipe works
Todo :
* *posix.cfg files are not yet adapted => The hard-coded paths for these
systems are still in use.
* Check if the host compiler $CC is properly propagated to the Makefiles (I
doubt it, but this should not matter)
* Check if rtems' generic tools still work properly (It looks like, but who
knows)
* Integrate CXX support into default.cfg or gcc-target-default.cfg (It looks
like C++ support is only used by posix BSPs)
* Automatically handle RANLIB/MKLIB for targets
* Plenty ... (:-)
Open problems:
* Untested for non-gcc compatible host and target compilers. This should be
no problem if the tools are named follow gnutool's naming convention and are
included in $PATH while running configure.
* Intentionally using different tools than that gcc has been configured for,
e.g. use a different assembler ? This should be still possible if
XX_FOR_TARGET is hard-coded into custom/*.cfg. I don't see why anybody
should want to do this, but who knows?
I have tested this version on linux and solaris hosts, with gcc's
directories mounted at weird non-standard mount points, using egcs
(linux/sh-rtemscoff), gcc-2.7.2.2 using native tools (solaris), gcc-2.7.2.3
w/ gnutools (solaris/linux). I don't expect it to break anything, but of
cause I can't promise it. It will break most/all *-posix.cfg configuration
almost for certain, but not more as rtems' current *posix.cfg configurations
already do (hard-coded configurations).
I am not sure if this is ready to be included into the next snapshot or not.
Perhaps you might try this on your systems and if it you don't notice
serious bugs you might put it into the snapshot for public testing (I don't
like this, but I don't see another possiblity to test generality).
I enclose a patch for configure.in and some configuration files which
comprizes fixes for all items mentioned except of #3 . Don't forget to run
"aclocal -I aclocal; autoconf;" after applying the patch (:-).
|
|
|
|
| |
"gmake debug".
|
| |
|
|
|