Commit Graph

23 Commits

Author SHA1 Message Date
Roger Sayle 74e55d0f8f re PR target/28247 (libstdc++ cannot be build with Solaris threads)
PR target/28247
	* gthr-solaris.h: Prototype __gthrw forms of thr_self, mutex_init and
	mutex_destroy even when !_LIBOOBJC.  Remove duplicate prototype of
	the __gthrw form of thr_keycreate.
	(__gthread_key_delete): Silence the unused argument warning.

From-SVN: r115686
2006-07-23 20:14:44 +00:00
Alexandre Oliva 72b167732c re PR other/24829 (libobjc testsuite failures)
PR other/24829
	PR target/24831
	* gthr-dce.h: Do not gthrw-ify pthread_once_init,
	pthread_key_delete.  From John David Anglin.  gthrw-ify
	pthread_getunique_np only if it it's not a macro.  Delete
	UNUSED macro.
	(__gthread_objc_condition_allocate, __gthread_objc_condition_deallocate,
	__gthread_objc_condition_wait, __gthread_objc_condition_broadcast,
	__gthread_objc_condition_signal, __gthread_key_delete): Add
	"__attribute__ ((__unused__))" to unused arguments.
	(__gthread_recursive_mutex_init_function): Add missing return.
	* gthr-dce.h, gthr-tpf.h, gthr-solaris.h, gthr-posix.h,
	gthr-posix95.h: Use macro-based approach for name redirection
	on targets missing weakref.

From-SVN: r110278
2006-01-26 22:00:28 +00:00
Geoffrey Keating a9b0b82578 Index: gcc/ChangeLog
2005-12-05  Geoffrey Keating  <geoffk@apple.com>

	* varasm.c (default_binds_local_p_1): Weakrefs don't bind locally.
	A hidden weak object does bind locally.  Strong linkonce data
	counts like any other strong symbol for binding.
	(weak_finish_1): Don't specially handle weakrefs, they no longer
	arrive here.
	(assemble_alias): Weakrefs can't be TREE_PUBLIC yet.
	* c-common.c (handle_alias_attribute): Allow static aliases
	of variables.
	(handle_weakref_attribute): Don't call declare_weak on weakrefs.
	* gthr-dce.h: Make weakrefs static.
	* gthr-tpf.h: Likewise.
	* gthr-solaris.h: Likewise.
	* gthr-posix.h: Likewise.
	* gthr-posix95.h: Likewise.
	* config/darwin.c (darwin_encode_section_info): static weakref
	variables are not necessarily defined in this translation unit.
	* doc/extend.texi (Function Attributes): Mention that an alias
	attribute creates a definition for the thing it's attached to.
	Change the documentation for weakref to say that the thing
	it's attached to must be static.

Index: gcc/testsuite/ChangeLog
2005-12-05  Geoffrey Keating  <geoffk@apple.com>

	* g++.old-deja/g++.abi/vtable2.C: Make weakrefs static.
	* gcc.dg/attr-weakref-1.c: Modify to not try to test public weakrefs,
	and to work on Darwin.
	* gcc.dg/attr-weakref-1b.c: New file.
	* gcc.dg/attr-weakref-2.c: New test.
	* gcc.dg/darwin-weakref-1.c: New test.

From-SVN: r108074
2005-12-05 20:38:37 +00:00
Alexandre Oliva 7ef67393c7 re PR other/4372 (#pragma weak pthread* inclusion causes applications to crash without a linker error when one forgets to link with -lpthread)
gcc/ChangeLog:
PR other/4372
* gthr-dce.h, gthr-posix.h, gthr-posix95.h, gthr-solaris.h,
gthr-tpf.h: Define __gthrw.  For all identifiers that might
be weak, introduce weakrefs or non-weak aliases with __gthrw,
and prefix all uses with __ghtrw.
libobjc/ChangeLog:
PR other/4372
* thr-objc.c (_XOPEN_SOURCE): Define.

From-SVN: r106704
2005-11-09 20:57:30 +00:00
Kelley Cook 366ccddb2b Update FSF address.
From-SVN: r101317
2005-06-25 02:02:01 +00:00
Eric Botcazou 6d861604ae gthr-solaris.h (__gthread_recursive_mutex_init_function): Use 0 instead of NULL.
* gthr-solaris.h (__gthread_recursive_mutex_init_function): Use
	0 instead of NULL.

From-SVN: r91092
2004-11-23 14:40:23 +00:00
Eric Botcazou 7ed5d5b27f gthr-solaris.h (__gthread_recursive_mutex_t): New type.
* gthr-solaris.h (__gthread_recursive_mutex_t): New type.
	(__GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION): Define to
	__gthread_recursive_mutex_init_function.
	(__gthread_key_create): Properly cast -1.
	(__gthread_recursive_mutex_init_function): New function.
	(__gthread_recursive_mutex_lock): Rewrite.
	(__gthread_recursive_mutex_trylock): Likewise.
	(__gthread_recursive_mutex_unlock): Likewise.

From-SVN: r91086
2004-11-23 12:59:26 +00:00
Kazu Hirata 279b5b3c95 dwarf.h, [...]: Update copyright.
* dwarf.h, gthr-dce.h, gthr-single.h, gthr-solaris.h, gthr.h,
	libfuncs.h, libgcc2.h, stab.def, tsystem.h: Update copyright.

From-SVN: r89446
2004-10-22 15:03:23 +00:00
Kazu Hirata ea4b78487c c-typeck.c, [...]: Fix comment formatting.
* c-typeck.c, defaults.h, dwarf.h, dwarf2out.c, fold-const.c,
	gthr-dce.h, gthr-posix.h, gthr-solaris.h, gthr-win32.h,
	lambda-code.c, lambda-mat.c, libgcc2.c, stmt.c,
	tree-ssa-pre.c, tree-vn.c, tree.h: Fix comment formatting.

From-SVN: r88102
2004-09-25 14:36:40 +00:00
Jason Merrill 40aac94801 re PR c++/13684 (local static object variable constructed once but ctors and dtors called multiple times on same memory when called in multiple threads)
PR c++/13684
        * cp/decl.c (expand_static_init): Use thread-safety API.
        (register_dtor_fn): Return the call, don't expand it.
        * cp/tree.c (add_stmt_to_compound): New fn.
        (stabilize_call): Use it.
        * gimplify.c (gimplify_cleanup_point_expr): Handle CLEANUP_EH_ONLY.
        (gimple_push_cleanup): Add eh_only parm.
        (gimplify_target_expr): Pass it.
        * c.opt (-fno-threadsafe-statics): New option.
        * c-opts.c (c_common_handle_option): Handle it.
        * c-common.h (flag_threadsafe_statics): Declare it.
        * c-common.c (flag_threadsafe_statics): Record it.
        * doc/invoke.texi: Document it.
        * tsystem.h (_GNU_SOURCE): Define.
        * gthr-posix.h (__gthread_recursive_mutex_t): New typedef.
        (__GTHREAD_RECURSIVE_MUTEX_INIT): New macro.
        (__GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION): New macro.
        (__gthread_recursive_mutex_init_function): New fn.
        (__gthread_recursive_mutex_lock): New fn.
        (__gthread_recursive_mutex_trylock): New fn.
        (__gthread_recursive_mutex_unlock): New fn.
        * gthr-solaris.h, gthr-single.h, gthr-dce.h: Likewise.
        * gthr-win32.h, gthr-vxworks.h: Likewise.
        * gthr.h: Document.

        * libsupc++/guard.cc (static_mutex): Internal class implementing a
        recursive mutex which controls initialization of local statics.
        (__gnu_cxx::recursive_init): New exception class.
        (__cxa_guard_acquire): Deal with locking and recursion detection.
        (acquire_1, __cxa_guard_abort, __cxa_guard_release): Likewise.

From-SVN: r86687
2004-08-27 22:33:54 -04:00
Zack Weinberg 4977bab6ed Merge basic-improvements-branch to trunk
From-SVN: r60174
2002-12-16 18:23:00 +00:00
Kazu Hirata e6179f4596 * gthr-solaris.h: Fix formatting.
From-SVN: r59076
2002-11-13 13:48:15 +00:00
Kazu Hirata 589005ff21 gbl-ctors.h: Fix formatting.
* gbl-ctors.h: Fix formatting.
	* gcc.c: Likewise.
	* gccspec.c: Likewise.
	* gcov.c: Likewise.
	* gcov-io.h: Likewise.
	* gcse.c: Likewise.
	* ggc-common.c: Likewise.
	* ggc.h: Likewise.
	* ggc-page.c: Likewise.
	* ggc-simple.c: Likewise.
	* global.c: Likewise.
	* graph.h: Likewise.
	* gthr-dce.h: Likewise.
	* gthr.h: Likewise.
	* gthr-posix.h: Likewise.
	* gthr-rtems.h: Likewise.
	* gthr-solaris.h: Likewise.
	* gthr-win32.h: Likewise.

From-SVN: r54240
2002-06-04 11:30:46 +00:00
Jason Merrill 7a8de19b4c gthr-posix.h (__gthread_active_p): Move __gthread_active_ptr into the function and constify it.
* gthr-posix.h (__gthread_active_p): Move __gthread_active_ptr
        into the function and constify it.
        * gthr-dce.h, gthr-solaris.h: Likewise.

From-SVN: r50741
2002-03-13 12:15:46 -05:00
Kazu Hirata 71287280a2 gthr-dce.h: Fix comment formatting.
* gthr-dce.h: Fix comment formatting.
	* gthr-posix.h: Likewise.
	* gthr-single.h: Likewise.
	* gthr-solaris.h: Likewise.
	* gthr-vxworks.h: Likewise.
	* gthr-win32.h: Likewise.

From-SVN: r46229
2001-10-12 13:10:33 +00:00
Lars Brinkhoff 1322177dbd Makefile.in, [...]: replace "GNU CC" with "GCC".
* Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c,
	bitmap.h, builtin-types.def, builtins.c, builtins.def,
	c-aux-info.c, c-common.c, c-common.def, c-common.h,
	c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c,
	c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in,
	c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c,
	caller-save.c, calls.c, collect2.c, collect2.h, combine.c,
	conditions.h, config.gcc, configure.frag, configure.in,
	conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c,
	cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h,
	dependence.c, df.c, df.h, diagnostic.c, diagnostic.h,
	doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c,
	dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c,
	emit-rtl.c, errors.c, errors.h, except.c, except.h,
	exgettext, explow.c, expmed.c, expr.c, expr.h, final.c,
	fixproto, flags.h, flow.c, fold-const.c, fp-test.c,
	function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp,
	gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c,
	gencheck.c, gencodes.c, genconfig.c, genemit.c,
	genextract.c, genflags.c, gengenrtl.c, genmultilib,
	genopinit.c, genoutput.c, genpeep.c, genrecog.c,
	gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c,
	ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c,
	graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h,
	gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h,
	gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h,
	hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h,
	integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c,
	libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h,
	machmode.def, machmode.h, main.c, mbchar.c, mbchar.h,
	mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk,
	mkmap-symver.awk, optabs.c, output.h, params.c, params.def,
	params.h, predict.c, predict.def, predict.h, prefix.c,
	prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c,
	read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c,
	regclass.c, regmove.c, regrename.c, regs.h, reload.c,
	reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c,
	rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h,
	sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c,
	sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c,
	ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c,
	stringpool.c, system.h, timevar.c, timevar.def, timevar.h,
	tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h,
	tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h,
	unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h,
	unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c,
	xcoffout.h: replace "GNU CC" with "GCC".

From-SVN: r45105
2001-08-22 14:35:51 +00:00
Loren J. Rittle f5fa23843e gthr-posix.h (__gthread_active_ptr): Cast function pointer to target type to allow ISO C++ compiler to accept it.
* gthr-posix.h (__gthread_active_ptr): Cast function pointer
	to target type to allow ISO C++ compiler to accept it.
	* gthr-dce.h (__gthread_active_ptr): Likewise.
	* gthr-solaris.h (__gthread_active_ptr): Likewise.

Co-Authored-By: John David Anglin <dave@hiauly1.hia.nrc.ca>

From-SVN: r42725
2001-05-30 22:38:43 +00:00
Richard Henderson 88657302b7 Standardize header guards.
From-SVN: r42615
2001-05-25 18:31:47 -07:00
H.J. Lu 15794a9567 Applied H.J.Lu's patch to not require -lpthread when compiling single threaded Objective-C programs.
From-SVN: r35141
2000-07-20 07:27:26 +00:00
Kaveh R. Ghazi d1e5132060 crtstuff.c (__do_global_ctors_aux, [...]): Add prototype argument.
* crtstuff.c (__do_global_ctors_aux, __reg_frame_ctor,
	__dereg_frame_dtor): Add prototype argument.

	* gthr-dce.h (__gthread_active_p, __gthread_once): Likewise.

	* gthr-posix.h (__gthread_active_p, __gthread_once): Likewise.

	* gthr-solaris.h (__gthread_active_p, __gthread_once): Likewise.

	* gthr-vxworks.h (__gthread_once): Likewise.

	* gthr-win32.h (__gthread_active_p, __gthread_once): Likewise.

From-SVN: r31945
2000-02-12 19:19:01 +00:00
Fred Fish 899905f6d3 gthr-posix.h: Fix typo; compatibily -> compatibility.
* gthr-posix.h: Fix typo; compatibily -> compatibility.
        * gthr-single.h: Likewise.
        * gthr-solaris.h: Likewise.
        * gthr-vxworks.h: Likewise.
        * gthr-win32.h: Likewise.
        * gthr.h: Likewise.

From-SVN: r31646
2000-01-27 10:49:12 -08:00
Teemu Torma 754d1a92e6 Patch from Teemu Torma to fix Solaris 2.6 EH failures.
* gthr.h: Changed the comment about return values.
	* gthr-solaris.h (__gthread_once): Do not use errno; return the
	error number instead of -1.
	(__gthread_key_create): Any non-zero return value is an error.
	* libgcc2.c (eh_context_initialize): Check for non-zero return
	value from __gthread_once.
	Check that the value of get_eh_context was really changed.

From-SVN: r18480
1998-03-11 04:07:25 -08:00
Teemu Torma f24af81bca Makefile.in (GTHREAD_FLAGS): New var.
* Makefile.in (GTHREAD_FLAGS): New var.
	(LIBGCC2_CFLAGS): Added $(GTHREAD_FLAGS).
	(distclean): Remove gthr-default.h.
	* configure.in: Accept dce as a thread package.
	Check for thread.h and pthread.h.
	Link gthr-default.h to appropriate thread file and set
	gthread_flags.
	(hppa1.1-*-hpux10*): If --enable-threads, use dce threads and
	include multilib definitions from pa/t-dce-thr.
	(sparc-*-solaris2*): Enable threads by default, if thread.h or
	pthread.h is found, preferring posix threads over solaris ones.
	* config/pa/t-dce-thr: New file.
	* config/pa/t-pa: Removed multilibs.
	* config/sparc/t-sol2: Ditto.
	* gthr.h: New file.
	* gthr-single.h: New file.
	* gthr-posix.h: New file.
	* gthr-solaris.h: New file.
	* gthr-dce.h: New file.
	* libgcc-thr.h: Removed.
	* objc/thr-dce.c: New file copied from thr-decosf1.c.
	* frame.c: Include gthr.h instead of libgcc-thr.h.
	* libgcc2.c: Include gthr.h instead of libgcc-thr.h.
	(eh_context_initialize): If __gthread_once fails, use static eh
	context.
	(eh_context_free): Call __gthread_key_dtor.

From-SVN: r17235
1997-12-24 16:56:08 -07:00