public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Problem with some canadian cross builds
@ 2002-08-01 22:16 Daniel Jacobowitz
  2002-08-01 23:07 ` H. J. Lu
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Jacobowitz @ 2002-08-01 22:16 UTC (permalink / raw)
  To: gcc

There's all sorts of configury voodoo going on here, much of which is
suspect, but it boils down to the top level configure.in guessing a name for
$GCC_FOR_TARGET - often incorrectly.  The first place this shows up is in:

# Dump a specs file to make -B./ read these specs over installed ones.
specs: xgcc$(exeext)
        $(GCC_FOR_TARGET) -dumpspecs > tmp-specs
        mv tmp-specs specs

The others I can work around by overriding GCC_FOR_TARGET, but is there some
other way we can get the specs file besides running what we seem to assume
is the built compiler?  If I override GCC_FOR_TARGET I get a completely
different specs file; for instance, one in which *cross_compile is set
differently.


(On a related note, is there any interest in making "make bootstrap" or some
other target build a native compiler and use that to build the canadian
cross compiler?  Otherwise you have to have the _exact_ _same_ GCC version
installed as your cross compiler, or you hit Bad Mojo.  Does this belong in
make bootstrap or elsewhere?)

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer

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

* Re: Problem with some canadian cross builds
  2002-08-01 22:16 Problem with some canadian cross builds Daniel Jacobowitz
@ 2002-08-01 23:07 ` H. J. Lu
  2002-08-01 23:34   ` Momchil Velikov
  2002-08-02  6:29   ` Daniel Jacobowitz
  0 siblings, 2 replies; 6+ messages in thread
From: H. J. Lu @ 2002-08-01 23:07 UTC (permalink / raw)
  To: gcc

On Fri, Aug 02, 2002 at 01:16:50AM -0400, Daniel Jacobowitz wrote:
> There's all sorts of configury voodoo going on here, much of which is
> suspect, but it boils down to the top level configure.in guessing a name for
> $GCC_FOR_TARGET - often incorrectly.  The first place this shows up is in:
> 
> # Dump a specs file to make -B./ read these specs over installed ones.
> specs: xgcc$(exeext)
>         $(GCC_FOR_TARGET) -dumpspecs > tmp-specs
>         mv tmp-specs specs
> 
> The others I can work around by overriding GCC_FOR_TARGET, but is there some
> other way we can get the specs file besides running what we seem to assume
> is the built compiler?  If I override GCC_FOR_TARGET I get a completely
> different specs file; for instance, one in which *cross_compile is set
> differently.
> 

This what I have in my gcc spec file:

%if %{cross_compile}
# Install syslimits.h for canadian cross compile.
pushd $RPM_BUILD_DIR/gcc-3.1-%{DATE}/obj-%{_target_platform}
#pushd $RPM_BUILD_DIR/gcc-%{version}-%{DATE}/obj-%{_target_platform}
cp -af ../gcc/gsyslimits.h $FULLPATH/include/syslimits.h
# Fix the specs file.
cat gcc/specs |
awk '
BEGIN {
  cross=0;
}
/cross_compile/ { print; cross = 1; next; } 
/^1$/ {
  if (cross == 0) {
    print;
  }
  else {
    cross = 0;
    print "0";
  }
  next;
}
{ print; }
' > $FULLPATH/specs
popd
%endif


H.J.

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

* Re: Problem with some canadian cross builds
  2002-08-01 23:07 ` H. J. Lu
@ 2002-08-01 23:34   ` Momchil Velikov
  2002-08-01 23:46     ` H. J. Lu
  2002-08-02  6:29   ` Daniel Jacobowitz
  1 sibling, 1 reply; 6+ messages in thread
From: Momchil Velikov @ 2002-08-01 23:34 UTC (permalink / raw)
  To: H. J. Lu; +Cc: gcc

>>>>> "H. J. Lu" == H J Lu <hjl@lucon.org> writes:
H. J. Lu> This what I have in my gcc spec file:

H. J. Lu> %if %{cross_compile}
H. J. Lu> # Install syslimits.h for canadian cross compile.
H. J. Lu> pushd $RPM_BUILD_DIR/gcc-3.1-%{DATE}/obj-%{_target_platform}
H. J. Lu> #pushd $RPM_BUILD_DIR/gcc-%{version}-%{DATE}/obj-%{_target_platform}
H. J. Lu> cp -af ../gcc/gsyslimits.h $FULLPATH/include/syslimits.h

Which reminds me of this patch, which was either too stupid or simply
went unnoticed.

http://gcc.gnu.org/ml/gcc-patches/2001-03/msg00699.html

~velco

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

* Re: Problem with some canadian cross builds
  2002-08-01 23:34   ` Momchil Velikov
@ 2002-08-01 23:46     ` H. J. Lu
  2002-08-02  0:10       ` Momchil Velikov
  0 siblings, 1 reply; 6+ messages in thread
From: H. J. Lu @ 2002-08-01 23:46 UTC (permalink / raw)
  To: Momchil Velikov; +Cc: gcc

On Fri, Aug 02, 2002 at 09:34:30AM +0300, Momchil Velikov wrote:
> >>>>> "H. J. Lu" == H J Lu <hjl@lucon.org> writes:
> H. J. Lu> This what I have in my gcc spec file:
> 
> H. J. Lu> %if %{cross_compile}
> H. J. Lu> # Install syslimits.h for canadian cross compile.
> H. J. Lu> pushd $RPM_BUILD_DIR/gcc-3.1-%{DATE}/obj-%{_target_platform}
> H. J. Lu> #pushd $RPM_BUILD_DIR/gcc-%{version}-%{DATE}/obj-%{_target_platform}
> H. J. Lu> cp -af ../gcc/gsyslimits.h $FULLPATH/include/syslimits.h
> 
> Which reminds me of this patch, which was either too stupid or simply
> went unnoticed.
> 
> http://gcc.gnu.org/ml/gcc-patches/2001-03/msg00699.html

I don't know if you can use gcc/gsyslimits.h for all platforms.


H.J.

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

* Re: Problem with some canadian cross builds
  2002-08-01 23:46     ` H. J. Lu
@ 2002-08-02  0:10       ` Momchil Velikov
  0 siblings, 0 replies; 6+ messages in thread
From: Momchil Velikov @ 2002-08-02  0:10 UTC (permalink / raw)
  To: H. J. Lu; +Cc: gcc

>>>>> "H. J. Lu" == H J Lu <hjl@lucon.org> writes:

H. J. Lu> On Fri, Aug 02, 2002 at 09:34:30AM +0300, Momchil Velikov wrote:
>> >>>>> "H. J. Lu" == H J Lu <hjl@lucon.org> writes:
>> H. J. Lu> This what I have in my gcc spec file:
>> 
>> H. J. Lu> %if %{cross_compile}
>> H. J. Lu> # Install syslimits.h for canadian cross compile.
>> H. J. Lu> pushd $RPM_BUILD_DIR/gcc-3.1-%{DATE}/obj-%{_target_platform}
>> H. J. Lu> #pushd $RPM_BUILD_DIR/gcc-%{version}-%{DATE}/obj-%{_target_platform}
>> H. J. Lu> cp -af ../gcc/gsyslimits.h $FULLPATH/include/syslimits.h
>> 
>> Which reminds me of this patch, which was either too stupid or simply
>> went unnoticed.
>> 
>> http://gcc.gnu.org/ml/gcc-patches/2001-03/msg00699.html

H. J. Lu> I don't know if you can use gcc/gsyslimits.h for all platforms.

#define _GCC_NEXT_LIMITS_H		/* tell gcc's limits.h to recurse */
#include_next <limits.h>
#undef _GCC_NEXT_LIMITS_H

What would be the problem ?

~velco

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

* Re: Problem with some canadian cross builds
  2002-08-01 23:07 ` H. J. Lu
  2002-08-01 23:34   ` Momchil Velikov
@ 2002-08-02  6:29   ` Daniel Jacobowitz
  1 sibling, 0 replies; 6+ messages in thread
From: Daniel Jacobowitz @ 2002-08-02  6:29 UTC (permalink / raw)
  To: H. J. Lu; +Cc: gcc

On Thu, Aug 01, 2002 at 11:07:46PM -0700, H. J. Lu wrote:
> On Fri, Aug 02, 2002 at 01:16:50AM -0400, Daniel Jacobowitz wrote:
> > There's all sorts of configury voodoo going on here, much of which is
> > suspect, but it boils down to the top level configure.in guessing a name for
> > $GCC_FOR_TARGET - often incorrectly.  The first place this shows up is in:
> > 
> > # Dump a specs file to make -B./ read these specs over installed ones.
> > specs: xgcc$(exeext)
> >         $(GCC_FOR_TARGET) -dumpspecs > tmp-specs
> >         mv tmp-specs specs
> > 
> > The others I can work around by overriding GCC_FOR_TARGET, but is there some
> > other way we can get the specs file besides running what we seem to assume
> > is the built compiler?  If I override GCC_FOR_TARGET I get a completely
> > different specs file; for instance, one in which *cross_compile is set
> > differently.
> > 
> 
> This what I have in my gcc spec file:
> 
> %if %{cross_compile}
> # Install syslimits.h for canadian cross compile.
> pushd $RPM_BUILD_DIR/gcc-3.1-%{DATE}/obj-%{_target_platform}
> #pushd $RPM_BUILD_DIR/gcc-%{version}-%{DATE}/obj-%{_target_platform}
> cp -af ../gcc/gsyslimits.h $FULLPATH/include/syslimits.h
> # Fix the specs file.
> cat gcc/specs |
> awk '
> BEGIN {
>   cross=0;
> }
> /cross_compile/ { print; cross = 1; next; } 
> /^1$/ {
>   if (cross == 0) {
>     print;
>   }
>   else {
>     cross = 0;
>     print "0";
>   }
>   next;
> }
> { print; }
> ' > $FULLPATH/specs
> popd
> %endif

Yup, I have almost the same.  But every once in a while I actually try
to build one by hand, and I forget about this - I shouldn't have to
fudge this sort of thing.

> 
> 
> H.J.
> 

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer

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

end of thread, other threads:[~2002-08-02 13:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-01 22:16 Problem with some canadian cross builds Daniel Jacobowitz
2002-08-01 23:07 ` H. J. Lu
2002-08-01 23:34   ` Momchil Velikov
2002-08-01 23:46     ` H. J. Lu
2002-08-02  0:10       ` Momchil Velikov
2002-08-02  6:29   ` Daniel Jacobowitz

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