linux cross compiler doesn't work on darwin
Geoff Keating
geoffk@geoffk.org
Fri Jul 26 22:22:00 GMT 2002
Stan Shebs <shebs@apple.com> writes:
> 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 <mrs@apple.com>
> >
> > * 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.
This is OK.
> 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=
>
>
--
- Geoffrey Keating <geoffk@geoffk.org> <geoffk@redhat.com>
More information about the Gcc-patches
mailing list