From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2270 invoked by alias); 27 Jul 2002 00:03:58 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 2263 invoked from network); 27 Jul 2002 00:03:57 -0000 Received: from unknown (HELO mail-out2.apple.com) (17.254.0.51) by sources.redhat.com with SMTP; 27 Jul 2002 00:03:57 -0000 Received: from mailgate1.apple.com (A17-128-100-225.apple.com [17.128.100.225]) by mail-out2.apple.com (8.11.3/8.11.3) with ESMTP id g6R03uA10258 for ; Fri, 26 Jul 2002 17:03:56 -0700 (PDT) Received: from scv1.apple.com (scv1.apple.com) by mailgate1.apple.com (Content Technologies SMTPRS 4.2.1) with ESMTP id for ; Fri, 26 Jul 2002 17:03:17 -0700 Received: from apple.com (vpn-scv-x3-71.apple.com [17.219.194.71]) by scv1.apple.com (8.11.3/8.11.3) with ESMTP id g6R03tl18170; Fri, 26 Jul 2002 17:03:55 -0700 (PDT) Message-ID: <3D41E32E.4010100@apple.com> Date: Fri, 26 Jul 2002 17:39:00 -0000 From: Stan Shebs User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US; rv:0.9.4.1) Gecko/20020508 Netscape6/6.2.3 X-Accept-Language: en-us MIME-Version: 1.0 To: Mike Stump CC: gcc-patches@gcc.gnu.org Subject: Re: linux cross compiler doesn't work on darwin References: <33652629-A0EB-11D6-B575-003065A77310@apple.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-07/txt/msg01598.txt.bz2 Mike Stump wrote: > With the below magic incantation darwin can host a linux targeted > compiler. Without the patch, nothing links due to unresolved > externals (for the config_gtfiles, darwin.c in my case): > > ld: Undefined symbols: > _gt_ggc_r_gt_darwin_h > make: *** [cc1plus] Error 1 > > Tested on powerpc-darwin6.0 and on a powerpc-darwin6.0 X > i586-pc-linux-gnu by comparing the generated Makefile, and ensuring > they were right, and by ensuring the cc1plus built. I contemplated > checking this in as obvious, but decided against it. > > 2002-07-26 Mike Stump > > * config.gcc (config_gtfiles): Initialize. > Sorry, I had a different solution to the problem a couple days ago, but have been distracted by our little sibcall hell... :-) The problem is that config_gtfiles is accumulating files irrespective of host/target, and darwin.c should only be added if it's a target. So this patch makes it a target-only thing (no host files with trees to track so far). If everybody agrees that this is the way to go, I'll put it in. Stan Index: config.gcc =================================================================== RCS file: /cvs/gcc/gcc/gcc/config.gcc,v retrieving revision 1.226 diff -p -r1.226 config.gcc *** config.gcc 25 Jul 2002 02:51:30 -0000 1.226 --- config.gcc 27 Jul 2002 00:00:14 -0000 *************** powerpc-*-darwin*) *** 1989,1995 **** tm_p_file="${tm_p_file} darwin-protos.h" tmake_file=rs6000/t-darwin extra_objs="darwin.o" ! config_gtfiles="${config_gtfiles} \$(srcdir)/config/darwin.c" c_target_objs="darwin-c.o" cxx_target_objs="darwin-c.o" # Darwin linker does collect2 functionality --- 2001,2007 ---- tm_p_file="${tm_p_file} darwin-protos.h" tmake_file=rs6000/t-darwin extra_objs="darwin.o" ! target_gtfiles="\$(srcdir)/config/darwin.c" c_target_objs="darwin-c.o" cxx_target_objs="darwin-c.o" # Darwin linker does collect2 functionality Index: configure.in =================================================================== RCS file: /cvs/gcc/gcc/gcc/configure.in,v retrieving revision 1.610 diff -p -r1.610 configure.in *** configure.in 14 Jul 2002 01:59:13 -0000 1.610 --- configure.in 27 Jul 2002 00:00:14 -0000 *************** objext='.o' *** 731,737 **** AC_SUBST(manext) AC_SUBST(objext) ! config_gtfiles= build_xm_file= build_xm_defines= build_install_headers_dir=install-headers-tar --- 731,737 ---- AC_SUBST(manext) AC_SUBST(objext) ! target_gtfiles= build_xm_file= build_xm_defines= build_install_headers_dir=install-headers-tar *************** all_outputs='Makefile intl/Makefile fixi *** 2407,2413 **** # List of language makefile fragments. all_lang_makefiles= # Files for gengtype ! all_gtfiles="$config_gtfiles" # Files for gengtype with language all_gtfiles_files_langs= all_gtfiles_files_files= --- 2407,2413 ---- # List of language makefile fragments. all_lang_makefiles= # Files for gengtype ! all_gtfiles="$target_gtfiles" # Files for gengtype with language all_gtfiles_files_langs= all_gtfiles_files_files=