Committed, libgloss/cris/Makefile.in: copy built files to newlib for libgfortran failure
Hans-Peter Nilsson
hans-peter.nilsson@axis.com
Tue Feb 1 21:23:00 GMT 2005
(CC to fortran@gcc.gnu.org as a FYI; you may see related PR:s.)
This patch unbreaks build of libgfortran for cris-axis-elf. The
problem is described in the comment below. An IMHO better,
long-term-fix, would be to have a mechanism that enables each library
to add a -B option to the top-level target gcc invocation. And of
course, libraries that don't use link tests. (Perhaps each library
could put one in a file in its subdir, named target-gcc-options, and
toplevel would do find with cat on subdirs in order of dependency.)
Before, you got:
checking whether /home/hp/builds2/crisf/gcc/gfortran -B/home/hp/builds2/crisf/gcc/ -nostdinc -B/home/hp/builds2/crisf/cris-elf/n\
ewlib/ -isystem /home/hp/builds2/crisf/cris-elf/newlib/targ-include -isystem /home/hp/cvs_areas/combined/cvs_write/newlib/libc/in\
clude -B/home/hp/work/axis/build/cris-elf-prefix/cris-elf/bin/ -B/home/hp/work/axis/build/cris-elf-prefix/cris-elf/lib/ -isystem \
/home/hp/work/axis/build/cris-elf-prefix/cris-elf/include -isystem /home/hp/work/axis/build/cris-elf-prefix/cris-elf/sys-include \
-L/home/hp/builds2/crisf/ld accepts -g... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for _LARGE_FILES value needed for large files... no
checking for off_t... yes
checking for ANSI C header files... no
checking stdlib.h usability... yes
checking stdlib.h presence... no
configure: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!
configure: WARNING: stdlib.h: proceeding with the compiler's result
checking for stdlib.h... yes
checking stdio.h usability... yes
checking stdio.h presence... no
configure: WARNING: stdio.h: accepted by the compiler, rejected by the preprocessor!
configure: WARNING: stdio.h: proceeding with the compiler's result
checking for stdio.h... yes
(repeats of the last few lines for different header files, then:)
checking for complex.h... no
checking for struct stat.st_blksize... yes
checking for struct stat.st_blocks... yes
checking for struct stat.st_rdev... yes
checking for csin in -lm... configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES.
make: *** [configure-target-libgfortran] Error 1
Now, build including libgfortran succeeds. I don't get the strange
warnings either anymore; I don't know what strange side-effect-path
caused them to appear.
libgloss:
* cris/Makefile.in (ALL_INSTALL_FILES): New macro.
(ALL_INSTALL_FILES_NEWLIB_COPY): New macro.
(all): Use ALL_INSTALL_FILES instead of its contents. Add
ALL_INSTALL_FILES_NEWLIB_COPY.
($(objroot)/newlib/%, $(objroot)/newlib/libnosys.a): New rules
Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/libgloss/cris/Makefile.in,v
retrieving revision 1.1
diff -p -c -r1.1 Makefile.in
*** Makefile.in 27 Jan 2005 22:57:32 -0000 1.1
--- Makefile.in 1 Feb 2005 17:53:49 -0000
*************** BSP_SCRIPTS =
*** 91,104 ****
BSP_TEST =
BSP_INSTALL = install-bsp
# Host specific makefile fragment comes in here.
@host_makefile_frag@
# Need to augment the definition from host_makefile_frag above.
INCLUDES += -I$(srcdir)
! all: ${SIM_CRT0} ${LIN_CRT0} ${BSP_CRT0} ${SIM_BSP} ${LIN_BSP} ${BSP_BSP} \
! libnosys.a ${LIN_EXTRA}
#
# Here's where we build the board support packages for each target.
--- 91,111 ----
BSP_TEST =
BSP_INSTALL = install-bsp
+ ALL_INSTALL_FILES = \
+ ${SIM_CRT0} ${SIM_EXTRA} ${SIM_BSP} \
+ ${LIN_CRT0} ${LIN_EXTRA} ${LIN_BSP} \
+ ${BSP_CRT0} ${BSP_EXTRA} ${BSP_BSP}
+
+ ALL_INSTALL_FILES_NEWLIB_COPY = \
+ $(sort ${ALL_INSTALL_FILES:%=$(objroot)/newlib/%}) $(objroot)/newlib/libnosys.a
+
# Host specific makefile fragment comes in here.
@host_makefile_frag@
# Need to augment the definition from host_makefile_frag above.
INCLUDES += -I$(srcdir)
! all: ${ALL_INSTALL_FILES} ${ALL_INSTALL_FILES_NEWLIB_COPY} libnosys.a
#
# Here's where we build the board support packages for each target.
*************** ${LIN_BSP}: ${LIN_OBJS}
*** 122,127 ****
--- 129,150 ----
libnosys.a:
ln -s ../libnosys/libnosys.a
+ # Toplevel build rules for various other libraries have gcc -B options
+ # applied so the newlib build directory is reached, but not the target
+ # libgloss directory (whose name is unknown to the toplevel configury
+ # anyway). Configury tests that check for a successful link therefore
+ # fail; they can't find crt0.o and non-libc.a+libm.a libraries. We copy
+ # over all files we would install to the neighboring newlib directory.
+ # Only the default crt0.o and libraries are needed, but we do them all for
+ # completeness. They're however installed from here, not from the newlib
+ # build directory.
+ $(objroot)/newlib/%: %
+ cp -p $^ $@
+
+ # This rule, being more specific, overrides the pattern rule above.
+ $(objroot)/newlib/libnosys.a:
+ ln -s ../libgloss/libnosys/libnosys.a $(objroot)/newlib
+
#
# Build a test program for each target board. Just trying to get
# it to link is a good test, so we ignore all the errors for now.
brgds, H-P
More information about the Newlib
mailing list