Commit 7370bebd by Zack Weinberg Committed by Zack Weinberg

* gthr-gnat.c, gthr-gnat.h, gthr.h, libgcc2.h, unwind-dw2-fde.h

	* unwind.h: Surround all visibility pragmas with #ifndef HIDE_EXPORTS.

	* mklibgcc.in: Drastic restructure for comprehensibility.
	Remove the old hidden-directive hack.
	Eliminate support for .txt files in LIB2ADD etc (never used).
	Eliminate support for assembly source files in LIB2ADDEH* and
	LIBUNWIND (also never used).
	Build up dependency lists for libraries incrementally.
	If we have SHLIB_LINK, compile each file twice, once for the
	static and once for the shared library; also probe for
	-fvisibility=hidden in the generated libgcc.mk.  If found,
	pass that and -DHIDE_EXPORTS to the compilation of every C
	source file going into the static library.  If found, generate
	hidden-directive lists for every assembly source file going
	into the static library, but incorporate them with -include
	instead of ld -r.
	Write comments into generated libgcc.mk to facilitate debugging.
	* Makefile.in: Pass ASM_HIDDEN_OP to mklibgcc.
	* config/t-slibgcc-darwin: Define ASM_HIDDEN_OP.

	* config/darwin.h (REAL_LIBGCC_SPEC): Put -lgcc back in
	-Zdynamiclib case.

From-SVN: r91513
parent afe84921
2004-11-30 Zack Weinberg <zack@codesourcery.com>
* gthr-gnat.c, gthr-gnat.h, gthr.h, libgcc2.h, unwind-dw2-fde.h
* unwind.h: Surround all visibility pragmas with #ifndef HIDE_EXPORTS.
* mklibgcc.in: Drastic restructure for comprehensibility.
Remove the old hidden-directive hack.
Eliminate support for .txt files in LIB2ADD etc (never used).
Eliminate support for assembly source files in LIB2ADDEH* and
LIBUNWIND (also never used).
Build up dependency lists for libraries incrementally.
If we have SHLIB_LINK, compile each file twice, once for the
static and once for the shared library; also probe for
-fvisibility=hidden in the generated libgcc.mk. If found,
pass that and -DHIDE_EXPORTS to the compilation of every C
source file going into the static library. If found, generate
hidden-directive lists for every assembly source file going
into the static library, but incorporate them with -include
instead of ld -r.
Write comments into generated libgcc.mk to facilitate debugging.
* Makefile.in: Pass ASM_HIDDEN_OP to mklibgcc.
* config/t-slibgcc-darwin: Define ASM_HIDDEN_OP.
* config/darwin.h (REAL_LIBGCC_SPEC): Put -lgcc back in
-Zdynamiclib case.
2004-11-29 Richard Henderson <rth@redhat.com> 2004-11-29 Richard Henderson <rth@redhat.com>
* expr.c (get_inner_reference): Handle REAL/IMAGPART_EXPR. * expr.c (get_inner_reference): Handle REAL/IMAGPART_EXPR.
......
...@@ -1235,6 +1235,7 @@ libgcc.mk: config.status Makefile mklibgcc $(LIB2ADD) $(LIB2ADD_ST) xgcc$(exeext ...@@ -1235,6 +1235,7 @@ libgcc.mk: config.status Makefile mklibgcc $(LIB2ADD) $(LIB2ADD_ST) xgcc$(exeext
SHLIB_MAPFILES='$(SHLIB_MAPFILES)' \ SHLIB_MAPFILES='$(SHLIB_MAPFILES)' \
SHLIB_NM_FLAGS='$(SHLIB_NM_FLAGS)' \ SHLIB_NM_FLAGS='$(SHLIB_NM_FLAGS)' \
MULTILIB_OSDIRNAMES='$(MULTILIB_OSDIRNAMES)' \ MULTILIB_OSDIRNAMES='$(MULTILIB_OSDIRNAMES)' \
ASM_HIDDEN_OP='$(ASM_HIDDEN_OP)' \
mkinstalldirs='$(mkinstalldirs)' \ mkinstalldirs='$(mkinstalldirs)' \
$(SHELL) mklibgcc > tmp-libgcc.mk $(SHELL) mklibgcc > tmp-libgcc.mk
mv tmp-libgcc.mk libgcc.mk mv tmp-libgcc.mk libgcc.mk
......
...@@ -316,8 +316,8 @@ extern const char *darwin_fix_and_continue_switch; ...@@ -316,8 +316,8 @@ extern const char *darwin_fix_and_continue_switch;
#define REAL_LIBGCC_SPEC \ #define REAL_LIBGCC_SPEC \
"%{static|static-libgcc:-lgcc -lgcc_eh}\ "%{static|static-libgcc:-lgcc -lgcc_eh}\
%{!static:%{!static-libgcc:\ %{!static:%{!static-libgcc:\
%{!Zdynamiclib:%{!shared-libgcc:-lgcc -lgcc_eh}\ %{!Zdynamiclib:%{!shared-libgcc:-lgcc -lgcc_eh}\
%{shared-libgcc:-lgcc_s -lgcc} } %{Zdynamiclib:-lgcc_s}}}" %{shared-libgcc:-lgcc_s -lgcc}} %{Zdynamiclib:-lgcc_s -lgcc}}}"
/* We specify crt0.o as -lcrt0.o so that ld will search the library path. */ /* We specify crt0.o as -lcrt0.o so that ld will search the library path. */
......
...@@ -34,3 +34,6 @@ SHLIB_INSTALL = \ ...@@ -34,3 +34,6 @@ SHLIB_INSTALL = \
SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk
SHLIB_MKMAP_OPTS = -v leading_underscore=1 SHLIB_MKMAP_OPTS = -v leading_underscore=1
SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver
# Must use a different directive for hidden visibility in assembly sources.
ASM_HIDDEN_OP = .private_extern
...@@ -28,7 +28,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -28,7 +28,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "gthr-gnat.h" #include "gthr-gnat.h"
#ifndef HIDE_EXPORTS
#pragma GCC visibility push(default) #pragma GCC visibility push(default)
#endif
#ifdef __cplusplus #ifdef __cplusplus
#define UNUSED(x) #define UNUSED(x)
...@@ -81,4 +83,6 @@ __gthread_mutex_unlock (__gthread_mutex_t * UNUSED (mutex)) ...@@ -81,4 +83,6 @@ __gthread_mutex_unlock (__gthread_mutex_t * UNUSED (mutex))
return 0; return 0;
} }
#ifndef HIDE_EXPORTS
#pragma GCC visibility pop #pragma GCC visibility pop
#endif
...@@ -28,7 +28,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -28,7 +28,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#ifndef GCC_GTHR_GNAT_H #ifndef GCC_GTHR_GNAT_H
#define GCC_GTHR_GNAT_H #define GCC_GTHR_GNAT_H
#ifndef HIDE_EXPORTS
#pragma GCC visibility push(default) #pragma GCC visibility push(default)
#endif
/* Just provide compatibility for mutex handling. */ /* Just provide compatibility for mutex handling. */
...@@ -41,7 +43,9 @@ extern int __gthread_active_p (void); ...@@ -41,7 +43,9 @@ extern int __gthread_active_p (void);
extern int __gthread_mutex_lock (__gthread_mutex_t *); extern int __gthread_mutex_lock (__gthread_mutex_t *);
extern int __gthread_mutex_unlock (__gthread_mutex_t *); extern int __gthread_mutex_unlock (__gthread_mutex_t *);
#ifndef HIDE_EXPORTS
#pragma GCC visibility pop #pragma GCC visibility pop
#endif
#endif /* ! GCC_GTHR_GNAT_H */ #endif /* ! GCC_GTHR_GNAT_H */
...@@ -29,7 +29,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -29,7 +29,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#ifndef GCC_GTHR_H #ifndef GCC_GTHR_H
#define GCC_GTHR_H #define GCC_GTHR_H
#ifndef HIDE_EXPORTS
#pragma GCC visibility push(default) #pragma GCC visibility push(default)
#endif
/* If this file is compiled with threads support, it must /* If this file is compiled with threads support, it must
#define __GTHREADS 1 #define __GTHREADS 1
...@@ -116,6 +118,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -116,6 +118,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "gthr-single.h" #include "gthr-single.h"
#endif #endif
#ifndef HIDE_EXPORTS
#pragma GCC visibility pop #pragma GCC visibility pop
#endif
#endif /* ! GCC_GTHR_H */ #endif /* ! GCC_GTHR_H */
...@@ -30,7 +30,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -30,7 +30,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#ifndef GCC_LIBGCC2_H #ifndef GCC_LIBGCC2_H
#define GCC_LIBGCC2_H #define GCC_LIBGCC2_H
#ifndef HIDE_EXPORTS
#pragma GCC visibility push(default) #pragma GCC visibility push(default)
#endif
extern int __gcc_bcmp (const unsigned char *, const unsigned char *, size_t); extern int __gcc_bcmp (const unsigned char *, const unsigned char *, size_t);
extern void __clear_cache (char *, char *); extern void __clear_cache (char *, char *);
...@@ -324,6 +326,8 @@ extern int __parityDI2 (UDWtype); ...@@ -324,6 +326,8 @@ extern int __parityDI2 (UDWtype);
extern void __enable_execute_stack (void *); extern void __enable_execute_stack (void *);
#ifndef HIDE_EXPORTS
#pragma GCC visibility pop #pragma GCC visibility pop
#endif
#endif /* ! GCC_LIBGCC2_H */ #endif /* ! GCC_LIBGCC2_H */
...@@ -40,13 +40,17 @@ ...@@ -40,13 +40,17 @@
# SHLIB_NM_FLAGS # SHLIB_NM_FLAGS
# SHLIB_INSTALL # SHLIB_INSTALL
# MULTILIB_OSDIRNAMES # MULTILIB_OSDIRNAMES
# ASM_HIDDEN_OP
# Make needs VPATH to be literal. # Make needs VPATH to be literal.
echo 'srcdir = @srcdir@' echo 'srcdir = @srcdir@'
echo 'VPATH = @srcdir@' echo 'VPATH = @srcdir@'
echo 'EQ = =' echo 'EQ = ='
echo 'objects = $(filter %'$objext',$^)'
echo echo
echo 'force:' echo '# Dependencies are accumulated as we go.'
echo 'all: stmp-dirs'
echo 'dirs = libgcc'
echo echo
# Library members defined in libgcc2.c. # Library members defined in libgcc2.c.
...@@ -89,290 +93,570 @@ libgcov_c_dep='stmp-dirs $(srcdir)/libgcov.c $(srcdir)/gcov-io.h $(srcdir)/gcov- ...@@ -89,290 +93,570 @@ libgcov_c_dep='stmp-dirs $(srcdir)/libgcov.c $(srcdir)/gcov-io.h $(srcdir)/gcov-
# Dependencies for fp-bit.c # Dependencies for fp-bit.c
fpbit_c_dep='stmp-dirs config.status tsystem.h' fpbit_c_dep='stmp-dirs config.status tsystem.h'
if [ "$SHLIB_LINK" ]; then
# Test -fvisibility=hidden. We need both a -fvisibility=hidden on
# the command line, and a #define to prevent libgcc2.h etc from
# overriding that with #pragmas. The dance with @ is to prevent
# echo from seeing anything it might take for an option.
echo "vis_hide := \$(strip \$(subst @,-,\\"
echo " \$(shell if echo 'void foo(void);' | \\"
echo " $gcc_compile -fvisibility=hidden -Werror \\"
echo " -c -xc - -o /dev/null 2> /dev/null; \\"
echo " then echo @fvisibility=hidden @DHIDE_EXPORTS; \\"
echo " fi)))"
echo
# If we have -fvisibility=hidden, then we need to generate hide
# lists for object files implemented in assembly. The default
# pseudo-op for this is ".hidden", but can be overridden with
# ASM_HIDDEN_OP.
[ "$ASM_HIDDEN_OP" ] || ASM_HIDDEN_OP=".hidden"
echo "ifneq (,\$(vis_hide))"
echo "define gen-hide-list"
echo "\$(NM_FOR_TARGET) ${SHLIB_NM_FLAGS} \$< | \\"
# non-GNU nm emits three fields even for undefined and typeless symbols,
# so explicitly omit them
echo " \$(AWK) 'NF == 3 && \$\$2 !~ /^[UN]\$\$/ { print \"\\t${ASM_HIDDEN_OP}\", \$\$3 }' > \$@T"
echo "mv -f \$@T \$@"
echo "endef"
echo "else"
echo "gen-hide-list = echo > \$@"
echo "endif"
echo
else
# It is too hard to guarantee that vis_hide and gen-hide-list will never
# be referenced if SHLIB_LINK is not set, so set them to the values they'd
# have if SHLIB_LINK were set and we didn't have visibility support.
echo "vis_hide ="
echo "gen-hide-list = echo > \$@"
fi
# Remove any objects from lib2funcs and LIB2_DIVMOD_FUNCS that are
# defined as optimized assembly code in LIB1ASMFUNCS.
for name in $LIB1ASMFUNCS; do
lib2funcs=`echo $lib2funcs | sed -e 's/^'$name' //' \
-e 's/ '$name' / /' \
-e 's/ '$name'$//'`
LIB2_DIVMOD_FUNCS=`echo $LIB2_DIVMOD_FUNCS | sed -e 's/^'$name' //' \
-e 's/ '$name' / /' \
-e 's/ '$name'$//'`
done
# #
# Build libgcc1 components. # Rules to generate object files.
# #
libgcc1_objs="" for ml in $MULTILIBS; do
for name in $LIB1ASMFUNCS; do # Work out relevant parameters that depend only on the multilib.
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'`;
flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; shlib_dir=
out="libgcc/${dir}/${name}${objext}" shlib_dir_qual=
libgcc_a=$dir/libgcc.a
libgcov_a=$dir/libgcov.a
libgcc_eh_a=
libgcc_s_so=
libunwind_a=
libunwind_so=
echo ${out}: stmp-dirs '$(srcdir)/config/$(LIB1ASMSRC)' if [ "$LIBUNWIND" ]; then
echo " $gcc_compile" $flags -DL$name -xassembler-with-cpp \ libunwind_a=$dir/libunwind.a
-c '$(srcdir)/config/$(LIB1ASMSRC)' -o $out fi
if [ "$SHLIB_LINK" ]; then
if [ -z "$SHLIB_MULTILIB" ]; then
if [ "$dir" = . ]; then
libgcc_eh_a=$dir/libgcc_eh.a
libgcc_s_so_base=$dir/libgcc_s
libgcc_s_so=${libgcc_s_so_base}${SHLIB_EXT}
if [ "$LIBUNWIND" ]; then
libunwind_so_base=$dir/libunwind
libunwind_so=${libunwind_so_base}${SHLIB_EXT}
fi
else
libgcc_eh_a=$dir/libgcc_eh.a
libgcc_s_so_base=$dir/libgcc_s_`echo $dir | sed s,/,_,g`
libgcc_s_so=${libgcc_s_so_base}${SHLIB_EXT}
if [ "$LIBUNWIND" ]; then
libunwind_so_base=$dir/libunwind_`echo $dir | sed s,/,_,g`
libunwind_so=${libunwind_so_base}${SHLIB_EXT}
fi
fi
# Remove any objects from lib2funcs and LIB2_DIVMOD_FUNCS that are libgcc_s_soname=$libgcc_s_so_base
# defined as optimized assembly code in LIB1ASMFUNCS. libunwind_soname=$libunwind_so_base
lib2funcs=`echo $lib2funcs | sed -e 's/^'$name' //' \
-e 's/ '$name' / /' \
-e 's/ '$name'$//'`
LIB2_DIVMOD_FUNCS=`echo $LIB2_DIVMOD_FUNCS | sed -e 's/^'$name' //' \
-e 's/ '$name' / /' \
-e 's/ '$name'$//'`
done
libgcc1_objs="$libgcc1_objs ${name}${objext}"
done
# if [ -n "$MULTILIB_OSDIRNAMES" ]; then
# Build libgcc2 components. if [ "$dir" != . ]; then
# gcc_multilib_dir=`./xgcc -B./ $flags --print-multi-directory`
os_multilib_dir=`./xgcc -B./ $flags --print-multi-os-directory`
shlib_dir="$dir"/
gcc_multilib_sup=`echo $gcc_multilib_dir | sed 's~^[^/]*/~~'`
os_multilib_base=`echo $os_multilib_dir | sed -n "s~/${gcc_multilib_sup}\$~~p"`
if [ -z "$os_multilib_base" ]; then
libgcc_s_soname=libgcc_s
libunwind_soname=libunwind
if [ "$os_multilib_dir" != "." ]; then
shlib_dir_qual="/$os_multilib_dir"
fi
else
libgcc_s_soname=libgcc_s_`echo $gcc_multilib_sup | sed s,/,_,g`
libunwind_soname=libunwind_`echo $gcc_multilib_sup | sed s,/,_,g`
shlib_dir_qual="/$os_multilib_base"
fi
fi
fi
libgcc2_objs="" elif [ "$SHLIB_MULTILIB" = "$dir" ]; then
libgcc2_st_objs="" libgcc_eh_a=$dir/libgcc_eh.a
libgcc2_eh_static_objs="" libgcc_s_so_base=$dir/libgcc_s
libgcc2_eh_shared_objs="" libgcc_s_so=${libgcc_s_so_base}${SHLIB_EXT}
if [ "$LIBUNWIND" ]; then
libunwind_so_base=$dir/libunwind
libunwind_so=${libunwind_so_base}${SHLIB_EXT}
fi
for name in $lib2funcs; do libgcc_s_soname=$libgcc_s_so_base
for ml in $MULTILIBS; do libunwind_soname=$libunwind_so_base
dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'` fi
flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; fi
out="libgcc/${dir}/${name}${objext}"
echo $out: $libgcc2_c_dep echo
echo " $gcc_compile" $flags -DL$name \ echo \#
-c '$(srcdir)/libgcc2.c' -o $out echo \# ml: $ml
echo \# dir: $dir
echo \# flags: $flags
echo \# libgcc_a: $libgcc_a
echo \# libgcov_a: $libgcov_a
echo \# libgcc_eh_a: $libgcc_eh_a
echo \# libunwind_a: $libunwind_a
echo \#
echo \# gcc_multilib_dir: $gcc_multilib_dir
echo \# gcc_multilib_sup: $gcc_multilib_sup
echo \# os_multilib_dir: $os_multilib_dir
echo \# os_multilib_base: $os_multilib_base
echo \# shlib_dir: $shlib_dir
echo \# shlib_dir_qual: $shlib_dir_qual
echo \#
echo \# libgcc_s_so: $libgcc_s_so
echo \# libgcc_s_so_base: $libgcc_s_so_base
echo \# libgcc_s_soname: $libgcc_s_soname
echo \#
echo \# libunwind_so: $libunwind_so
echo \# libunwind_so_base: $libunwind_so_base
echo \# libunwind_soname: $libunwind_soname
echo \#
echo
# Update list of directories.
if [ $dir != . ]; then
echo "dirs += ${dir} libgcc/${dir}"
echo
fi
#
# Build libgcc1 components.
#
for name in $LIB1ASMFUNCS; do
if [ "$libgcc_s_so" ]; then
out="libgcc/${dir}/${name}${objext}"
outS="libgcc/${dir}/${name}_s${objext}"
outV="libgcc/${dir}/${name}.vis"
echo ${outS}: stmp-dirs '$(srcdir)/config/$(LIB1ASMSRC)'
echo " $gcc_compile" $flags -DL$name -xassembler-with-cpp \
-c '$(srcdir)/config/$(LIB1ASMSRC)' -o $outS
echo ${out}: stmp-dirs '$(srcdir)/config/$(LIB1ASMSRC)' ${outV}
echo " $gcc_compile" $flags -DL$name -xassembler-with-cpp \
-c '$(srcdir)/config/$(LIB1ASMSRC)' -include $outV -o $out
echo "${outV}: ${outS}; \$(gen-hide-list)"
echo $libgcc_a: $out
echo $libgcc_s_so: $outS
if [ "$SHLIB_MKMAP" ]; then
echo libgcc/${dir}/libgcc.map: $outS
fi
else
out="libgcc/${dir}/${name}${objext}"
echo ${out}: stmp-dirs '$(srcdir)/config/$(LIB1ASMSRC)'
echo " $gcc_compile" $flags -DL$name -xassembler-with-cpp \
-c '$(srcdir)/config/$(LIB1ASMSRC)' -o $out
echo $libgcc_a: $out
fi
done done
libgcc2_objs="$libgcc2_objs ${name}${objext}"
done
for name in $LIB2FUNCS_ST; do #
for ml in $MULTILIBS; do # Build libgcc2 components.
dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'` #
flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
out="libgcc/${dir}/${name}${objext}"
echo $out: $libgcc2_c_dep for name in $lib2funcs; do
echo " $gcc_compile" $flags -DL$name \ if [ "$libgcc_s_so" ]; then
-c '$(srcdir)/libgcc2.c' -o $out out="libgcc/${dir}/${name}${objext}"
outS="libgcc/${dir}/${name}_s${objext}"
echo $outS: $libgcc2_c_dep
echo " $gcc_compile" $flags -DL$name -c '$(srcdir)/libgcc2.c' -o $outS
echo $out: $libgcc2_c_dep
echo " $gcc_compile" $flags -DL$name '$(vis_hide)' \
-c '$(srcdir)/libgcc2.c' -o $out
echo $libgcc_a: $out
echo $libgcc_s_so: $outS
if [ "$SHLIB_MKMAP" ]; then
echo libgcc/${dir}/libgcc.map: $outS
fi
else
out="libgcc/${dir}/${name}${objext}"
echo ${out}: stmp-dirs '$(srcdir)/config/$(LIB1ASMSRC)'
echo " $gcc_compile" $flags -DL$name -c '$(srcdir)/libgcc2.c' -o $outS
echo $libgcc_a: $out
fi
done done
libgcc2_st_objs="$libgcc2_st_objs ${name}${objext}"
done
for name in $LIB2_DIVMOD_FUNCS; do for name in $LIB2FUNCS_ST; do
for ml in $MULTILIBS; do
dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
out="libgcc/${dir}/${name}${objext}" out="libgcc/${dir}/${name}${objext}"
echo $out: $libgcc2_c_dep echo $out: $libgcc2_c_dep
echo " $gcc_compile" $flags -DL$name \ echo " $gcc_compile" $flags -DL$name '$(vis_hide)' \
-c '$(srcdir)/libgcc2.c' -fexceptions -fnon-call-exceptions -o $out -c '$(srcdir)/libgcc2.c' -o $out
echo ${dir}/libgcc.a: $out
done done
libgcc2_objs="$libgcc2_objs ${name}${objext}"
done
if [ "$FPBIT" ]; then for name in $LIB2_DIVMOD_FUNCS; do
for name in $FPBIT_FUNCS; do if [ "$libgcc_s_so" ]; then
for ml in $MULTILIBS; do
dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
out="libgcc/${dir}/${name}${objext}" out="libgcc/${dir}/${name}${objext}"
outS="libgcc/${dir}/${name}_s${objext}"
echo $out: $FPBIT $fpbit_c_dep echo $outS: $libgcc2_c_dep
echo " $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \ echo " $gcc_compile" $flags -DL$name \
-c $FPBIT -o $out -fexceptions -fnon-call-exceptions -c '$(srcdir)/libgcc2.c' -o $outS
done
libgcc2_objs="$libgcc2_objs ${name}${objext}"
done
fi
if [ "$DPBIT" ]; then echo $out: $libgcc2_c_dep
for name in $DPBIT_FUNCS; do echo " $gcc_compile" $flags -DL$name '$(vis_hide)' \
for ml in $MULTILIBS; do -fexceptions -fnon-call-exceptions -c '$(srcdir)/libgcc2.c' -o $out
dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
out="libgcc/${dir}/${name}${objext}"
echo $out: $DPBIT $fpbit_c_dep echo $libgcc_a: $out
echo " $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \ echo $libgcc_s_so: $outS
-c $DPBIT -o $out if [ "$SHLIB_MKMAP" ]; then
done echo libgcc/${dir}/libgcc.map: $outS
libgcc2_objs="$libgcc2_objs ${name}${objext}" fi
else
out="libgcc/${dir}/${name}${objext}"
echo ${out}: stmp-dirs '$(srcdir)/config/$(LIB1ASMSRC)'
echo " $gcc_compile" $flags -DL$name \
-fexceptions -fnon-call-exceptions -c '$(srcdir)/libgcc2.c' -o $outS
echo $libgcc_a: $out
fi
done done
fi
if [ "$TPBIT" ]; then #
for name in $TPBIT_FUNCS; do # Build software floating point functions.
for ml in $MULTILIBS; do #
dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; if [ "$FPBIT" ]; then
out="libgcc/${dir}/${name}${objext}" for name in $FPBIT_FUNCS; do
if [ "$libgcc_s_so" ]; then
out="libgcc/${dir}/${name}${objext}"
outS="libgcc/${dir}/${name}_s${objext}"
echo $outS: $FPBIT $fpbit_c_dep
echo " $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
-c $FPBIT -o $outS
echo $out: $FPBIT $fpbit_c_dep
echo " $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
'$(vis_hide)' -c $FPBIT -o $out
echo $libgcc_a: $out
echo $libgcc_s_so: $outS
if [ "$SHLIB_MKMAP" ]; then
echo libgcc/${dir}/libgcc.map: $outS
fi
else
out="libgcc/${dir}/${name}${objext}"
echo $out: $FPBIT $fpbit_c_dep
echo " $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
-c $FPBIT -o $out
echo $out: $TPBIT $fpbit_c_dep echo $libgcc_a: $out
echo " $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \ fi
-c $TPBIT -o $out
done done
libgcc2_objs="$libgcc2_objs ${name}${objext}" fi
done
fi
for file in $LIB2ADD; do if [ "$DPBIT" ]; then
name=`echo $file | sed -e 's/[.][cSo]$//' -e 's/[.]asm$//' -e 's/[.]txt$//'` for name in $DPBIT_FUNCS; do
oname=`echo $name | sed -e 's,.*/,,'` if [ "$libgcc_s_so" ]; then
out="libgcc/${dir}/${name}${objext}"
outS="libgcc/${dir}/${name}_s${objext}"
for ml in $MULTILIBS; do echo $outS: $DPBIT $fpbit_c_dep
dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'` echo " $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; -c $DPBIT -o $outS
out="libgcc/${dir}/${oname}${objext}"
if [ ${name}.asm = ${file} ]; then
flags="$flags -xassembler-with-cpp"
fi
echo $out: stmp-dirs $file $libgcc_dep echo $out: $DPBIT $fpbit_c_dep
echo " $gcc_compile" $flags -c $file -o $out echo " $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
done '$(vis_hide)' -c $DPBIT -o $out
libgcc2_objs="$libgcc2_objs ${oname}${objext}"
done
for file in $LIB2ADDEH; do echo $libgcc_a: $out
name=`echo $file | sed -e 's/[.][cSo]$//' -e 's/[.]asm$//' -e 's/[.]txt$//'` echo $libgcc_s_so: $outS
oname=`echo $name | sed -e 's,.*/,,'` if [ "$SHLIB_MKMAP" ]; then
echo libgcc/${dir}/libgcc.map: $outS
fi
else
out="libgcc/${dir}/${name}${objext}"
echo $out: $DPBIT $fpbit_c_dep
echo " $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
-c $DPBIT -o $out
for ml in $MULTILIBS; do echo $libgcc_a: $out
dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'` fi
flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; done
out="libgcc/${dir}/${oname}${objext}" fi
if [ ${name}.asm = ${file} ]; then
flags="$flags -xassembler-with-cpp"
fi
echo $out: stmp-dirs $file $LIB2ADDEHDEP $libgcc_dep if [ "$TPBIT" ]; then
echo " $gcc_compile" $flags -fexceptions -c $file -o $out for name in $TPBIT_FUNCS; do
done if [ "$libgcc_s_so" ]; then
if [ -z "$SHLIB_LINK" ]; then out="libgcc/${dir}/${name}${objext}"
libgcc2_objs="$libgcc2_objs ${oname}${objext}" outS="libgcc/${dir}/${name}_s${objext}"
echo $outS: $TPBIT $fpbit_c_dep
echo " $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
-c $TPBIT -o $outS
echo $out: $TPBIT $fpbit_c_dep
echo " $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
'$(vis_hide)' -c $TPBIT -o $out
echo $libgcc_a: $out
echo $libgcc_s_so: $outS
if [ "$SHLIB_MKMAP" ]; then
echo libgcc/${dir}/libgcc.map: $outS
fi
else
out="libgcc/${dir}/${name}${objext}"
echo $out: $TPBIT $fpbit_c_dep
echo " $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
-c $TPBIT -o $out
echo $libgcc_a: $out
fi
done
fi fi
done
if [ "$SHLIB_LINK" ]; then for file in $LIB2ADD; do
# Those should be in libgcc_eh.a. name=`echo $file | sed -e 's/[.][cS]$//' -e 's/[.]asm$//'`
for file in $LIB2ADDEHSTATIC; do
name=`echo $file | sed -e 's/[.][cSo]$//' -e 's/[.]asm$//' -e 's/[.]txt$//'`
oname=`echo $name | sed -e 's,.*/,,'` oname=`echo $name | sed -e 's,.*/,,'`
libgcc2_eh_static_objs="$libgcc2_eh_static_objs ${oname}${objext}"
done
# Those should be in libgcc.so. if [ "$libgcc_s_so" ]; then
for file in $LIB2ADDEHSHARED; do out="libgcc/${dir}/${oname}${objext}"
name=`echo $file | sed -e 's/[.][cSo]$//' -e 's/[.]asm$//' -e 's/[.]txt$//'` outS="libgcc/${dir}/${oname}_s${objext}"
oname=`echo $name | sed -e 's,.*/,,'`
libgcc2_eh_shared_objs="$libgcc2_eh_shared_objs ${oname}${objext}" case $file in
*.c)
echo $outS: stmp-dirs $file $libgcc_dep
echo " $gcc_compile" $flags -c $file -o $outS
echo $out: stmp-dirs $file $libgcc_dep
echo " $gcc_compile" $flags '$(vis_hide)' -c $file -o $out
;;
*.asm | *.S)
outV="libgcc/${dir}/${oname}.vis"
echo $outS: stmp-dirs $file $libgcc_dep
echo " $gcc_compile" $flags -xassembler-with-cpp \
-c $file -o $outS
echo $out: stmp-dirs $file $libgcc_dep $outV
echo " $gcc_compile" $flags -xassembler-with-cpp \
-include $outV -c $file -o $out
echo "${outV}: ${outS}; \$(gen-hide-list)"
;;
*)
echo "Unhandled extension: $file" >&2
exit 1
;;
esac
echo $libgcc_a: $out
echo $libgcc_s_so: $outS
if [ "$SHLIB_MKMAP" ]; then
echo libgcc/${dir}/libgcc.map: $outS
fi
else
out="libgcc/${dir}/${oname}${objext}"
case $file in
*.c)
echo $out: stmp-dirs $file $libgcc_dep
echo " $gcc_compile" $flags -c $file -o $out
;;
*.asm | *.S)
echo $out: stmp-dirs $file $libgcc_dep
echo " $gcc_compile" $flags -xassembler-with-cpp \
-c $file -o $out
;;
*)
echo "Unhandled extension: $file" >&2
exit 1
;;
esac
echo $libgcc_a: $out
fi
done done
fi
for file in $LIB2ADD_ST; do
name=`echo $file | sed -e 's/[.][cSo]$//' -e 's/[.]asm$//' -e 's/[.]txt$//'`
oname=`echo $name | sed -e 's,.*/,,'`
for ml in $MULTILIBS; do for file in $LIB2ADD_ST; do
dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'` name=`echo $file | sed -e 's/[.][cSo]$//' -e 's/[.]asm$//'`
flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; oname=`echo $name | sed -e 's,.*/,,'`
out="libgcc/${dir}/${oname}${objext}" out="libgcc/${dir}/${oname}${objext}"
if [ ${name}.asm = ${file} ]; then
flags="$flags -xassembler-with-cpp"
fi
echo $out: stmp-dirs $file $libgcc_dep case $file in
echo " $gcc_compile" $flags -c $file -o $out *.c)
echo $out: stmp-dirs $file $libgcc_dep
echo " $gcc_compile" $flags '$(vis_hide)' -c $file -o $out
;;
*.asm | *.S)
# We may have to compile it twice in order to establish the list
# of symbols to be marked hidden.
if [ "$libgcc_so" ]; then
outV="libgcc/${dir}/${oname}.vis"
outT="libgcc/${dir}/${oname}_t${objext}"
echo ${outT}: stmp-dirs $file $libgcc_dep
echo " $gcc_compile" $flags -xassembler-with-cpp \
-c $file -o ${outT}
echo $out: stmp-dirs $file $libgcc_dep $outV
echo " $gcc_compile" $flags -xassembler-with-cpp \
-include $outV -c $file -o $out
echo "${outV}: ${outT}; \$(gen-hide-list)"
else
echo $out: stmp-dirs $file $libgcc_dep
echo " $gcc_compile" $flags -xassembler-with-cpp \
-c $file -o $out
fi
;;
*)
echo "Unhandled extension: $file" >&2
exit 1
;;
esac
echo $libgcc_a: $out
done done
libgcc2_st_objs="$libgcc2_st_objs ${oname}${objext}"
done
if [ "$LIBUNWIND" ]; then # If we don't have libgcc_eh.a, only LIB2ADDEH matters. If we do, only
libunwind_static_objs="" # LIB2ADDEHSTATIC and LIB2ADDEHSHARED matter. (Usually all three are
libunwind_shared_objs="" # identical.) We do _not_ handle assembly files in this context.
for file in $LIBUNWIND; do
name=`echo $file | sed -e 's/[.][cSo]$//' -e 's/[.]asm$//' -e 's/[.]txt$//'`
oname=`echo $name | sed -e 's,.*/,,'`
for ml in $MULTILIBS; do if [ "$libgcc_eh_a" ]; then
dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'` for file in $LIB2ADDEHSTATIC; do
flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; case $file in
*.c) ;;
*) echo "Unhandled extension: $file">&2; exit 1 ;;
esac
name=`echo $file | sed -e 's/[.]c$//'`
oname=`echo $name | sed -e 's,.*/,,'`
out="libgcc/${dir}/${oname}${objext}" out="libgcc/${dir}/${oname}${objext}"
if [ ${name}.asm = ${file} ]; then
flags="$flags -xassembler-with-cpp"
fi
echo $out: stmp-dirs $file $LIBUNWINDDEP echo $out: stmp-dirs $file $LIB2ADDEHDEP $libgcc_dep
echo " $gcc_compile" $flags '$(vis_hide)' -fexceptions -c $file -o $out
echo $libgcc_eh_a: $out
done
for file in $LIB2ADDEHSHARED; do
case $file in
*.c) ;;
*) echo "Unhandled extension: $file">&2; exit 1 ;;
esac
name=`echo $file | sed -e 's/[.]c$//'`
oname=`echo $name | sed -e 's,.*/,,'`
out="libgcc/${dir}/${oname}_s${objext}"
echo $out: stmp-dirs $file $LIB2ADDEHDEP $libgcc_dep
echo " $gcc_compile" $flags -fexceptions -c $file -o $out echo " $gcc_compile" $flags -fexceptions -c $file -o $out
echo ${out}s: stmp-dirs $file $LIBUNWINDDEP echo $libgcc_s_so: $out
echo " $gcc_compile" $flags -fexceptions -DSHARED -c $file -o ${out}s if [ "$SHLIB_MKMAP" ]; then
echo libgcc/${dir}/libgcc.map: $out
fi
done done
libunwind_static_objs="$libunwind_static_objs ${oname}${objext}"
libunwind_shared_objs="$libunwind_shared_objs ${oname}${objext}s"
done
fi
# else # no SHLIB_LINK
# build libgcov components for file in $LIB2ADDEH; do
# case $file in
*.c) ;;
*) echo "Unhandled extension: $file">&2; exit 1 ;;
esac
libgcov_objs="" name=`echo $file | sed -e 's/[.]c$//'`
oname=`echo $name | sed -e 's,.*/,,'`
out="libgcc/${dir}/${oname}${objext}"
for name in $LIBGCOV; do echo $out: stmp-dirs $file $LIB2ADDEHDEP $libgcc_dep
for ml in $MULTILIBS; do echo " $gcc_compile" $flags -fexceptions '$(vis_hide)' -c $file -o $out
echo $libgcc_a: $out
done
fi
# Again, this does not handle assembly.
if [ "$LIBUNWIND" ]; then
for file in $LIBUNWIND; do
case $file in
*.c) ;;
*) echo "Unhandled extension: $file">&2; exit 1 ;;
esac
name=`echo $file | sed -e 's/[.]c$//'`
oname=`echo $name | sed -e 's,.*/,,'`
if [ "$libunwind_so" ]; then
out="libgcc/${dir}/${oname}${objext}"
outS="libgcc/${dir}/${oname}_s${objext}"
echo $out: stmp-dirs $file $LIBUNWINDDEP
echo " $gcc_compile $flags -fexceptions \$(vis_hide) -c $file -o $out"
echo $outS: stmp-dirs $file $LIBUNWINDDEP
echo " $gcc_compile $flags -fexceptions -DSHARED -c $file -o $outS"
echo $libunwind_a: $out
echo $libunwind_so: $outS
else
out="libgcc/${dir}/${oname}${objext}"
echo $out: stmp-dirs $file $LIBUNWINDDEP
echo " $gcc_compile $flags -fexceptions \$(vis_hide) -c $file -o $out"
echo $libunwind_a: $out
fi
done
fi
#
# build libgcov components
#
for name in $LIBGCOV; 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'`; flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
out="libgcc/${dir}/${name}${objext}" out="libgcc/${dir}/${name}${objext}"
echo $out: $libgcov_c_dep echo $out: $libgcov_c_dep
echo " $gcc_compile" $flags -DL$name \ echo " $gcc_compile $flags -DL$name -c \$(srcdir)/libgcov.c -o $out"
-c '$(srcdir)/libgcov.c' -o $out echo $libgcov_a: $out
done done
libgcov_objs="$libgcov_objs ${name}${objext}"
done
# SHLIB_MKMAP # Library build rules.
# SHLIB_MKMAP_OPTS
# SHLIB_MAPFILES
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'`; flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
libgcc_objs="" # Map-file generation.
libgcc_eh_static_objs=""
libgcc_eh_shared_objs=""
for o in $libgcc1_objs; do
libgcc_objs="$libgcc_objs libgcc/${dir}/$o"
done
for o in $libgcc2_objs; do
libgcc_objs="$libgcc_objs libgcc/${dir}/$o"
done
for o in $libgcc2_eh_static_objs; do
libgcc_eh_static_objs="$libgcc_eh_static_objs libgcc/${dir}/$o"
done
for o in $libgcc2_eh_shared_objs; do
libgcc_eh_shared_objs="$libgcc_eh_shared_objs libgcc/${dir}/$o"
done
libgcc_sh_objs="$libgcc_objs $libgcc_eh_shared_objs"
shlib_deps="$libgcc_sh_objs"
libgcc_st_objs=""
for o in $libgcc2_st_objs; do
libgcc_st_objs="$libgcc_st_objs libgcc/${dir}/$o"
done
libgcov_a_objs=""
for o in $libgcov_objs; do
libgcov_a_objs="$libgcov_a_objs libgcc/${dir}/$o"
done
if [ "$LIBUNWIND" ]; then
libunwind_a_objs=""
for o in $libunwind_static_objs; do
libunwind_a_objs="$libunwind_a_objs libgcc/${dir}/$o"
done
libunwind_sh_objs=""
for o in $libunwind_shared_objs; do
libunwind_sh_objs="$libunwind_sh_objs libgcc/${dir}/$o"
done
shlibunwind_deps="$libunwind_sh_objs"
fi
if [ "$SHLIB_LINK" -a "$SHLIB_MKMAP" ]; then if [ "$SHLIB_LINK" -a "$SHLIB_MKMAP" ]; then
mapfile="libgcc/${dir}/libgcc.map" mapfile="libgcc/${dir}/libgcc.map"
tmpmapfile="libgcc/${dir}/tmp-libgcc.map" tmpmapfile="libgcc/${dir}/tmp-libgcc.map"
...@@ -381,43 +665,27 @@ for ml in $MULTILIBS; do ...@@ -381,43 +665,27 @@ for ml in $MULTILIBS; do
# The behavior of here documents is more predictable. # The behavior of here documents is more predictable.
cat <<EOF cat <<EOF
${mapfile}: $SHLIB_MKMAP $SHLIB_MAPFILES $libgcc_sh_objs ${mapfile}: $SHLIB_MKMAP $SHLIB_MAPFILES
{ \$(NM_FOR_TARGET) $SHLIB_NM_FLAGS $libgcc_sh_objs; echo %%; \\ { \$(NM_FOR_TARGET) $SHLIB_NM_FLAGS \$(objects); echo %%; \\
cat $SHLIB_MAPFILES \\ cat $SHLIB_MAPFILES \\
| sed -e '/^[ ]*#/d' \\ | sed -e '/^[ ]*#/d' \\
-e 's/^%\(if\|else\|elif\|endif\|define\)/#\1/' \\ -e 's/^%\(if\|else\|elif\|endif\|define\)/#\1/' \\
| $gcc_compile $flags -E -xassembler-with-cpp -; \\ | $gcc_compile $flags -E -xassembler-with-cpp -; \\
} | \$(AWK) -f $SHLIB_MKMAP $SHLIB_MKMAP_OPTS > ${tmpmapfile} } | \$(AWK) -f $SHLIB_MKMAP $SHLIB_MKMAP_OPTS > ${tmpmapfile}
mv '$tmpmapfile' \$@ mv '$tmpmapfile' \$@
$libgcc_s_so: ${mapfile}
EOF EOF
fi fi
shlib_deps="$shlib_deps $mapfile"
# Depend on EXTRA_MULTILIB_PARTS, since that's where crtbegin/end # Depend on EXTRA_MULTILIB_PARTS, since that's where crtbegin/end
# usually are put in a true multilib situation. # usually are put in a true multilib situation.
shlib_extra_deps=""
for f in $EXTRA_MULTILIB_PARTS; do for f in $EXTRA_MULTILIB_PARTS; do
shlib_deps="$shlib_deps $dir/$f" shlib_extra_deps="$shlib_extra_deps $dir/$f"
done done
echo $libgcc_s_so: $shlib_extra_deps
libgcc_a_objs="$libgcc_objs $libgcc_st_objs" # Static libraries.
if [ "@libgcc_visibility@" = yes -a "$SHLIB_LINK" ]; then
libgcc_a_objs=
echo ""
echo "libgcc/${dir}/stacknote.s: stmp-dirs"
echo ' @( echo | $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) '${flags}' -S -o - -xc - | grep .note.GNU-stack || : ) > $@.tmp'
echo ' @mv -f $@.tmp $@'
echo ""
for o in $libgcc_objs $libgcc_st_objs; do
# .oS objects will have all non-local symbol definitions .hidden
oS=`echo ${o} | sed s~${objext}'$~.oS~g'`
echo "${oS}: stmp-dirs libgcc/${dir}/stacknote.s ${o}"
# non-GNU nm emits three fields even for undefined and typeless symbols,
# so explicitly omit them
echo ' ( $(NM_FOR_TARGET) '${SHLIB_NM_FLAGS} ${o}' | $(AWK) '\''NF == 3 && $$2 !~ /^[UN]$$/ { print "\t.hidden", $$3 }'\''; cat libgcc/${dir}/stacknote.s ) | $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) '${flags}' -r -nostdinc -nostdlib -o $@ '${o}' -xassembler -'
libgcc_a_objs="${libgcc_a_objs} ${oS}"
done
fi
# Each of these .a files depends on stmp-dirs. It would seem that # Each of these .a files depends on stmp-dirs. It would seem that
# this dependency is redundant, since each of the object files # this dependency is redundant, since each of the object files
...@@ -426,186 +694,70 @@ EOF ...@@ -426,186 +694,70 @@ EOF
# dependency is required; the directory containing the archive must # dependency is required; the directory containing the archive must
# exist before the archive itself can be created. # exist before the archive itself can be created.
echo "" echo ""
echo "${dir}/libgcc.a: stmp-dirs $libgcc_a_objs" echo "$libgcc_a: stmp-dirs"
echo " -rm -rf ${dir}/libgcc.a" echo " -rm -f $libgcc_a"
echo ' $(AR_CREATE_FOR_TARGET)' ${dir}/libgcc.a $libgcc_a_objs echo ' $(AR_CREATE_FOR_TARGET)' $libgcc_a '$(objects)'
echo ' $(RANLIB_FOR_TARGET)' ${dir}/libgcc.a echo ' $(RANLIB_FOR_TARGET)' $libgcc_a
echo "all: $libgcc_a"
echo "" echo ""
echo "${dir}/libgcov.a: stmp-dirs $libgcov_a_objs" echo "$libgcov_a: stmp-dirs"
echo " -rm -rf ${dir}/libgcov.a" echo " -rm -f $libgcov_a"
echo ' $(AR_CREATE_FOR_TARGET)' ${dir}/libgcov.a $libgcov_a_objs echo ' $(AR_CREATE_FOR_TARGET)' $libgcov_a '$(objects)'
echo ' $(RANLIB_FOR_TARGET)' ${dir}/libgcov.a echo ' $(RANLIB_FOR_TARGET)' $libgcov_a
echo "all: $libgcov_a"
if [ "$LIBUNWIND" ]; then
echo "" # These libraries are not always built.
echo "${dir}/libunwind.a: stmp-dirs $libunwind_a_objs" if [ "$libunwind_a" ]; then
echo " -rm -rf ${dir}/libunwind.a"
echo ' $(AR_CREATE_FOR_TARGET)' ${dir}/libunwind.a $libunwind_a_objs
echo ' $(RANLIB_FOR_TARGET)' ${dir}/libunwind.a
echo "" echo ""
echo "${dir}/libgcc.a: ${dir}/libunwind.a" echo "$libunwind_a: stmp-dirs"
echo " -rm -f $libunwind_a"
echo ' $(AR_CREATE_FOR_TARGET)' $libunwind_a '$(objects)'
echo ' $(RANLIB_FOR_TARGET)' $libunwind_a
echo "all: $libunwind_a"
fi fi
if [ "$SHLIB_LINK" ]; then if [ "$libgcc_eh_a" ]; then
echo "" echo ""
echo "${dir}/libgcc_eh.a: stmp-dirs $libgcc_eh_static_objs" echo "${dir}/libgcc_eh.a: stmp-dirs"
echo " -rm -rf ${dir}/libgcc_eh.a" echo " -rm -f ${dir}/libgcc_eh.a"
echo ' $(AR_CREATE_FOR_TARGET)' ${dir}/libgcc_eh.a $libgcc_eh_static_objs echo ' $(AR_CREATE_FOR_TARGET)' ${dir}/libgcc_eh.a '$(objects)'
echo ' $(RANLIB_FOR_TARGET)' ${dir}/libgcc_eh.a echo ' $(RANLIB_FOR_TARGET)' ${dir}/libgcc_eh.a
echo "all: $libgcc_eh_a"
fi
if [ -z "$SHLIB_MULTILIB" ]; then # Shared libraries.
if [ "$dir" = . ]; then if [ "$libgcc_s_so" ]; then
shlib_base_name=libgcc_s echo ""
shlibunwind_base_name=libunwind echo "$libgcc_s_so: stmp-dirs $libunwind_so"
else echo " $SHLIB_LINK" \
shlib_base_name=libgcc_s_`echo $dir | sed s,/,_,g`
shlibunwind_base_name=libunwind_`echo $dir | sed s,/,_,g`
fi
shlib_so_name="$shlib_base_name"
shlibunwind_so_name="$shlibunwind_base_name"
if [ "$LIBUNWIND" ]; then
shlib_deps="$shlib_deps ${dir}/${shlibunwind_base_name}${SHLIB_EXT}"
fi
shlib_dir=
shlib_slibdir_qual=
if [ -n "$MULTILIB_OSDIRNAMES" ]; then
if [ "$dir" != . ]; then
gcc_multilib_dir=`./xgcc -B./ $flags --print-multi-directory`
os_multilib_dir=`./xgcc -B./ $flags --print-multi-os-directory`
shlib_dir="$dir"/
gcc_multilib_sup=`echo $gcc_multilib_dir | sed 's~^[^/]*/~~'`
os_multilib_base=`echo $os_multilib_dir | sed -n "s~/${gcc_multilib_sup}\$~~p"`
if [ -z "$os_multilib_base" ]; then
shlib_so_name=libgcc_s
shlibunwind_so_name=libunwind
if [ "$os_multilib_dir" != "." ]; then
shlib_slibdir_qual="/$os_multilib_dir"
fi
else
shlib_so_name=libgcc_s_`echo $gcc_multilib_sup | sed s,/,_,g`
shlibunwind_so_name=libunwind_`echo $gcc_multilib_sup | sed s,/,_,g`
shlib_slibdir_qual="/$os_multilib_base"
fi
fi
fi
echo ""
echo "${dir}/${shlib_base_name}${SHLIB_EXT}: $shlib_deps"
echo " $SHLIB_LINK" \
| sed -e "s%@multilib_flags@%$flags%g" \ | sed -e "s%@multilib_flags@%$flags%g" \
-e "s%@multilib_dir@%$dir%g" \ -e "s%@multilib_dir@%$dir%g" \
-e "s%@shlib_objs@%$libgcc_sh_objs%g" \ -e "s%@shlib_objs@%\$(objects)%g" \
-e "s%@shlib_base_name@%$shlib_base_name%g" \ -e "s%@shlib_base_name@%$libgcc_s_so_base%g" \
-e "s%@shlib_so_name@%$libgcc_s_soname%g" \
-e "s%@shlib_map_file@%$mapfile%g" \ -e "s%@shlib_map_file@%$mapfile%g" \
-e "s%@shlib_so_name@%$shlib_so_name%g" \
-e "s%@shlib_dir@%$shlib_dir%g" \ -e "s%@shlib_dir@%$shlib_dir%g" \
-e "s%@shlib_slibdir_qual@%%g" -e "s%@shlib_slibdir_qual@%$shlib_dir_qual%g"
if [ "$LIBUNWIND" ]; then echo "all: $libgcc_s_so"
echo "" fi
echo "${dir}/${shlibunwind_base_name}${SHLIB_EXT}: $shlibunwind_deps"
echo " $SHLIBUNWIND_LINK" \ if [ "$libunwind_so" ]; then
echo ""
echo "$libunwind_so: stmp-dirs"
echo " $SHLIBUNWIND_LINK" \
| sed -e "s%@multilib_flags@%$flags%g" \ | sed -e "s%@multilib_flags@%$flags%g" \
-e "s%@multilib_dir@%$dir%g" \ -e "s%@multilib_dir@%$dir%g" \
-e "s%@shlib_objs@%$libunwind_sh_objs%g" \ -e "s%@shlib_objs@%\$(objects)%g" \
-e "s%@shlib_base_name@%$shlibunwind_base_name%g" \ -e "s%@shlib_base_name@%$libunwind_so_base%g" \
-e "s%@shlib_so_name@%$shlibunwind_so_name%g" \ -e "s%@shlib_so_name@%$libunwind_soname%g" \
-e "s%@shlib_dir@%$shlib_dir%g" \ -e "s%@shlib_dir@%$shlib_dir%g" \
-e "s%@shlib_slibdir_qual@%%g" -e "s%@shlib_slibdir_qual@%$shlib_dir_qual%g"
fi echo "all: $libunwind_so"
elif [ "$SHLIB_MULTILIB" = "$dir" ]; then
shlib_base_name="libgcc_s";
shlibunwind_base_name="libunwind";
echo ""
echo "${shlib_base_name}${SHLIB_EXT}: $shlib_deps"
echo " $SHLIB_LINK" \
| sed -e "s%@multilib_flags@%$flags%g" \
-e "s%@multilib_dir@%$dir%g" \
-e "s%@shlib_objs@%$libgcc_sh_objs%g" \
-e "s%@shlib_base_name@%$shlib_base_name%g" \
-e "s%@shlib_map_file@%$mapfile%g" \
-e "s%@shlib_so_name@%$shlib_base_name%g" \
-e "s%@shlib_dir@%%g" \
-e "s%@shlib_slibdir_qual@%%g"
if [ "$LIBUNWIND" ]; then
echo ""
echo "${shlibunwind_base_name}${SHLIB_EXT}: $shlibunwind_deps"
echo " $SHLIBUNWIND_LINK" \
| sed -e "s%@multilib_flags@%$flags%g" \
-e "s%@multilib_dir@%$dir%g" \
-e "s%@shlib_objs@%$libgcc_sh_objs%g" \
-e "s%@shlib_base_name@%$shlibunwind_base_name%g" \
-e "s%@shlib_so_name@%$shlibunwind_base_name%g" \
-e "s%@shlib_dir@%%g" \
-e "s%@shlib_slibdir_qual@%%g"
fi
fi
fi fi
done
dirs=libgcc # EXTRA_MULTILIB_PARTS.
for ml in $MULTILIBS; do for f in $EXTRA_MULTILIB_PARTS; do
dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
if [ $dir != . ]; then
dirs="$dirs ${dir} libgcc/${dir}"
fi
done
echo ''
echo 'libgcc-stage-start:'
echo ' for dir in '"${dirs}"'; do \'
echo ' if [ -d $(stage)/$$dir ]; then true; else '$mkinstalldirs' $(stage)/$$dir; fi; \'
echo ' done'
echo ' -for dir in '"${dirs}"'; do \'
echo ' mv $$dir/*'"${objext}"' $(stage)/$$dir; \'
echo ' mv $$dir/*'"${objext}s"' $(stage)/$$dir || true; \'
echo ' test ! -f $$dir/stacknote.s || mv $$dir/stacknote.s $(stage)/$$dir; \'
echo ' test ! -f $$dir/libgcc.a || mv $$dir/lib* $(stage)/$$dir; \'
echo ' done'
echo ""
all=stmp-dirs
dirs=libgcc
for ml in $MULTILIBS; do
dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
if [ $dir != . ]; then
dirs="$dirs ${dir} libgcc/${dir}"
fi
all="$all ${dir}/libgcc.a ${dir}/libgcov.a"
if [ "$LIBUNWIND" ]; then
all="$all ${dir}/libunwind.a"
fi
if [ "$SHLIB_LINK" ]; then
all="$all ${dir}/libgcc_eh.a"
if [ -z "$SHLIB_MULTILIB" ]; then
if [ "$dir" = "." ]; then
suff="";
else
suff=_`echo $dir | sed s,/,_,g`
fi
all="$all ${dir}/libgcc_s${suff}${SHLIB_EXT}"
if [ "$LIBUNWIND" ]; then
all="$all ${dir}/${dir}/libunwind${suff}${SHLIB_EXT}"
fi
elif [ "$SHLIB_MULTILIB" = "$dir" ]; then
all="$all libgcc_s${SHLIB_EXT}"
if [ "$LIBUNWIND" ]; then
all="$all ${dir}/${dir}/libunwind${SHLIB_EXT}"
fi
fi
fi
done
echo 'stmp-dirs: force'
echo ' for d in '"$dirs"'; do \'
echo ' if [ -d $$d ]; then true; else '$mkinstalldirs' $$d; fi; \'
echo ' done'
echo ' if [ -f stmp-dirs ]; then true; else touch stmp-dirs; fi'
for f in $EXTRA_MULTILIB_PARTS; do
for ml in $MULTILIBS; do
dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
case $dir in case $dir in
.) out=$f ; t= ;; .) out=$f ; t= ;;
*) out=$dir/$f ; t=$dir/ ;; *) out=$dir/$f ; t=$dir/ ;;
...@@ -620,16 +772,33 @@ for f in $EXTRA_MULTILIB_PARTS; do ...@@ -620,16 +772,33 @@ for f in $EXTRA_MULTILIB_PARTS; do
echo " $make_compile" \\ echo " $make_compile" \\
echo ' LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)' $flags '" ' \\ echo ' LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)' $flags '" ' \\
echo ' MULTILIB_CFLAGS="'$flags'"' T=$t $targ echo ' MULTILIB_CFLAGS="'$flags'"' T=$t $targ
echo "all: $out"
all="$all $out"
done done
done
echo "" done # ml in MULTILIBS
echo "all: $all"
echo
echo "libgcc-stage-start:"
echo " for dir in \$(dirs); do \\"
echo " if [ -d \$(stage)/\$\$dir ]; then :; \\"
echo " else $mkinstalldirs \$(stage)/\$\$dir; fi; \\"
echo " done"
echo " -for dir in \$(dirs); do \\"
echo " mv \$\$dir/*${objext} \$(stage)/\$\$dir; \\"
echo " mv \$\$dir/*.vis \$(stage)/\$\$dir; \\"
echo " mv \$\$dir/*.map \$(stage)/\$\$dir; \\"
echo " test ! -f \$\$dir/libgcc.a || mv \$\$dir/lib* \$(stage)/\$\$dir; \\"
echo " done"
echo
echo "stmp-dirs:"
echo " for d in \$(dirs); do \\"
echo " if [ -d \$\$d ]; then true; else $mkinstalldirs \$\$d; fi; \\"
echo " done"
echo " if [ -f stmp-dirs ]; then true; else touch stmp-dirs; fi"
echo "" echo ""
echo "install: $all" echo "install: all"
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'`; flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
...@@ -728,3 +897,5 @@ for f in $EXTRA_MULTILIB_PARTS; do ...@@ -728,3 +897,5 @@ for f in $EXTRA_MULTILIB_PARTS; do
echo ' $(INSTALL_DATA)' $out $ldir/ echo ' $(INSTALL_DATA)' $out $ldir/
done done
done done
echo '.PHONY: all install'
...@@ -32,7 +32,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -32,7 +32,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#ifndef GCC_UNWIND_DW2_FDE_H #ifndef GCC_UNWIND_DW2_FDE_H
#define GCC_UNWIND_DW2_FDE_H #define GCC_UNWIND_DW2_FDE_H
#ifndef HIDE_EXPORTS
#pragma GCC visibility push(default) #pragma GCC visibility push(default)
#endif
struct fde_vector struct fde_vector
{ {
...@@ -179,6 +181,8 @@ last_fde (struct object *obj __attribute__ ((__unused__)), const fde *f) ...@@ -179,6 +181,8 @@ last_fde (struct object *obj __attribute__ ((__unused__)), const fde *f)
#endif #endif
} }
#ifndef HIDE_EXPORTS
#pragma GCC visibility pop #pragma GCC visibility pop
#endif
#endif /* unwind-dw2-fde.h */ #endif /* unwind-dw2-fde.h */
...@@ -31,7 +31,9 @@ ...@@ -31,7 +31,9 @@
#ifndef _UNWIND_H #ifndef _UNWIND_H
#define _UNWIND_H #define _UNWIND_H
#ifndef HIDE_EXPORTS
#pragma GCC visibility push(default) #pragma GCC visibility push(default)
#endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
...@@ -231,6 +233,8 @@ extern void * _Unwind_FindEnclosingFunction (void *pc); ...@@ -231,6 +233,8 @@ extern void * _Unwind_FindEnclosingFunction (void *pc);
} }
#endif #endif
#ifndef HIDE_EXPORTS
#pragma GCC visibility pop #pragma GCC visibility pop
#endif
#endif /* unwind.h */ #endif /* unwind.h */
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