configure.in (enable-shared): New.

* configure.in (enable-shared): New.
        * Makefile.in (LIBGCC_DEPS): Depend on EXTRA_PARTS as well.
        (libgcc.mk): Pass SHLIB_LINK, SHLIB_LIBS, SHLIB_MULTILIB to mklibgcc.
        * mklibgcc.in: Use them to link shared a libgcc.
        * config/t-linux (SHLIB_LINK, SHLIB_LIBS): New.
        * config/alpha/t-ieee (SHLIB_MULTILIB): New.
        * config/mips/t-iris6 (SHLIB_LINK, SHLIB_LIBS): New.
        * config/sparc/t-sol2 (SHLIB_LINK, SHLIB_LIBS): New.

        * configure.in (alpha-osf*): Use t-osf and x-osf.
        * config/alpha/t-osf: New file.
        * config/alpha/t-osf4: New file.
        * config/alpha/x-osf: New file.
        * config/alpha/x-alpha: Remove file.

From-SVN: r36715
This commit is contained in:
Richard Henderson 2000-10-04 13:53:29 -07:00 committed by Richard Henderson
parent 4b606faf44
commit 50503ac83d
13 changed files with 380 additions and 249 deletions

View File

@ -1,3 +1,20 @@
2000-10-04 Richard Henderson <rth@cygnus.com>
* configure.in (enable-shared): New.
* Makefile.in (LIBGCC_DEPS): Depend on EXTRA_PARTS as well.
(libgcc.mk): Pass SHLIB_LINK, SHLIB_LIBS, SHLIB_MULTILIB to mklibgcc.
* mklibgcc.in: Use them to link shared a libgcc.
* config/t-linux (SHLIB_LINK, SHLIB_LIBS): New.
* config/alpha/t-ieee (SHLIB_MULTILIB): New.
* config/mips/t-iris6 (SHLIB_LINK, SHLIB_LIBS): New.
* config/sparc/t-sol2 (SHLIB_LINK, SHLIB_LIBS): New.
* configure.in (alpha-osf*): Use t-osf and x-osf.
* config/alpha/t-osf: New file.
* config/alpha/t-osf4: New file.
* config/alpha/x-osf: New file.
* config/alpha/x-alpha: Remove file.
2000-10-04 Will Cohen <wcohen@redhat.com>
* c-typeck.c (process_init_element): Added warning for zero-length

View File

@ -969,6 +969,9 @@ libgcc.mk: config.status Makefile mklibgcc $(LIB2ADD) xgcc$(exeext)
DPBIT_FUNCS='$(DPBIT_FUNCS)' \
MULTILIBS=`$(GCC_FOR_TARGET) --print-multi-lib` \
EXTRA_MULTILIB_PARTS='$(EXTRA_MULTILIB_PARTS)' \
SHLIB_LINK='$(SHLIB_LINK)' \
SHLIB_LIBS='$(SHLIB_LIBS)' \
SHLIB_MULTILIB='$(SHLIB_MULTILIB)' \
$(SHELL) mklibgcc > tmp-libgcc.mk
mv tmp-libgcc.mk libgcc.mk
@ -976,7 +979,7 @@ libgcc.mk: config.status Makefile mklibgcc $(LIB2ADD) xgcc$(exeext)
LIBGCC_DEPS = $(GCC_PASSES) $(LANGUAGES) stmp-int-hdrs $(STMP_FIXPROTO) \
libgcc.mk $(srcdir)/libgcc1.c $(srcdir)/libgcc2.c $(CONFIG_H) \
$(MACHMODE_H) longlong.h frame.h gbl-ctors.h config.status \
stmp-int-hdrs tsystem.h $(FPBIT) $(DPBIT) $(LIB2ADD)
stmp-int-hdrs tsystem.h $(FPBIT) $(DPBIT) $(LIB2ADD) $(EXTRA_PARTS)
libgcc.a: $(LIBGCC_DEPS)
$(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \

View File

@ -1,6 +1,7 @@
# All alphas get an IEEE complaint set of libraries.
MULTILIB_OPTIONS = mieee
MULTILIB_DIRNAMES = ieee
SHLIB_MULTILIB = ieee
LIBGCC = stmp-multilib
INSTALL_LIBGCC = install-multilib

6
gcc/config/alpha/t-osf Normal file
View File

@ -0,0 +1,6 @@
# Do not build libgcc1. Let gcc generate those functions.
LIBGCC1 =
CROSS_LIBGCC1 =
LIBGCC1_TEST =
EXTRA_HEADERS = $(srcdir)/config/alpha/va_list.h

10
gcc/config/alpha/t-osf4 Normal file
View File

@ -0,0 +1,10 @@
# Compile crtbeginS.o and crtendS.o with pic.
CRTSTUFF_T_CFLAGS_S = -fPIC
# Compile libgcc2.a with pic.
TARGET_LIBGCC2_CFLAGS = -fPIC
# Build a shared libgcc library.
SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
-Wl,-msym -Wl,-set_version,gcc.3 -Wl,-soname,@shlib_base_name@.so.0
SHLIB_LIBS = -lc

View File

@ -1,2 +0,0 @@
CLIB=-lmld -lexc
EXTRA_HEADERS = $(srcdir)/config/alpha/va_list.h

1
gcc/config/alpha/x-osf Normal file
View File

@ -0,0 +1 @@
CLIB=-lmld -lexc

View File

@ -18,3 +18,8 @@ INSTALL_LIBGCC = install-multilib
EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o
CRTSTUFF_T_CFLAGS=-g1
# Build a shared libgcc library.
SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
-Wl,-soname,@shlib_base_name@.so.0
SHLIB_LIBS = -lc

View File

@ -28,3 +28,8 @@ $(T)gcrt1.o: $(srcdir)/config/sparc/sol2-c1.asm $(GCC_PASSES)
CRTSTUFF_T_CFLAGS = -fPIC
TARGET_LIBGCC2_CFLAGS = -fPIC
# Build a shared libgcc library.
SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
-Wl,-h,@shlib_base_name@.so.0 -Wl,-z,text -Wl,-z,defs
SHLIB_LIBS = -lc

View File

@ -8,6 +8,13 @@ INSTALL_ASSERT_H =
CRTSTUFF_T_CFLAGS_S = -fPIC
# Compile libgcc2.a with pic.
TARGET_LIBGCC2_CFLAGS = -fPIC
# Build a shared libgcc library.
SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
-Wl,--soname=@shlib_base_name@.so.0
# ??? Do versioning later -- need to figure out how to post-process
# the script and allow for target-specific additions.
# -Wl,--version-script=$(srcdir)/config/ver-glibc.map
SHLIB_LIBS = -lc
# Do not build libgcc1. Let gcc generate those functions. The GNU/Linux
# C library can handle them.

517
gcc/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -319,6 +319,11 @@ AC_ARG_WITH(dwarf2,
dwarf2="$with_dwarf2",
dwarf2=no)
AC_ARG_ENABLE(shared,
[ --disable-shared don't provide a shared libgcc.],
[], [enable_shared=yes])
AC_SUBST(enable_shared)
# Determine the host, build, and target systems
AC_CANONICAL_SYSTEM
@ -812,7 +817,8 @@ changequote([,])dnl
extra_passes="mips-tfile mips-tdump"
fi
use_collect2=yes
tmake_file="alpha/t-alpha alpha/t-ieee"
tmake_file="alpha/t-alpha alpha/t-ieee alpha/t-osf"
xmake_file=alpha/x-osf
case $machine in
*-*-osf1*)
tm_file="${tm_file} alpha/osf.h alpha/osf12.h alpha/osf2or3.h"
@ -824,12 +830,14 @@ changequote([,])dnl
;;
*-*-osf4*)
tm_file="${tm_file} alpha/osf.h"
tmake_file="$tmake_file alpha/t-osf4"
# Some versions of OSF4 (specifically X4.0-9 296.7) have
# a broken tar, so we use cpio instead.
install_headers_dir=install-headers-cpio
;;
*-*-osf5*)
tm_file="${tm_file} alpha/osf.h alpha/osf5.h"
tmake_file="$tmake_file alpha/t-osf4"
;;
esac
case $machine in

View File

@ -23,6 +23,9 @@
# LIBGCC
# MULTILIBS
# EXTRA_MULTILIB_PARTS
# SHLIB_LINK
# SHLIB_LIBS
# SHLIB_MULTILIB
# Make needs VPATH to be literal.
echo 'srcdir = @srcdir@'
@ -49,6 +52,10 @@ EOF
rm -f $tmp
fi
# Disable SHLIB_LINK if shared libgcc not enabled.
if [ "@enable_shared@" = "no" ]; then
SHLIB_LINK=""
fi
# Build lines.
@ -258,6 +265,7 @@ done
for ml in $MULTILIBS; do
dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
libgcc_objs=""
for o in $libgcc1_objs; do
@ -278,6 +286,24 @@ for ml in $MULTILIBS; do
echo ' if $(RANLIB_TEST_FOR_TARGET) ; then' \\
echo ' $(RANLIB_FOR_TARGET)' ${dir}/libgcc.a ';' \\
echo ' else true; fi;'
if [ "$SHLIB_LINK" ]; then
if [ -z "$SHLIB_MULTILIB" ]; then
if [ "$dir" = "." ]; then
shlib_base_name="libgcc_s";
else
shlib_base_name=libgcc_s_`echo $dir | sed s,/,_,g`
fi
echo ""
echo "${dir}/${shlib_base_name}.so: $libgcc_objs"
echo " $SHLIB_LINK $flags -o ${shlib_base_name}.so $libgcc_objs $SHLIB_LIBS" | sed "s/@shlib_base_name@/$shlib_base_name/g"
elif [ "$SHLIB_MULTILIB" = "$dir" ]; then
shlib_base_name="libgcc_s";
echo ""
echo "${shlib_base_name}.so: $libgcc_objs"
echo " $SHLIB_LINK $flags -o ${shlib_base_name}.so $libgcc_objs $SHLIB_LIBS" | sed "s/@shlib_base_name@/$shlib_base_name/g"
fi
fi
done
dirs=libgcc
@ -306,6 +332,23 @@ for ml in $MULTILIBS; do
dirs="$dirs ${dir} libgcc/${dir}"
fi
all="$all ${dir}/libgcc.a"
if [ "$SHLIB_LINK" ]; then
if [ -z "$SHLIB_MULTILIB" ]; then
if [ "$dir" = "." ]; then
suff="";
else
suff=_`echo $dir | sed s,/,_,g`
fi
all="$all ${dir}/libgcc_s${suff}.so"
elif [ "$SHLIB_MULTILIB" = "$dir" ]; then
all="$all libgcc_s.so"
fi
if [ "$dir" = "." ]; then
suff="";
else
suff=_`echo $dir | sed s,/,_,g`
fi
fi
done
echo 'stmp-dirs: force'