From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30307 invoked by alias); 18 Apr 2012 01:10:57 -0000 Received: (qmail 30288 invoked by uid 22791); 18 Apr 2012 01:10:55 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from dns0.mips.com (HELO dns0.mips.com) (12.201.5.70) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 18 Apr 2012 01:10:22 +0000 Received: from exchdb01.mips.com (exchhub01.mips.com [192.168.36.84]) by dns0.mips.com (8.13.8/8.13.8) with ESMTP id q3I1AI38021446; Tue, 17 Apr 2012 18:10:18 -0700 Received: from EXCHDB03.MIPS.com ([fe80::6df1:ae84:797e:9076]) by exchhub01.mips.com ([::1]) with mapi id 14.01.0270.001; Tue, 17 Apr 2012 18:10:13 -0700 From: "Fu, Chao-Ying" To: Maxim Kuvyrkov CC: gcc-patches Patches Subject: RE: [PATCH, Android] MIPS support Date: Wed, 18 Apr 2012 01:10:00 -0000 Message-ID: <7C6479EB2BF52547AC332FD6034646DA01448CA91E@exchdb03.mips.com> References: <16285357-1E07-4D60-BD8D-2B2FE796609B@codesourcery.com> <87sjgmm0rt.fsf@talisman.home> <7C6479EB2BF52547AC332FD6034646DA01448C282D@exchdb03.mips.com> <7C6479EB2BF52547AC332FD6034646DA01448C3ABE@exchdb03.mips.com> <7C6479EB2BF52547AC332FD6034646DA01448C3AEF@exchdb03.mips.com> <7C6479EB2BF52547AC332FD6034646DA01448C524E@exchdb03.mips.com> In-Reply-To: x-ems-proccessed: 6LP3oGfGVdcdb8o1aBnt6w== x-ems-stamp: +DdADDAe7MvflWposM0e1A== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2012-04/txt/msg01051.txt.bz2 Maxim Kuvyrkov wrote: > >=20 > >> For now, two MIPS changes in gnu-user.h and=20 > unwind-dw2-fde-dip.c can be posted for comment. > >> (I didn't tested this patch, though.) >=20 > You need to test your patches before posting them for review.=20 > Below are a couple of comments on your current version. I can test if this patch doesn't break existing MIPS Linux GCC build. >=20 > >> After starting to build toolchains for Android with=20 > Bionic, we may find new files to > >> patch. Ex: Comment out getpagesize() for bionic. > >>=20 > >> Any comment? Thanks a lot! > >>=20 > >> Regards, > >> Chao-ying > >>=20 > >> Index: gcc/gcc/config/mips/gnu-user.h > >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > >> --- gcc.orig/gcc/config/mips/gnu-user.h 2012-04-03=20 > 17:39:50.000000000 -0700 > >> +++ gcc/gcc/config/mips/gnu-user.h 2012-04-04=20 > 14:31:50.804236000 -0700 > >> @@ -45,8 +45,8 @@ along with GCC; see the file COPYING3.=20=20 > >> /* A standard GNU/Linux mapping. On most targets, it is=20 > included in > >> CC1_SPEC itself by config/linux.h, but mips.h overrides CC1_SPEC > >> and provides this hook instead. */ > >> -#undef SUBTARGET_CC1_SPEC > >> -#define SUBTARGET_CC1_SPEC "%{profile:-p}" > >> +#undef GNU_USER_SUBTARGET_CC1_SPEC > >> +#define GNU_USER_SUBTARGET_CC1_SPEC "%{profile:-p}" > >>=20 > >> /* -G is incompatible with -KPIC which is the default, so=20 > only allow objects > >> in the small data section if the user explicitly asks for it. */ > >> @@ -54,8 +54,8 @@ along with GCC; see the file COPYING3.=20=20 > >> #define MIPS_DEFAULT_GVALUE 0 > >>=20 > >> /* Borrowed from sparc/linux.h */ > >> -#undef LINK_SPEC > >> -#define LINK_SPEC \ > >> +#undef GNU_USER_TARGET_LINK_SPEC > >> +#define GNU_USER_TARGET_LINK_SPEC \ > >> "%(endian_spec) \ > >> %{shared:-shared} \ > >> %{!shared: \ > >> @@ -89,8 +89,8 @@ along with GCC; see the file COPYING3.=20=20 > >> #undef ASM_OUTPUT_REG_PUSH > >> #undef ASM_OUTPUT_REG_POP > >>=20 > >> -#undef LIB_SPEC > >> -#define LIB_SPEC "\ > >> +#undef GNU_USER_TARGET_LIB_SPEC > >> +#define GNU_USER_TARGET_LIB_SPEC "\ > >> %{pthread:-lpthread} \ > >> %{shared:-lc} \ > >> %{!shared: \ > >> @@ -133,7 +133,34 @@ extern const char *host_detect_local_cpu > >> LINUX_DRIVER_SELF_SPECS > >>=20 > >> /* Similar to standard Linux, but adding -ffast-math support. */ > >> -#undef ENDFILE_SPEC > >> -#define ENDFILE_SPEC \ > >> +#undef GNU_USER_TARGET_ENDFILE_SPEC > >> +#define GNN_USER_TARGET_ENDFILE_SPEC \ > >> "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \ > >> %{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s" >=20 > Above definitions are OK. Thanks! >=20 > >> + > >> +#undef LINK_SPEC > >> +#define LINK_SPEC=09=09=09=09=09=09 > \ > >> + LINUX_OR_ANDROID_LD (GNU_USER_TARGET_LINK_SPEC,=09=09 > \ > >> + GNU_USER_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC) > >> + > >> +#undef SUBTARGET_CC1_SPEC > >> +#define SUBTARGET_CC1_SPEC=09=09=09=09 > \ > >> + LINUX_OR_ANDROID_CC (GNU_USER_SUBTARGET_CC1_SPEC,=09 > \ > >> + GNU_USER_SUBTARGET_CC1_SPEC " " ANDROID_CC1_SPEC) > >> + > >> +#undef CC1PLUS_SPEC > >> +#define CC1PLUS_SPEC=09=09=09=09=09 > \ > >> + LINUX_OR_ANDROID_CC ("", ANDROID_CC1PLUS_SPEC) > >> + > >> +#undef LIB_SPEC > >> +#define LIB_SPEC=09=09=09=09=09=09 > \ > >> + LINUX_OR_ANDROID_LD (GNU_USER_TARGET_LIB_SPEC,=09=09 > \ > >> + GNU_USER_TARGET_LIB_SPEC " " ANDROID_LIB_SPEC) > >> + > >> +#undef STARTFILE_SPEC > >> +#define STARTFILE_SPEC=09=09=09=09=09 > \ > >> + LINUX_OR_ANDROID_LD (GNU_USER_TARGET_STARTFILE_SPEC,=20 > ANDROID_STARTFILE_SPEC) > >> + > >> +#undef ENDFILE_SPEC > >> +#define ENDFILE_SPEC=09=09=09=09=09 > \ > >> + LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC,=20 > ANDROID_ENDFILE_SPEC) >=20 > The LINUX_OR_ANDROID_* definitions should be moved out of=20 > gnu-user.h, as this header is used for systems besides Linux,=20 > e.g., kFreeBSD and Hurd. Please move these definitions to=20 > mips/linux-common.h, which will be a new file, similarly as=20 > i386 did in http://gcc.gnu.org/ml/gcc-patches/2012-04/msg00944.html . I will check this message. >=20 > >> Index: gcc/libgcc/unwind-dw2-fde-dip.c > >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > >> --- gcc.orig/libgcc/unwind-dw2-fde-dip.c 2012-04-03=20 > 17:07:28.000000000 -0700 > >> +++ gcc/libgcc/unwind-dw2-fde-dip.c 2012-04-04=20 > 14:51:01.338074000 -0700 > >> @@ -48,8 +48,9 @@ > >> #include "gthr.h" > >>=20 > >> #if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \ > >> - && (__GLIBC__ > 2 || (__GLIBC__ =3D=3D 2 && __GLIBC_MINOR__ > 2) \ > >> - || (__GLIBC__ =3D=3D 2 && __GLIBC_MINOR__ =3D=3D 2 &&=20 > defined(DT_CONFIG))) > >> + && ((defined(__BIONIC__) && (defined(mips) ||=20 > defined(__mips__))) \ > >> + || (__GLIBC__ > 2 || (__GLIBC__ =3D=3D 2 &&=20 > __GLIBC_MINOR__ > 2) \ > >> + || (__GLIBC__ =3D=3D 2 && __GLIBC_MINOR__ =3D=3D 2 &&=20 > defined(DT_CONFIG)))) > >> # define USE_PT_GNU_EH_FRAME > >> #endif >=20 > What is this change for? For stack unwinding, MIPS needs supporting functions in libgcc to=20 work with eh_frame for Android. (Note that ARM has its own unwinding functions in gcc/config/arm/. It does= n't use eh_frame.) The file is enabled for GLIBC originally. Thus, I add a new test to enable= it for MIPS Android BIONIC build. Thanks! Regards, Chao-ying