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
......
...@@ -317,7 +317,7 @@ extern const char *darwin_fix_and_continue_switch; ...@@ -317,7 +317,7 @@ extern const char *darwin_fix_and_continue_switch;
"%{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 */
...@@ -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