Discussion:
Problem with some canadian cross builds
Daniel Jacobowitz
2002-08-02 05:16:50 UTC
Permalink
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
H. J. Lu
2002-08-02 06:07:46 UTC
Permalink
Post by Daniel Jacobowitz
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
# 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.
Momchil Velikov
2002-08-02 06:34:30 UTC
Permalink
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
H. J. Lu
2002-08-02 06:46:38 UTC
Permalink
Post by Momchil Velikov
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.
Momchil Velikov
2002-08-02 07:10:25 UTC
Permalink
Post by Momchil Velikov
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
Daniel Jacobowitz
2002-08-02 13:28:59 UTC
Permalink
Post by H. J. Lu
Post by Daniel Jacobowitz
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
# 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.
%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.
Post by H. J. Lu
H.J.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
Continue reading on narkive:
Loading...