Commit 50503ac8 by Richard Henderson Committed by Richard Henderson

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
parent 4b606faf
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> 2000-10-04 Will Cohen <wcohen@redhat.com>
* c-typeck.c (process_init_element): Added warning for zero-length * c-typeck.c (process_init_element): Added warning for zero-length
......
...@@ -969,6 +969,9 @@ libgcc.mk: config.status Makefile mklibgcc $(LIB2ADD) xgcc$(exeext) ...@@ -969,6 +969,9 @@ libgcc.mk: config.status Makefile mklibgcc $(LIB2ADD) xgcc$(exeext)
DPBIT_FUNCS='$(DPBIT_FUNCS)' \ DPBIT_FUNCS='$(DPBIT_FUNCS)' \
MULTILIBS=`$(GCC_FOR_TARGET) --print-multi-lib` \ MULTILIBS=`$(GCC_FOR_TARGET) --print-multi-lib` \
EXTRA_MULTILIB_PARTS='$(EXTRA_MULTILIB_PARTS)' \ EXTRA_MULTILIB_PARTS='$(EXTRA_MULTILIB_PARTS)' \
SHLIB_LINK='$(SHLIB_LINK)' \
SHLIB_LIBS='$(SHLIB_LIBS)' \
SHLIB_MULTILIB='$(SHLIB_MULTILIB)' \
$(SHELL) mklibgcc > tmp-libgcc.mk $(SHELL) mklibgcc > tmp-libgcc.mk
mv tmp-libgcc.mk libgcc.mk mv tmp-libgcc.mk libgcc.mk
...@@ -976,7 +979,7 @@ libgcc.mk: config.status Makefile mklibgcc $(LIB2ADD) xgcc$(exeext) ...@@ -976,7 +979,7 @@ libgcc.mk: config.status Makefile mklibgcc $(LIB2ADD) xgcc$(exeext)
LIBGCC_DEPS = $(GCC_PASSES) $(LANGUAGES) stmp-int-hdrs $(STMP_FIXPROTO) \ LIBGCC_DEPS = $(GCC_PASSES) $(LANGUAGES) stmp-int-hdrs $(STMP_FIXPROTO) \
libgcc.mk $(srcdir)/libgcc1.c $(srcdir)/libgcc2.c $(CONFIG_H) \ libgcc.mk $(srcdir)/libgcc1.c $(srcdir)/libgcc2.c $(CONFIG_H) \
$(MACHMODE_H) longlong.h frame.h gbl-ctors.h config.status \ $(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) libgcc.a: $(LIBGCC_DEPS)
$(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \ $(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
......
# All alphas get an IEEE complaint set of libraries. # All alphas get an IEEE complaint set of libraries.
MULTILIB_OPTIONS = mieee MULTILIB_OPTIONS = mieee
MULTILIB_DIRNAMES = ieee MULTILIB_DIRNAMES = ieee
SHLIB_MULTILIB = ieee
LIBGCC = stmp-multilib LIBGCC = stmp-multilib
INSTALL_LIBGCC = install-multilib INSTALL_LIBGCC = install-multilib
# Do not build libgcc1. Let gcc generate those functions.
LIBGCC1 =
CROSS_LIBGCC1 =
LIBGCC1_TEST =
EXTRA_HEADERS = $(srcdir)/config/alpha/va_list.h
# 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
CLIB=-lmld -lexc CLIB=-lmld -lexc
EXTRA_HEADERS = $(srcdir)/config/alpha/va_list.h
...@@ -18,3 +18,8 @@ INSTALL_LIBGCC = install-multilib ...@@ -18,3 +18,8 @@ INSTALL_LIBGCC = install-multilib
EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o
CRTSTUFF_T_CFLAGS=-g1 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
...@@ -28,3 +28,8 @@ $(T)gcrt1.o: $(srcdir)/config/sparc/sol2-c1.asm $(GCC_PASSES) ...@@ -28,3 +28,8 @@ $(T)gcrt1.o: $(srcdir)/config/sparc/sol2-c1.asm $(GCC_PASSES)
CRTSTUFF_T_CFLAGS = -fPIC CRTSTUFF_T_CFLAGS = -fPIC
TARGET_LIBGCC2_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
...@@ -8,6 +8,13 @@ INSTALL_ASSERT_H = ...@@ -8,6 +8,13 @@ INSTALL_ASSERT_H =
CRTSTUFF_T_CFLAGS_S = -fPIC CRTSTUFF_T_CFLAGS_S = -fPIC
# Compile libgcc2.a with pic. # Compile libgcc2.a with pic.
TARGET_LIBGCC2_CFLAGS = -fPIC 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 # Do not build libgcc1. Let gcc generate those functions. The GNU/Linux
# C library can handle them. # C library can handle them.
......
...@@ -319,6 +319,11 @@ AC_ARG_WITH(dwarf2, ...@@ -319,6 +319,11 @@ AC_ARG_WITH(dwarf2,
dwarf2="$with_dwarf2", dwarf2="$with_dwarf2",
dwarf2=no) 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 # Determine the host, build, and target systems
AC_CANONICAL_SYSTEM AC_CANONICAL_SYSTEM
...@@ -812,7 +817,8 @@ changequote([,])dnl ...@@ -812,7 +817,8 @@ changequote([,])dnl
extra_passes="mips-tfile mips-tdump" extra_passes="mips-tfile mips-tdump"
fi fi
use_collect2=yes 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 case $machine in
*-*-osf1*) *-*-osf1*)
tm_file="${tm_file} alpha/osf.h alpha/osf12.h alpha/osf2or3.h" tm_file="${tm_file} alpha/osf.h alpha/osf12.h alpha/osf2or3.h"
...@@ -824,12 +830,14 @@ changequote([,])dnl ...@@ -824,12 +830,14 @@ changequote([,])dnl
;; ;;
*-*-osf4*) *-*-osf4*)
tm_file="${tm_file} alpha/osf.h" 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 # Some versions of OSF4 (specifically X4.0-9 296.7) have
# a broken tar, so we use cpio instead. # a broken tar, so we use cpio instead.
install_headers_dir=install-headers-cpio install_headers_dir=install-headers-cpio
;; ;;
*-*-osf5*) *-*-osf5*)
tm_file="${tm_file} alpha/osf.h alpha/osf5.h" tm_file="${tm_file} alpha/osf.h alpha/osf5.h"
tmake_file="$tmake_file alpha/t-osf4"
;; ;;
esac esac
case $machine in case $machine in
......
...@@ -23,6 +23,9 @@ ...@@ -23,6 +23,9 @@
# LIBGCC # LIBGCC
# MULTILIBS # MULTILIBS
# EXTRA_MULTILIB_PARTS # EXTRA_MULTILIB_PARTS
# SHLIB_LINK
# SHLIB_LIBS
# SHLIB_MULTILIB
# Make needs VPATH to be literal. # Make needs VPATH to be literal.
echo 'srcdir = @srcdir@' echo 'srcdir = @srcdir@'
...@@ -49,6 +52,10 @@ EOF ...@@ -49,6 +52,10 @@ EOF
rm -f $tmp rm -f $tmp
fi fi
# Disable SHLIB_LINK if shared libgcc not enabled.
if [ "@enable_shared@" = "no" ]; then
SHLIB_LINK=""
fi
# Build lines. # Build lines.
...@@ -258,6 +265,7 @@ done ...@@ -258,6 +265,7 @@ done
for ml in $MULTILIBS; do for ml in $MULTILIBS; do
dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'` dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
libgcc_objs="" libgcc_objs=""
for o in $libgcc1_objs; do for o in $libgcc1_objs; do
...@@ -278,6 +286,24 @@ for ml in $MULTILIBS; do ...@@ -278,6 +286,24 @@ for ml in $MULTILIBS; do
echo ' if $(RANLIB_TEST_FOR_TARGET) ; then' \\ echo ' if $(RANLIB_TEST_FOR_TARGET) ; then' \\
echo ' $(RANLIB_FOR_TARGET)' ${dir}/libgcc.a ';' \\ echo ' $(RANLIB_FOR_TARGET)' ${dir}/libgcc.a ';' \\
echo ' else true; fi;' 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 done
dirs=libgcc dirs=libgcc
...@@ -306,6 +332,23 @@ for ml in $MULTILIBS; do ...@@ -306,6 +332,23 @@ for ml in $MULTILIBS; do
dirs="$dirs ${dir} libgcc/${dir}" dirs="$dirs ${dir} libgcc/${dir}"
fi fi
all="$all ${dir}/libgcc.a" 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 done
echo 'stmp-dirs: force' echo 'stmp-dirs: force'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment