public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* linux cross compiler doesn't work on darwin
@ 2002-07-26 16:50 Mike Stump
  2002-07-26 17:39 ` Stan Shebs
  0 siblings, 1 reply; 6+ messages in thread
From: Mike Stump @ 2002-07-26 16:50 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 598 bytes --]

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.


[-- Attachment #2: to-gcc-1.diffs --]
[-- Type: application/octet-stream, Size: 660 bytes --]

2002-07-26  Mike Stump  <mrs@apple.com>

	* config.gcc (config_gtfiles): Initialize.

Index: config.gcc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config.gcc,v
retrieving revision 1.226
diff -c -p -r1.226 config.gcc
*** config.gcc	25 Jul 2002 02:51:30 -0000	1.226
--- config.gcc	26 Jul 2002 22:18:09 -0000
*************** gdb_needs_out_file_path=
*** 208,213 ****
--- 208,214 ----
  exeext=
  # Set this to control which thread package will be used.
  thread_file=
+ config_gtfiles=
  # Reinitialize these from the flag values every loop pass, since some
  # configure entries modify them.
  gas="$gas_flag"

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: linux cross compiler doesn't work on darwin
  2002-07-26 16:50 linux cross compiler doesn't work on darwin Mike Stump
@ 2002-07-26 17:39 ` Stan Shebs
  2002-07-26 18:56   ` Mike Stump
                     ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Stan Shebs @ 2002-07-26 17:39 UTC (permalink / raw)
  To: Mike Stump; +Cc: gcc-patches

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.

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=


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: linux cross compiler doesn't work on darwin
  2002-07-26 17:39 ` Stan Shebs
@ 2002-07-26 18:56   ` Mike Stump
  2002-07-26 22:22   ` Geoff Keating
  2002-07-29 11:05   ` Mike Stump
  2 siblings, 0 replies; 6+ messages in thread
From: Mike Stump @ 2002-07-26 18:56 UTC (permalink / raw)
  To: Stan Shebs; +Cc: gcc-patches

On Friday, July 26, 2002, at 05:02 PM, Stan Shebs wrote:

> 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.

Ah, yes, that is cleaner and better, as then it is obvious how to add 
build only or host only gt files.  I look forward to seeing your patch 
in the tree.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: linux cross compiler doesn't work on darwin
  2002-07-26 17:39 ` Stan Shebs
  2002-07-26 18:56   ` Mike Stump
@ 2002-07-26 22:22   ` Geoff Keating
  2002-07-29 11:05   ` Mike Stump
  2 siblings, 0 replies; 6+ messages in thread
From: Geoff Keating @ 2002-07-26 22:22 UTC (permalink / raw)
  To: Stan Shebs; +Cc: gcc-patches

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>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: linux cross compiler doesn't work on darwin
  2002-07-26 17:39 ` Stan Shebs
  2002-07-26 18:56   ` Mike Stump
  2002-07-26 22:22   ` Geoff Keating
@ 2002-07-29 11:05   ` Mike Stump
  2002-07-29 11:09     ` Stan Shebs
  2 siblings, 1 reply; 6+ messages in thread
From: Mike Stump @ 2002-07-29 11:05 UTC (permalink / raw)
  To: Stan Shebs; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 530 bytes --]

On Friday, July 26, 2002, at 05:02 PM, Stan Shebs wrote:

>> With the below magic incantation darwin can host a linux targeted 
>> compiler.  Without the patch, nothing links due to unresolved 
>> externals

> Sorry, I had a different solution to the problem a couple days ago, 
> but have
> been distracted by our little sibcall hell... :-)

Your solution to the problem neglected to actually solve the problem.  
:-(

I had assumed that it had, sorry for missing that the first time `round.

I applied the below obvious patch.


[-- Attachment #2: to-gcc-2.diffs --]
[-- Type: application/octet-stream, Size: 1169 bytes --]

Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ChangeLog,v
retrieving revision 1.14992
retrieving revision 1.14993
diff -c -p -r1.14992 -r1.14993
*** ChangeLog	29 Jul 2002 12:41:43 -0000	1.14992
--- ChangeLog	29 Jul 2002 17:25:27 -0000	1.14993
***************
*** 1,3 ****
--- 1,8 ----
+ 2002-07-29  Mike Stump  <mrs@apple.com>
+ 
+ 	* config.gcc (target_gtfiles): Initialize, as otherwise cross compilers hosted on
+ 	powerpc-apple-darwin6.0 won't even build.
+ 
  2002-07-29  Richard Earnshaw  <rearnsha@arm.com>
  
  	* arm.md (sibcall, sibcall_value): Add RETURN as part of the pattern,
Index: config.gcc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config.gcc,v
retrieving revision 1.227
retrieving revision 1.228
diff -c -p -r1.227 -r1.228
*** config.gcc	27 Jul 2002 20:54:52 -0000	1.227
--- config.gcc	29 Jul 2002 17:25:30 -0000	1.228
*************** thread_file=
*** 215,220 ****
--- 215,221 ----
  gas="$gas_flag"
  gnu_ld="$gnu_ld_flag"
  enable_threads=$enable_threads_flag
+ target_gtfiles=
  
  # Obsolete configurations.
  case $machine in

[-- Attachment #3: Type: text/plain, Size: 1 bytes --]



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: linux cross compiler doesn't work on darwin
  2002-07-29 11:05   ` Mike Stump
@ 2002-07-29 11:09     ` Stan Shebs
  0 siblings, 0 replies; 6+ messages in thread
From: Stan Shebs @ 2002-07-29 11:09 UTC (permalink / raw)
  To: Mike Stump; +Cc: gcc-patches

Mike Stump wrote:

> On Friday, July 26, 2002, at 05:02 PM, Stan Shebs wrote:
>
>>> With the below magic incantation darwin can host a linux targeted 
>>> compiler.  Without the patch, nothing links due to unresolved externals
>>
>
>> Sorry, I had a different solution to the problem a couple days ago, 
>> but have
>> been distracted by our little sibcall hell... :-)
>
>
> Your solution to the problem neglected to actually solve the problem.  :-(
>
> I had assumed that it had, sorry for missing that the first time `round.
>
> I applied the below obvious patch.

Ooops, thanks - I had a moment of doubt when checking it in, must
have scrambled when "cleaning up".  The clearing of target_gtfiles
in configure.in can probably go away now too.

Stan

>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2002-07-29 18:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-26 16:50 linux cross compiler doesn't work on darwin Mike Stump
2002-07-26 17:39 ` Stan Shebs
2002-07-26 18:56   ` Mike Stump
2002-07-26 22:22   ` Geoff Keating
2002-07-29 11:05   ` Mike Stump
2002-07-29 11:09     ` Stan Shebs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).