From patchwork Mon Apr 11 20:11:08 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 90644 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 830A8B6F05 for ; Tue, 12 Apr 2011 06:11:23 +1000 (EST) Received: (qmail 14006 invoked by alias); 11 Apr 2011 20:11:19 -0000 Received: (qmail 13998 invoked by uid 22791); 11 Apr 2011 20:11:17 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, TW_XG, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 11 Apr 2011 20:11:10 +0000 Received: (qmail 19375 invoked from network); 11 Apr 2011 20:11:09 -0000 Received: from unknown (HELO digraph.polyomino.org.uk) (joseph@127.0.0.2) by mail.codesourcery.com with ESMTPA; 11 Apr 2011 20:11:09 -0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.72) (envelope-from ) id 1Q9NS0-0000s4-Ja; Mon, 11 Apr 2011 20:11:08 +0000 Date: Mon, 11 Apr 2011 20:11:08 +0000 (UTC) From: "Joseph S. Myers" To: gcc-patches@gcc.gnu.org, rmh@gnu.org cc: rth@redhat.com, jh@suse.cz, ubizjak@gmail.com Subject: Clean up k*gnu configurations Message-ID: MIME-Version: 1.0 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Now that gnu-user*.h and linux*.h config headers have more or less the proper contents, the next stage in stopping non-Linux-kernel-based targets from using linux*.h is to get the correct contents into the headers for the non-Linux-kernel-based targets. This patch (partly based on changes and information from Robert Millan) does so for the k*gnu targets. GNU_USER_LINK_EMULATION should bd defined for all these targets, GNU_USER_DYNAMIC_LINKER32 and GNU_USER_DYNAMIC_LINKER64 should be defined for x86_64-kfreebsd-gnu and MD_UNWIND_SUPPORT should be undefined instead of defining REG_NAME because linux-unwind.h is, as previously discussed, inappropriate for these targets (it is specific to the Linux kernel's signal frames and syscall numbers). This patch does not do anything about GNU_USER_LINK_EMULATION for x86_64-kfreebsd-gnu; my inclination is that the correct fix there is to make i386/gnu-user64.h use GNU_USER_LINK_EMULATION32 and GNU_USER_LINK_EMULATION64, which would then be defined by individual targets' headers. Tested building cc1 and xgcc for crosses to: i686-kfreebsd-gnu i686-knetbsd-gnu i686-kopensolaris-gnu x86_64-kfreebsd-gnu. OK to commit? (Note there are no target OS maintainers for these targets.) 2011-04-11 Joseph Myers Robert Millan * config.gcc (x86_64-*-kfreebsd*-gnu): Use i386/kfreebsd-gnu.h. * config/i386/kfreebsd-gnu.h (GNU_USER_DYNAMIC_LINKER32, GNU_USER_DYNAMIC_LINKER64): Define. (REG_NAME): Don't undefine. (MD_UNWIND_SUPPORT): Undefine. * config/i386/knetbsd-gnu.h (GNU_USER_LINK_EMULATION): Define. (REG_NAME): Don't undefine. (MD_UNWIND_SUPPORT): Undefine. * config/i386/kopensolaris-gnu.h (GNU_USER_LINK_EMULATION): Define. Index: gcc/config.gcc =================================================================== --- gcc/config.gcc (revision 172273) +++ gcc/config.gcc (working copy) @@ -1243,7 +1243,7 @@ x86_64-*-linux* | x86_64-*-kfreebsd*-gnu case ${target} in x86_64-*-linux*) default_gnu_indirect_function=glibc-2011 ;; - x86_64-*-kfreebsd*-gnu) tm_file="${tm_file} kfreebsd-gnu.h" ;; + x86_64-*-kfreebsd*-gnu) tm_file="${tm_file} kfreebsd-gnu.h i386/kfreebsd-gnu.h" ;; x86_64-*-knetbsd*-gnu) tm_file="${tm_file} knetbsd-gnu.h" ;; esac tmake_file="${tmake_file} i386/t-linux64 i386/t-crtstuff i386/t-crtpc i386/t-crtfm t-dfprules" Index: gcc/config/i386/kopensolaris-gnu.h =================================================================== --- gcc/config/i386/kopensolaris-gnu.h (revision 172273) +++ gcc/config/i386/kopensolaris-gnu.h (working copy) @@ -1,5 +1,5 @@ /* Definitions for Intel 386 running kOpenSolaris-based GNU systems with ELF format - Copyright (C) 2009 + Copyright (C) 2009, 2011 Free Software Foundation, Inc. Contributed by Robert Millan. @@ -19,4 +19,6 @@ You should have received a copy of the G along with GCC; see the file COPYING3. If not see . */ +#define GNU_USER_LINK_EMULATION "elf_i386" + #undef MD_UNWIND_SUPPORT Index: gcc/config/i386/kfreebsd-gnu.h =================================================================== --- gcc/config/i386/kfreebsd-gnu.h (revision 172273) +++ gcc/config/i386/kfreebsd-gnu.h (working copy) @@ -21,5 +21,11 @@ along with GCC; see the file COPYING3. #undef GNU_USER_LINK_EMULATION #define GNU_USER_LINK_EMULATION "elf_i386_fbsd" -#undef REG_NAME -#define REG_NAME(reg) sc_ ## reg + +#undef GNU_USER_DYNAMIC_LINKER32 +#define GNU_USER_DYNAMIC_LINKER32 "/lib/ld.so.1" + +#undef GNU_USER_DYNAMIC_LINKER64 +#define GNU_USER_DYNAMIC_LINKER64 "/lib/ld-kfreebsd-x86-64.so.1" + +#undef MD_UNWIND_SUPPORT Index: gcc/config/i386/knetbsd-gnu.h =================================================================== --- gcc/config/i386/knetbsd-gnu.h (revision 172273) +++ gcc/config/i386/knetbsd-gnu.h (working copy) @@ -1,5 +1,5 @@ /* Definitions for Intel 386 running kNetBSD-based GNU systems with ELF format - Copyright (C) 2004, 2007 + Copyright (C) 2004, 2007, 2011 Free Software Foundation, Inc. Contributed by Robert Millan. @@ -19,5 +19,6 @@ You should have received a copy of the G along with GCC; see the file COPYING3. If not see . */ -#undef REG_NAME -#define REG_NAME(reg) sc_ ## reg +#define GNU_USER_LINK_EMULATION "elf_i386" + +#undef MD_UNWIND_SUPPORT