This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
frv -mno-fdpic => as -mnopic and cpp_spec warning clean ups
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: 16 Apr 2004 05:39:05 -0300
- Subject: frv -mno-fdpic => as -mnopic and cpp_spec warning clean ups
- Organization: Red Hat Global Engineering Services Compiler Team
The assembler now defaults to -mfdpic when built for frv-uclinux.
Therefore, when compiling for -mno-fdpic, the compiler must first
reset the pic bits of the assembler, using the option -mnopic (patch
just posted to the binutils list). Other pic-related options passed
to the compiler are always passed to the assembler after -mnopic, so
it works. I've built a working uClinux kernel with frv-uclinux-gcc
using these changes (the kernel doesn't follow the FDPIC ABI, so it's
built with -mno-fdpic).
While building the toolchain, I noticed an annoying number of
preprocessor warnings while compiling -mno-pack multilibs, because
some __FRV_* macros were defined and redefined in the preprocessor
specs. I fixed them in the simplest possible way, following existing
practice.
Tested building frv-elf and frv-uclinux, using a binutils that had the
frvfdpic-bfdvec patch that I've just posted to the binutils list. I
also built and tested uClibc and the kernel using the frv-uclinux
toolchain.
Ok to install?
Index: gcc/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* config/frv/frv.h (ASM_SPEC): Pass -mno-fdpic as -mnopic.
(CPP_SPEC, CPP_SIMPLE_SPEC): Undefine __FRV_ACC__ and __FRV_FPR__
before redefining them.
Index: gcc/config/frv/frv.h
===================================================================
RCS file: /cvs/uberbaum/gcc/config/frv/frv.h,v
retrieving revision 1.42
diff -u -p -r1.42 frv.h
--- gcc/config/frv/frv.h 7 Mar 2004 20:23:28 -0000 1.42
+++ gcc/config/frv/frv.h 16 Apr 2004 07:07:44 -0000
@@ -109,7 +109,7 @@
%{mmedia} %{mno-media} \
%{mmuladd} %{mno-muladd} \
%{mpack} %{mno-pack} \
- %{mfdpic} \
+ %{mno-fdpic:-mnopic} %{mfdpic} \
%{fpic|fpie: -mpic} %{fPIC|fPIE: -mPIC} %{mlibrary-pic}}"
/* Another C string constant used much like `LINK_SPEC'. The difference
@@ -151,7 +151,7 @@
%{mcpu=tomcat: %(cpp_fr500)} \
%{mcpu=simple: %(cpp_simple)} \
%{!mcpu*: %(cpp_cpu_default)} \
-%{mno-media: -D__FRV_ACC__=0 %{msoft-float: -D__FRV_FPR__=0}} \
+%{mno-media: -U__FRV_ACC__ -D__FRV_ACC__=0 %{msoft-float: -U__FRV_FPR__ -D__FRV_FPR__=0}} \
%{mhard-float: -D__FRV_HARD_FLOAT__} \
%{msoft-float: -U__FRV_HARD_FLOAT__} \
%{mgpr-32: -U__FRV_GPR__ -D__FRV_GPR__=32} \
@@ -203,7 +203,7 @@
-D__FRV_GPR__=32 \
-D__FRV_FPR__=0 \
-D__FRV_ACC__=0 \
-%{mmedia: -D__FRV_ACC__=8} \
+%{mmedia: -U__FRV_ACC__ -D__FRV_ACC__=8} \
%{mhard-float|mmedia: -D__FRV_FPR__=64}"
#define MASK_DEFAULT_FRV \
--
Alexandre Oliva http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org}