Different CFLAGS for arch and non-arch files.

Peter Bergner (bergner@borg.umn.edu)
Tue, 20 Feb 2001 21:08:02 -0600


Hopefully someone can point me in the right direction here.
I need to use different CFLAGS options depending on whether
I'm compiling arch dependent code or arch independent code.
It seems the arch/XXX/Makefile only adds extra options to
CFLAGS and doesn't allow me specify options I want to apply
only to arch dependent code and others I'd like to apply
only to arch independent code. Has anyone done such a thing?

I guess I'd like to have CFLAGS, CFLAGS_ARCH and CFLAGS_NONARCH
vars that would be set in the arch/XXX/Makefile and then break
up the SUBDIRS var in the toplevel Makefile into SUBDIRS and
ARCHSUBDIRS so we could iterate over them with the different
CFLAGS options (ie, CFLAGS + CFLAGS_NONARCH for the arch independent
files and CFLAGS + CFLAGS_ARCH for the arch dependent files).

My reason for doing this is that our new architecture's ABI
specifies the use of a TOC (table of contents) and we're running
into a TOC overflow problem. I can use GCC's -mminimal-toc option,
but not for routines that will be called before relocation is turned
on (the global TOC contains virtual addrs of the private TOCs).
My idea is to compile all the arch dependent code without the
-minimal-toc option and all the arch independent code with the
-minimal-toc option.

Any clues on what I can/need to do would be appreciated.

Peter

--
Peter Bergner
SLIC Optimizing Translator Development / Linux PPC64 Kernel Development
IBM Rochester, MN
bergner@us.ibm.com

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/