configure.in: Remove target-libstdc++-v3 from noconfigdirs for *-*-netware...

/
        * configure.in: Remove target-libstdc++-v3 from noconfigdirs for
        *-*-netware, but add target-libmudflap.
        Consolidate *-*-netware targets (of which really only i?86 exists)
        into a single entry.
        * configure: Likewise.
gcc/
        * config.gcc: Resurrect NetWare as a target. Handle special case of
        Novell linker to be used (specified through --with-ld=) and threading
        model of either Posix (default) or NKS.
        * config/i386/i386.c (ix86_return_pops_args): Conditionalize popping
        of incoming hidden argument on KEEP_AGGREGATE_RETURN_POINTER.
        * config/i386/i386.h (KEEP_AGGREGATE_RETURN_POINTER): New.
        * config/i386/netware.c, config/i386/netware.h: New.
        * config/i386/nwld.c, config/i386/nwld.h: New.
        * config/i386/netware-crt0.c: New.
        * config/i386/netware-libgcc.c: New.
        * config/i386/netware-libgcc.def: New.
        * config/i386/netware-libgcc.exp: New.
        * config/i386/t-netware, config/i386/t-nwld: New.
        * gthr-nks.h: New.
        * doc/install.texi: Document NKS threading model.
gcc/cp/
        * g++spec.c (MATH_LIBRARY_PROFILE): Default to MATH_LIBRARY rather
        than "-lm".
gcc/testsuite/
        * g++.dg/abi/bitfield5.C: Use -mno-ms-bitfields.
        * g++.old-deja/g++.jason/thunk2.C: xfail for NetWare.
        * g++.old-deja/g++.law/profile1.C: xfail for NetWare.
        * g++.old-deja/g++.other/store-expr1.C: xfail for NetWare.
        * gcc.c-torture/compile/20001109-1.c: xfail for NetWare.
        * gcc.c-torture/compile/20001109-2.c: xfail for NetWare.
        * gcc.c-torture/execute/multi-ix.c: Use __builtin_bzero rather than
        the non-portable bzero.
        * gcc.dg/20010912-1.c: xfail for NetWare.
        * gcc.dg/20020426-2.c: xfail for NetWare.
        * gcc.dg/20021014-1.c: xfail for NetWare.
        * gcc.dg/20021018-1.c: xfail for NetWare.
        * gcc.dg/20030213-1.c: xfail for NetWare.
        * gcc.dg/20030225-1.c: xfail for NetWare.
        * gcc.dg/20030708-1.c: xfail for NetWare.
        * gcc.dg/builtins-config.h: Also exclude NetWare.
        * gcc.dg/format/format.h: Define restrict only if not already defined.
        * gcc.dg/nest.c: xfail for NetWare.
        * gcc.dg/special/gcsec-1.c: Don't pass -static for NetWare.
        * lib/target-supports.exp (check_visibility_available): Exclude
        NetWare.
fixincludes/
        * inclhack.def: Suppress exception_structure and math_exception
        for NetWare headers.
        * fixincl.x: Regenerate.
libstdc++-v3/
        * crossconfig.m4: Add NetWare as a target.
        * configure: Regenerate.

From-SVN: r87040
This commit is contained in:
Jan Beulich 2004-09-03 18:10:08 +00:00 committed by Richard Henderson
parent 04efec8127
commit 61fec9ffac
47 changed files with 4048 additions and 22 deletions

View File

@ -1,3 +1,11 @@
2004-09-03 Jan Beulich <jbeulich@novell.com>
* configure.in: Remove target-libstdc++-v3 from noconfigdirs for
*-*-netware, but add target-libmudflap.
Consolidate *-*-netware targets (of which really only i?86 exists)
into a single entry.
* configure: Likewise.
2004-09-01 Paolo Bonzini <bonzini@gnu.org>
* Makefile.tpl (sorry): Remove.

9
configure vendored
View File

@ -1203,8 +1203,8 @@ case "${target}" in
;;
esac
;;
*-*-netware)
noconfigdirs="$noconfigdirs target-libstdc++-v3 target-newlib target-libiberty target-libgloss ${libgcj}"
*-*-netware*)
noconfigdirs="$noconfigdirs target-newlib target-libiberty target-libgloss ${libgcj} target-libmudflap"
;;
*-*-rtems*)
noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
@ -2636,10 +2636,7 @@ extra_nmflags_for_target=
extra_ranlibflags_for_target=
target_makefile_frag=/dev/null
case "${target}" in
i[3456789]86-*-netware*)
target_makefile_frag="config/mt-netware"
;;
powerpc-*-netware*)
*-*-netware*)
target_makefile_frag="config/mt-netware"
;;
*-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu)

View File

@ -419,8 +419,8 @@ case "${target}" in
;;
esac
;;
*-*-netware)
noconfigdirs="$noconfigdirs target-libstdc++-v3 target-newlib target-libiberty target-libgloss ${libgcj}"
*-*-netware*)
noconfigdirs="$noconfigdirs target-newlib target-libiberty target-libgloss ${libgcj} target-libmudflap"
;;
*-*-rtems*)
noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
@ -1441,10 +1441,7 @@ extra_nmflags_for_target=
extra_ranlibflags_for_target=
target_makefile_frag=/dev/null
case "${target}" in
i[[3456789]]86-*-netware*)
target_makefile_frag="config/mt-netware"
;;
powerpc-*-netware*)
*-*-netware*)
target_makefile_frag="config/mt-netware"
;;
*-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu)

View File

@ -1,3 +1,9 @@
2004-09-03 Jan Beulich <jbeulich@novell.com>
* inclhack.def: Suppress exception_structure and math_exception
for NetWare headers.
* fixincl.x: Regenerate.
2004-08-31 Paolo Bonzini <bonzini@gnu.org>
* .cvsignore: New.

View File

@ -1812,7 +1812,7 @@ tSCC zException_StructureSelect0[] =
* content bypass pattern - skip fix if pattern found
*/
tSCC zException_StructureBypass0[] =
"matherr.*(struct exception|__MATH_EXCEPTION)";
"matherr.*(struct exception|__MATH_EXCEPTION|[ \\t]*__FP_EXCEPTION[ \\t]*\\*[ \\t]*)";
#define EXCEPTION_STRUCTURE_TEST_CT 2
static tTestDesc aException_StructureTests[] = {
@ -3503,7 +3503,7 @@ tSCC zMath_ExceptionSelect0[] =
* content bypass pattern - skip fix if pattern found
*/
tSCC zMath_ExceptionBypass0[] =
"We have a problem when using C\\+\\+";
"We have a problem when using C\\+\\+|for C\\+\\+, _[a-z0-9A-Z_]+_exception; for C, exception";
#define MATH_EXCEPTION_TEST_CT 2
static tTestDesc aMath_ExceptionTests[] = {

View File

@ -1054,7 +1054,7 @@ fix = {
files = math.h;
/* If matherr has a prototype already, the header needs no fix. */
bypass = 'matherr.*(struct exception|__MATH_EXCEPTION)';
bypass = 'matherr.*(struct exception|__MATH_EXCEPTION|[ \t]*__FP_EXCEPTION[ \t]*\*[ \t]*)';
select = matherr;
c_fix = wrap;
@ -1950,7 +1950,7 @@ fix = {
* exception either. So currently we bypass only for glibc, based on a
* comment in the fixed glibc header. Ick.
*/
bypass = 'We have a problem when using C\+\+';
bypass = 'We have a problem when using C\+\+|for C\+\+, _[a-z0-9A-Z_]+_exception; for C, exception';
c_fix = wrap;
c_fix_arg = "#ifdef __cplusplus\n"

View File

@ -4,6 +4,24 @@
is only one reg.
(ia64_function_value): Ditto.
2004-09-03 Jan Beulich <jbeulich@novell.com>
* config.gcc: Resurrect NetWare as a target. Handle special case of
Novell linker to be used (specified through --with-ld=) and threading
model of either Posix (default) or NKS.
* config/i386/i386.c (ix86_return_pops_args): Conditionalize popping
of incoming hidden argument on KEEP_AGGREGATE_RETURN_POINTER.
* config/i386/i386.h (KEEP_AGGREGATE_RETURN_POINTER): New.
* config/i386/netware.c, config/i386/netware.h: New.
* config/i386/nwld.c, config/i386/nwld.h: New.
* config/i386/netware-crt0.c: New.
* config/i386/netware-libgcc.c: New.
* config/i386/netware-libgcc.def: New.
* config/i386/netware-libgcc.exp: New.
* config/i386/t-netware, config/i386/t-nwld: New.
* gthr-nks.h: New.
* doc/install.texi: Document NKS threading model.
2004-09-03 Jan Beulich <jbeulich@novell.com>
PR c/7054

View File

@ -970,6 +970,25 @@ i[34567]86-*-lynxos*)
gnu_ld=yes
gas=yes
;;
i[3456x]86-*-netware*)
tm_file="${tm_file} i386/unix.h i386/att.h elfos.h svr4.h tm-dwarf2.h i386/netware.h"
tmake_file=i386/t-netware
extra_objs=netware.o
case /${with_ld} in
*/nwld)
extra_objs="$extra_objs nwld.o"
tm_file="${tm_file} i386/nwld.h"
tmake_file="${tmake_file} i386/t-nwld"
extra_parts="crt0.o libgcc.def libc.def libcpre.def posixpre.def"
;;
esac
case x${enable_threads} in
x | xyes | xposix) thread_file='posix';;
xnks) thread_file='nks';;
xno) ;;
*) echo 'Unknown thread configuration for NetWare' >&2; exit 1;;
esac
;;
i[34567]86-*-nto-qnx*)
tm_file="${tm_file} i386/att.h dbxelf.h tm-dwarf2.h elfos.h svr4.h i386/unix.h i386/nto.h"
tmake_file=i386/t-nto

View File

@ -1875,7 +1875,8 @@ ix86_return_pops_args (tree fundecl, tree funtype, int size)
/* Lose any fake structure return argument if it is passed on the stack. */
if (aggregate_value_p (TREE_TYPE (funtype), fundecl)
&& !TARGET_64BIT)
&& !TARGET_64BIT
&& !KEEP_AGGREGATE_RETURN_POINTER)
{
int nregs = ix86_function_regparm (funtype, fundecl);

View File

@ -1243,6 +1243,8 @@ do { \
/* This is overridden by <cygwin.h>. */
#define MS_AGGREGATE_RETURN 0
/* This is overridden by <netware.h>. */
#define KEEP_AGGREGATE_RETURN_POINTER 0
/* Define the classes of registers for register constraints in the
machine description. Also define ranges of constants.

View File

@ -0,0 +1,77 @@
/* Startup routines for NetWare.
Contributed by Jan Beulich (jbeulich@novell.com)
Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <stddef.h>
#include <stdint.h>
#include "unwind-dw2-fde.h"
#define SECTION_DECL(name, decl) decl __attribute__((__section__(name)))
SECTION_DECL(".ctors", void(*const __CTOR_LIST__)(void))
= (void(*)(void))(intptr_t)-1;
SECTION_DECL(".ctors$_", void(*const __CTOR_END__)(void)) = NULL;
SECTION_DECL(".dtors", void(*const __DTOR_LIST__)(void))
= (void(*)(void))(intptr_t)-1;
SECTION_DECL(".dtors$_", void(*const __DTOR_END__)(void)) = NULL;
/* No need to use the __[de]register_frame_info_bases functions since
for us the bases are NULL always anyway. */
void __register_frame_info (const void *, struct object *)
__attribute__((__weak__));
void *__deregister_frame_info (const void *) __attribute__((__weak__));
SECTION_DECL(".eh_frame", /*const*/ uint32_t __EH_FRAME_BEGIN__[]) = { };
SECTION_DECL(".eh_frame$_", /*const*/ uint32_t __EH_FRAME_END__[]) = {0};
int
__init_environment (void *unused __attribute__((__unused__)))
{
void (* const * pctor)(void);
static struct object object;
if (__register_frame_info)
__register_frame_info (__EH_FRAME_BEGIN__, &object);
for (pctor = &__CTOR_END__ - 1; pctor > &__CTOR_LIST__; --pctor)
if (*pctor != NULL)
pctor();
return 0;
}
int
__deinit_environment (void *unused __attribute__((__unused__)))
{
/* This should be static to prevent calling the same destructor
twice (just in case where we get here multiple times). */
static void (* const * pdtor)(void) = &__DTOR_LIST__ + 1;
while (pdtor < &__DTOR_END__)
if (*pdtor++ != NULL)
pdtor[-1] ();
if (__deregister_frame_info)
__deregister_frame_info(__EH_FRAME_BEGIN__);
return 0;
}

View File

@ -0,0 +1,59 @@
/* Startup code for libgcc_s.nlm, necessary because we can't allow
libgcc_s to use libc's malloc & Co., which associate allocations
with the NLM owning the current (application) thread.
Contributed by Jan Beulich (jbeulich@novell.com)
Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <netware.h>
#include <stddef.h>
#include <stdlib.h>
#include <windows.h>
static rtag_t allocRTag;
BOOL
DllMain (HINSTANCE libraryId __attribute__ ((__unused__)),
DWORD reason, void *hModule)
{
switch (reason)
{
case DLL_NLM_STARTUP:
allocRTag = AllocateResourceTag (hModule,
"libgcc memory", AllocSignature);
return allocRTag != NULL;
case DLL_NLM_SHUTDOWN:
/* This does not recover resources associated with the tag...
ReturnResourceTag (allocRTag, 0); */
break;
}
return 1;
}
void *
malloc (size_t size)
{
return AllocSleepOK (size, allocRTag, NULL);
}
void
free (void *ptr)
{
Free (ptr);
}

View File

@ -0,0 +1,2 @@
description "gcc runtime and intrinsics support"
copyright "Copyright (C) 1989-2004 Free Software Foundation, Inc."

View File

@ -0,0 +1,62 @@
# libgcc_s.nlm exports
(libgcc2),
__absvdi2,
__absvsi2,
__addvdi3,
__addvsi3,
# __ashldi3,
# __ashrdi3,
__clzdi2,
__clzsi2,
__ctzdi2,
__ctzsi2,
__deregister_frame,
__deregister_frame_info,
__deregister_frame_info_bases,
# __divdi3,
__ffsdi2,
__ffssi2,
__fixunsdfdi,
__fixunssfdi,
# __fixunstfdi,
__fixunsxfdi,
__gcc_bcmp,
__gcc_personality_v0,
# __lshrdi3,
# __moddi3,
# __muldi3,
__mulvdi3,
__mulvsi3,
__negvdi2,
__negvsi2,
__paritydi2,
__paritysi2,
__popcountdi2,
__popcountsi2,
__register_frame,
__register_frame_info,
__register_frame_info_bases,
__register_frame_info_table,
__register_frame_info_table_bases,
__register_frame_table,
__subvdi3,
__subvsi3,
# __umoddi3,
# __udivdi3,
_Unwind_Backtrace,
_Unwind_DeleteException,
_Unwind_FindEnclosingFunction,
_Unwind_Find_FDE,
_Unwind_ForcedUnwind,
_Unwind_GetCFA,
_Unwind_GetDataRelBase,
_Unwind_GetGR,
_Unwind_GetIP,
_Unwind_GetLanguageSpecificData,
_Unwind_GetRegionStart,
_Unwind_GetTextRelBase,
_Unwind_RaiseException,
_Unwind_Resume,
_Unwind_Resume_or_Rethrow,
_Unwind_SetGR,
_Unwind_SetIP

209
gcc/config/i386/netware.c Normal file
View File

@ -0,0 +1,209 @@
/* Subroutines for insn-output.c for NetWare.
Contributed by Jan Beulich (jbeulich@novell.com)
Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
#include "rtl.h"
#include "regs.h"
#include "hard-reg-set.h"
#include "output.h"
#include "tree.h"
#include "flags.h"
#include "tm_p.h"
#include "toplev.h"
#include "ggc.h"
/* Return string which is the former assembler name modified with an
underscore prefix and a suffix consisting of an atsign (@) followed
by the number of bytes of arguments */
static const char *
gen_stdcall_decoration (tree decl)
{
unsigned total = 0;
/* ??? This probably should use XSTR (XEXP (DECL_RTL (decl), 0), 0) instead
of DECL_ASSEMBLER_NAME. */
const char *asmname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
char *newsym;
if (TYPE_ARG_TYPES (TREE_TYPE (decl)))
if (TREE_VALUE (tree_last (TYPE_ARG_TYPES (TREE_TYPE (decl))))
== void_type_node)
{
tree formal_type = TYPE_ARG_TYPES (TREE_TYPE (decl));
/* Quit if we hit an incomplete type. Error is reported
by convert_arguments in c-typeck.c or cp/typeck.c. */
while (TREE_VALUE (formal_type) != void_type_node
&& COMPLETE_TYPE_P (TREE_VALUE (formal_type)))
{
unsigned parm_size
= TREE_INT_CST_LOW (TYPE_SIZE (TREE_VALUE (formal_type)));
/* Must round up to include padding. This is done the same
way as in store_one_arg. */
parm_size = ((parm_size + PARM_BOUNDARY - 1)
/ PARM_BOUNDARY * PARM_BOUNDARY);
total += parm_size;
formal_type = TREE_CHAIN (formal_type);
}
}
newsym = alloca (1 + strlen (asmname) + 1 + 10 + 1);
return IDENTIFIER_POINTER (get_identifier_with_length (newsym,
sprintf (newsym, "_%s@%u", asmname, total / BITS_PER_UNIT)));
}
/* Return string which is the former assembler name modified with a
prefix consisting of FASTCALL_PREFIX and a suffix consisting of an
atsign (@) followed by the number of bytes of arguments. */
static const char *
gen_fastcall_decoration (tree decl)
{
unsigned total = 0;
const char *asmname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
char *newsym;
if (TYPE_ARG_TYPES (TREE_TYPE (decl)))
if (TREE_VALUE (tree_last (TYPE_ARG_TYPES (TREE_TYPE (decl))))
== void_type_node)
{
tree formal_type = TYPE_ARG_TYPES (TREE_TYPE (decl));
/* Quit if we hit an incomplete type. Error is reported
by convert_arguments in c-typeck.c or cp/typeck.c. */
while (TREE_VALUE (formal_type) != void_type_node
&& COMPLETE_TYPE_P (TREE_VALUE (formal_type)))
{
int parm_size
= TREE_INT_CST_LOW (TYPE_SIZE (TREE_VALUE (formal_type)));
/* Must round up to include padding. This is done the same
way as in store_one_arg. */
parm_size = ((parm_size + PARM_BOUNDARY - 1)
/ PARM_BOUNDARY * PARM_BOUNDARY);
total += parm_size;
formal_type = TREE_CHAIN (formal_type);
}
}
newsym = alloca (1 + strlen (asmname) + 1 + 10 + 1);
return IDENTIFIER_POINTER (get_identifier_with_length (newsym,
sprintf (newsym, "%c%s@%d", FASTCALL_PREFIX, asmname,
total / BITS_PER_UNIT)));
}
/* Return string which is the former assembler name modified with an
_n@ prefix where n represents the number of arguments passed in
registers */
static const char *
gen_regparm_prefix (tree decl, unsigned nregs)
{
unsigned total = 0;
/* ??? This probably should use XSTR (XEXP (DECL_RTL (decl), 0), 0) instead
of DECL_ASSEMBLER_NAME. */
const char *asmname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
char *newsym;
if (TYPE_ARG_TYPES (TREE_TYPE (decl)))
if (TREE_VALUE (tree_last (TYPE_ARG_TYPES (TREE_TYPE (decl))))
== void_type_node)
{
tree formal_type = TYPE_ARG_TYPES (TREE_TYPE (decl));
/* Quit if we hit an incomplete type. Error is reported
by convert_arguments in c-typeck.c or cp/typeck.c. */
while (TREE_VALUE (formal_type) != void_type_node
&& COMPLETE_TYPE_P (TREE_VALUE (formal_type)))
{
unsigned parm_size
= TREE_INT_CST_LOW (TYPE_SIZE (TREE_VALUE (formal_type)));
/* Must round up to include padding. This is done the same
way as in store_one_arg. */
parm_size = ((parm_size + PARM_BOUNDARY - 1)
/ PARM_BOUNDARY * PARM_BOUNDARY);
total += parm_size;
formal_type = TREE_CHAIN (formal_type);
}
}
if (nregs > total / BITS_PER_WORD)
nregs = total / BITS_PER_WORD;
if (nregs > 9) abort();
newsym = alloca (2 + strlen (asmname) + 1 + 1);
return IDENTIFIER_POINTER (get_identifier_with_length (newsym,
sprintf (newsym, "_%u@%s", nregs, asmname)));
}
void
i386_nlm_encode_section_info (tree decl, rtx rtl, int first)
{
default_encode_section_info (decl, rtl, first);
if (first
&& TREE_CODE (decl) == FUNCTION_DECL
&& *IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)) != '*')
{
tree type_attributes = TYPE_ATTRIBUTES (TREE_TYPE (decl));
rtx rtlname = XEXP (rtl, 0);
if (GET_CODE (rtlname) == MEM)
rtlname = XEXP (rtlname, 0);
if (lookup_attribute ("stdcall", type_attributes))
XSTR (rtlname, 0) = gen_stdcall_decoration (decl);
else if (lookup_attribute ("fastcall", type_attributes))
XSTR (rtlname, 0) = gen_fastcall_decoration (decl);
else
{
tree attr = lookup_attribute ("regparm", type_attributes);
if (attr)
XSTR (rtlname, 0) =
gen_regparm_prefix (decl,
TREE_INT_CST_LOW (TREE_VALUE (TREE_VALUE (attr))));
}
}
}
/* Strip the stdcall/fastcall/regparm pre-/suffix. */
const char *
i386_nlm_strip_name_encoding (const char *str)
{
const char *name = default_strip_name_encoding (str);
if (*str != '*' && (*name == '_' || *name == '@'))
{
const char *p = strchr (name + 1, '@');
if (p)
{
++name;
if (ISDIGIT (p[1]))
name = ggc_alloc_string (name, p - name);
else if (!ISDIGIT (*name) || ++name != p)
abort();
}
}
return name;
}

156
gcc/config/i386/netware.h Normal file
View File

@ -0,0 +1,156 @@
/* Core target definitions for GCC for Intel 80x86 running Netware.
and using dwarf for the debugging format.
Copyright (C) 1993, 1994, 2004 Free Software Foundation, Inc.
Written by David V. Henkel-Wallace (gumby@cygnus.com)
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#define TARGET_VERSION fprintf (stderr, " (x86 NetWare)");
#undef CPP_SPEC
#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
#undef LIB_SPEC
#define LIB_SPEC ""
/* Kinda useless, but what the hell */
#undef LINK_SPEC
#define LINK_SPEC "%{h*} %{V} %{v:%{!V:-V}} \
%{b} %{Wl,*:%*} \
%{Qy:} %{!Qn:-Qy}"
#undef STARTFILE_SPEC
#define STARTFILE_SPEC ""
#undef ENDFILE_SPEC
#define ENDFILE_SPEC ""
#undef RELATIVE_PREFIX_NOT_LINKDIR
#undef LIBGCC_SPEC
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
builtin_define ("IAPX386"); \
builtin_define ("_M_IX86=300"); \
builtin_define ("__netware__"); \
builtin_assert ("system=netware"); \
builtin_define ("__ELF__"); \
builtin_define ("__cdecl=__attribute__((__cdecl__))"); \
builtin_define ("__stdcall=__attribute__((__stdcall__))"); \
builtin_define ("__fastcall=__attribute__((__fastcall__))"); \
if (!flag_iso) \
{ \
builtin_define ("_cdecl=__attribute__((__cdecl__))"); \
builtin_define ("_stdcall=__attribute__((__stdcall__))"); \
builtin_define ("_fastcall=__attribute__((__fastcall__))"); \
} \
} \
while (0)
#undef TARGET_CPU_DEFAULT
#define TARGET_CPU_DEFAULT TARGET_CPU_DEFAULT_pentium4
/* By default, target has a 80387, uses IEEE compatible arithmetic,
returns float values in the 387, and uses MSVC bit field layout. */
#undef TARGET_SUBTARGET_DEFAULT
#define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_IEEE_FP | \
MASK_FLOAT_RETURNS | MASK_MS_BITFIELD_LAYOUT)
#undef MATH_LIBRARY
#define MATH_LIBRARY ""
/* Align doubles and long-longs in structures on qword boundaries. */
#undef BIGGEST_FIELD_ALIGNMENT
#define BIGGEST_FIELD_ALIGNMENT 64
#undef DEFAULT_PCC_STRUCT_RETURN
#define DEFAULT_PCC_STRUCT_RETURN 0
/* Implicit arguments pointing to aggregate return values are to be
removed by the caller. */
#undef KEEP_AGGREGATE_RETURN_POINTER
#define KEEP_AGGREGATE_RETURN_POINTER 1
#undef DBX_REGISTER_NUMBER
#define DBX_REGISTER_NUMBER(n) (svr4_dbx_register_map[n])
/* Enable parsing of #pragma pack(push,<n>) and #pragma pack(pop). */
#define HANDLE_PRAGMA_PACK_PUSH_POP
/* Default structure packing is 1-byte. */
#define TARGET_DEFAULT_PACK_STRUCT 1
#undef WCHAR_TYPE
#define WCHAR_TYPE "short unsigned int"
#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE 16
#undef WINT_TYPE
#define WINT_TYPE "int"
/* A C statement (sans semicolon) to output to the stdio stream
FILE the assembler definition of uninitialized global DECL named
NAME whose size is SIZE bytes and alignment is ALIGN bytes.
Try to use asm_output_aligned_bss to implement this macro. */
#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
/* Handle special EH pointer encodings. Absolute, pc-relative, and
indirect are handled automatically. */
#define ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(FILE, ENCODING, SIZE, ADDR, DONE) \
do { \
if ((SIZE) == 4 && ((ENCODING) & 0x70) == DW_EH_PE_datarel) \
{ \
fputs (ASM_LONG, FILE); \
assemble_name (FILE, XSTR (ADDR, 0)); \
fputs (((ENCODING) & DW_EH_PE_indirect ? "@GOT" : "@GOTOFF"), FILE); \
goto DONE; \
} \
} while (0)
/* there is no TLS support in NLMs/on NetWare */
#undef HAVE_AS_TLS
#define HAS_INIT_SECTION
#undef INIT_SECTION_ASM_OP
#define CTOR_LISTS_DEFINED_EXTERNALLY
#undef READONLY_DATA_SECTION_ASM_OP
#define READONLY_DATA_SECTION_ASM_OP ".section\t.rodata"
/* Define this macro if references to a symbol must be treated
differently depending on something about the variable or
function named by the symbol (such as what section it is in).
On i386 running NetWare, modify the assembler name with an undercore (_)
prefix and a suffix consisting of an atsign (@) followed by a string of
digits that represents the number of bytes of arguments passed to the
function, if it has the attribute STDCALL. Alternatively, if it has the
REGPARM attribute, prefix it with an underscore (_), a digit representing
the number of registers used, and an atsign (@). */
void i386_nlm_encode_section_info (tree, rtx, int);
const char *i386_nlm_strip_name_encoding (const char *);
#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO i386_nlm_encode_section_info
#undef TARGET_STRIP_NAME_ENCODING
#define TARGET_STRIP_NAME_ENCODING i386_nlm_strip_name_encoding

74
gcc/config/i386/nwld.c Normal file
View File

@ -0,0 +1,74 @@
/* Subroutines for insn-output.c for NetWare.
Contributed by Jan Beulich (jbeulich@novell.com)
Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
#include "rtl.h"
#include "regs.h"
#include "hard-reg-set.h"
#include "output.h"
#include "tree.h"
#include "flags.h"
#include "tm_p.h"
#include "toplev.h"
void
nwld_named_section_asm_out_constructor (rtx symbol, int priority)
{
#if !SUPPORTS_INIT_PRIORITY
const char section[] = ".ctors"TARGET_SUB_SECTION_SEPARATOR;
#else
char section[20];
sprintf (section,
".ctors"TARGET_SUB_SECTION_SEPARATOR"%.5u",
/* Invert the numbering so the linker puts us in the proper
order; constructors are run from right to left, and the
linker sorts in increasing order. */
MAX_INIT_PRIORITY - priority);
#endif
named_section_flags (section, 0);
assemble_align (POINTER_SIZE);
assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, POINTER_SIZE, 1);
}
void
nwld_named_section_asm_out_destructor (rtx symbol, int priority)
{
#if !SUPPORTS_INIT_PRIORITY
const char section[] = ".dtors"TARGET_SUB_SECTION_SEPARATOR;
#else
char section[20];
sprintf (section, ".dtors"TARGET_SUB_SECTION_SEPARATOR"%.5u",
/* Invert the numbering so the linker puts us in the proper
order; destructors are run from left to right, and the
linker sorts in increasing order. */
MAX_INIT_PRIORITY - priority);
#endif
named_section_flags (section, 0);
assemble_align (POINTER_SIZE);
assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, POINTER_SIZE, 1);
}

59
gcc/config/i386/nwld.h Normal file
View File

@ -0,0 +1,59 @@
/* nwld.h -- defines to be used when targeting GCC for some generic NetWare
system while using the Novell linker.
Copyright (C) 2004 Free Software Foundation, Inc.
Written by Jan Beulich (jbeulich@novell.com)
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#undef LIB_SPEC
#define LIB_SPEC "-lc --def-file libc.def%s"
#undef LIBGCC_SPEC
#define LIBGCC_SPEC "-lgcc %{!static-libgcc:--def-file libgcc.def%s}"
#undef LINKER_NAME
#define LINKER_NAME "nwld"
#undef LINK_SPEC
#define LINK_SPEC "--format nlm %{static:%{!nostdlib:%{!nodefaultlib:%eStatic linking is not supported.\n}}}"
#undef LINK_GCC_C_SEQUENCE_SPEC
#define LINK_GCC_C_SEQUENCE_SPEC "%L %G"
/* In order to permit the linker to derive the output filename from the first
input file, put the common startup code as the last object. */
#undef STARTFILE_SPEC
#define STARTFILE_SPEC ""
#undef ENDFILE_SPEC
#define ENDFILE_SPEC "crt0%O%s ../imports/%{!posix:libc}%{posix:posix}pre.gcc%O%s" \
" --def-file %{!posix:libc}%{posix:posix}pre.def%s"
#define DRIVER_SELF_SPECS "%{!static-libgcc:-shared-libgcc}"
#define TARGET_SUB_SECTION_SEPARATOR "$"
void nwld_named_section_asm_out_constructor (rtx, int);
void nwld_named_section_asm_out_destructor (rtx, int);
#define TARGET_ASM_CONSTRUCTOR nwld_named_section_asm_out_constructor
#define TARGET_ASM_DESTRUCTOR nwld_named_section_asm_out_destructor
#undef EH_FRAME_SECTION_NAME
#define EH_FRAME_SECTION_NAME ".eh_frame"TARGET_SUB_SECTION_SEPARATOR

10
gcc/config/i386/t-netware Normal file
View File

@ -0,0 +1,10 @@
TARGET_LIBGCC2_CFLAGS = -mpreferred-stack-boundary=2 -fomit-frame-pointer
netware.o: $(srcdir)/config/i386/netware.c $(RTL_H) $(TREE_H) $(CONFIG_H) $(TM_P_H)
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/i386/netware.c
# We don't need some of GCC's own include files.
USER_H = $(srcdir)/ginclude/stdarg.h \
$(srcdir)/ginclude/varargs.h \
$(srcdir)/unwind.h \
$(EXTRA_HEADERS) $(LANG_EXTRA_HEADERS)

60
gcc/config/i386/t-nwld Normal file
View File

@ -0,0 +1,60 @@
CRTSTUFF_T_CFLAGS = -mpreferred-stack-boundary=2
CRT0STUFF_T_CFLAGS = -mpreferred-stack-boundary=2 $(INCLUDES)
# this is a slight misuse (it's not an assembler file)
CRT0_S = $(srcdir)/config/i386/netware-crt0.c
MCRT0_S = $(srcdir)/config/i386/netware-crt0.c
libgcc.def: $(srcdir)/config/i386/t-nwld
echo "module libgcc_s" >$@
libc.def: $(srcdir)/config/i386/t-nwld
echo "module libc" >$@
libcpre.def: $(srcdir)/config/i386/t-nwld
echo "start _LibCPrelude" >$@
echo "exit _LibCPostlude" >>$@
echo "check _LibCCheckUnload" >>$@
posixpre.def: $(srcdir)/config/i386/t-nwld
echo "start POSIX_Start" >$@
echo "exit POSIX_Stop" >>$@
echo "check POSIX_CheckUnload" >>$@
nwld.o: $(srcdir)/config/i386/nwld.c $(RTL_H) $(TREE_H) $(CONFIG_H) $(TM_P_H)
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/i386/nwld.c
s-crt0: $(srcdir)/unwind-dw2-fde.h
# Build a shared libgcc library for NetWare.
SHLIB_EXT = .nlm
SHLIB_SONAME = @shlib_so_name@.nlm
SHLIB_NAME = @shlib_dir@@shlib_so_name@.nlm
SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@
SHLIB_DEF = $(srcdir)/config/i386/netware-libgcc.def
SHLIB_MAP = $(srcdir)/config/i386/netware-libgcc.exp
SHLIB_SRC = $(srcdir)/config/i386/netware-libgcc.c
SHLIB_LINK = set -e; \
cat $(SHLIB_DEF) >@shlib_so_name@.def; \
echo "version $(gcc_version)" | sed "s!\.!,!g" >>@shlib_so_name@.def; \
touch libgcc/build; \
echo "build $$$$(($$$$(<libgcc/build)+0))" >>@shlib_so_name@.def; \
echo "export @$(SHLIB_MAP)" >>@shlib_so_name@.def; \
if mpkxdc -n -p @shlib_so_name@.xdc; \
then echo "xdcdata @shlib_so_name@.xdc" >>@shlib_so_name@.def; \
else echo "WARNING: $(SHLIB_NAME) built without XDC data will not work well." 1>&2; \
fi; \
$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -o $(SHLIB_NAME) \
$(SHLIB_SRC) -static-libgcc -lnetware \
-Wl,--Map,--map-info,full,--strip-all,--def-file,@shlib_so_name@.def; \
rm -f @shlib_so_name@.imp; $(LN_S) $(SHLIB_MAP) @shlib_so_name@.imp; \
echo $$$$(($$$$(<libgcc/build)+1)) >libgcc/build
# $(slibdir) double quoted to protect it from expansion while building
# libgcc.mk. We want this delayed until actual install time.
SHLIB_INSTALL = \
$$(SHELL) $(srcdir)/mkinstalldirs $$(slibdir)$(SHLIB_SLIBDIR_QUAL); \
$$(INSTALL_DATA) $(SHLIB_NAME) $$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SONAME); \
$$(INSTALL_DATA) @shlib_so_name@.imp $$(DESTDIR)$$(libsubdir)/

View File

@ -1,3 +1,8 @@
2004-09-03 Jan Beulich <jbeulich@novell.com>
* g++spec.c (MATH_LIBRARY_PROFILE): Default to MATH_LIBRARY rather
than "-lm".
2004-09-02 Paul Brook <paul@codesourcery.com>
* decl2.c (determine_visibility): Only check data visibility

View File

@ -36,7 +36,7 @@ Boston, MA 02111-1307, USA. */
#define MATH_LIBRARY "-lm"
#endif
#ifndef MATH_LIBRARY_PROFILE
#define MATH_LIBRARY_PROFILE "-lm"
#define MATH_LIBRARY_PROFILE MATH_LIBRARY
#endif
#ifndef LIBSTDCXX

View File

@ -937,6 +937,8 @@ Sun Solaris 2 thread support.
VxWorks thread support.
@item win32
Microsoft Win32 API thread support.
@item nks
Novell Kernel Services thread support.
@end table
@item --with-cpu=@var{cpu}

364
gcc/gthr-nks.h Normal file
View File

@ -0,0 +1,364 @@
/* Threads compatibility routines for libgcc2 and libobjc. */
/* Compile this one with gcc. */
/* Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* As a special exception, if you link this library with other files,
some of which are compiled with GCC, to produce an executable,
this library does not by itself cause the resulting executable
to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why
the executable file might be covered by the GNU General Public License. */
#ifndef __gthr_nks_h
#define __gthr_nks_h
/* NKS threads specific definitions.
Easy, since the interface is mostly one-to-one mapping. */
#define __GTHREADS 1
#define NKS_NO_INLINE_FUNCS
#include <nksapi.h>
#include <string.h>
typedef NXKey_t __gthread_key_t;
typedef NXMutex_t *__gthread_mutex_t;
#define __GTHREAD_MUTEX_INIT_FUNCTION __gthread_mutex_init_function
static inline int
__gthread_active_p (void)
{
return 1;
}
#ifdef _LIBOBJC
/* This is the config.h file in libobjc/ */
#include <config.h>
#ifdef HAVE_SCHED_H
# include <sched.h>
#endif
/* Key structure for maintaining thread specific storage */
static NXKey_t _objc_thread_storage;
/* Backend initialization functions */
/* Initialize the threads subsystem. */
static inline int
__gthread_objc_init_thread_system(void)
{
/* Initialize the thread storage key */
if (NXKeyCreate(NULL, NULL, &_objc_thread_storage) == 0)
return 0;
return -1;
}
/* Close the threads subsystem. */
static inline int
__gthread_objc_close_thread_system(void)
{
if (NXKeyDelete(_objc_thread_storage) == 0)
return 0;
return -1;
}
/* Backend thread functions */
/* Create a new thread of execution. */
static inline objc_thread_t
__gthread_objc_thread_detach(void (*func)(void *), void *arg)
{
objc_thread_t thread_id;
NXContext_t context;
NXThreadId_t new_thread_handle;
int err;
if ((context = NXContextAlloc(func, arg, NX_PRIO_MED, 0, 0, 0, &err)) == NULL)
thread_id = NULL;
else if (NXThreadCreate(context, NX_THR_DETACHED, &new_thread_handle) == 0)
thread_id = (objc_thread_t) new_thread_handle;
else {
NXContextFree(context);
thread_id = NULL;
}
return thread_id;
}
/* Set the current thread's priority. */
static inline int
__gthread_objc_thread_set_priority(int priority)
{
if (NXThreadSetPriority(NXThreadGetId(), priority) == 0)
return 0;
return -1;
}
/* Return the current thread's priority. */
static inline int
__gthread_objc_thread_get_priority(void)
{
int priority;
if (NXThreadGetPriority(NXThreadGetId(), &priority) == 0)
return priority;
return -1;
}
/* Yield our process time to another thread. */
static inline void
__gthread_objc_thread_yield(void)
{
NXThreadYield();
}
/* Terminate the current thread. */
static inline int
__gthread_objc_thread_exit(void)
{
/* exit the thread */
NXThreadExit(&__objc_thread_exit_status);
/* Failed if we reached here */
return -1;
}
/* Returns an integer value which uniquely describes a thread. */
static inline objc_thread_t
__gthread_objc_thread_id(void)
{
(objc_thread_t) NXThreadGetId();
}
/* Sets the thread's local storage pointer. */
static inline int
__gthread_objc_thread_set_data(void *value)
{
return NXKeySetValue(_objc_thread_storage, value);
}
/* Returns the thread's local storage pointer. */
static inline void *
__gthread_objc_thread_get_data(void)
{
void *value;
if (NXKeyGetValue(_objc_thread_storage, &value) == 0)
return value;
return NULL;
}
/* Backend mutex functions */
/* Allocate a mutex. */
static inline int
__gthread_objc_mutex_allocate(objc_mutex_t mutex)
{
static const NX_LOCK_INFO_ALLOC(info, "GNU ObjC", 0);
if ((mutex->backend = NXMutexAlloc(NX_MUTEX_RECURSIVE/*???*/, 0, &info)) == NULL)
return 0;
return -1;
}
/* Deallocate a mutex. */
static inline int
__gthread_objc_mutex_deallocate(objc_mutex_t mutex)
{
while(NXMutexIsOwned((NXMutex_t *)mutex->backend))
NXUnlock((NXMutex_t *)mutex->backend);
if (NXMutexFree((NXMutex_t *)mutex->backend) != 0)
return -1;
mutex->backend = NULL;
return 0;
}
/* Grab a lock on a mutex. */
static inline int
__gthread_objc_mutex_lock(objc_mutex_t mutex)
{
return NXLock((NXMutex_t *)mutex->backend);
}
/* Try to grab a lock on a mutex. */
static inline int
__gthread_objc_mutex_trylock(objc_mutex_t mutex)
{
if (!NXTryLock((NXMutex_t *)mutex->backend))
return -1;
return 0;
}
/* Unlock the mutex */
static inline int
__gthread_objc_mutex_unlock(objc_mutex_t mutex)
{
return NXUnlock((NXMutex_t *)mutex->backend);
}
/* Backend condition mutex functions */
/* Allocate a condition. */
static inline int
__gthread_objc_condition_allocate(objc_condition_t condition)
{
condition->backend = NXCondAlloc(NULL);
if (condition->backend == NULL)
return -1;
return 0;
}
/* Deallocate a condition. */
static inline int
__gthread_objc_condition_deallocate(objc_condition_t condition)
{
if (NXCondFree((NXCond_t *)condition->backend) != 0)
return -1;
condition->backend = NULL;
return 0;
}
/* Wait on the condition */
static inline int
__gthread_objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
{
return NXCondWait((NXCond_t *)condition->backend, (NXMutex_t *)mutex->backend);
}
/* Wake up all threads waiting on this condition. */
static inline int
__gthread_objc_condition_broadcast(objc_condition_t condition)
{
return NXCondBroadcast((NXCond_t *)condition->backend);
}
/* Wake up one thread waiting on this condition. */
static inline int
__gthread_objc_condition_signal(objc_condition_t condition)
{
return NXCondSignal((NXCond_t *)condition->backend);
}
#else /* _LIBOBJC */
#if defined(__cplusplus)
# include <bits/atomicity.h>
/* The remaining conditions here are temporary until there is
an application accessible atomic operations API set... */
#elif defined(_M_IA64) || defined(__ia64__)
# include <../libstdc++-v3/config/cpu/ia64/bits/atomicity.h>
#elif defined(_M_IX86) || defined(__i486__)
# include <../libstdc++-v3/config/cpu/i486/bits/atomicity.h>
#elif defined(_M_AMD64) || defined(__x86_64__)
# include <../libstdc++-v3/config/cpu/x86-64/bits/atomicity.h>
#endif
typedef volatile long __gthread_once_t;
#define __GTHREAD_ONCE_INIT 0
static inline int
__gthread_once (__gthread_once_t *once, void (*func) (void))
{
if (__compare_and_swap(once, 0, 1))
{
func();
*once |= 2;
}
else
{
while(!(*once & 2))
NXThreadYield();
}
return 0;
}
static inline int
__gthread_key_create (__gthread_key_t *key, void (*dtor) (void *))
{
return NXKeyCreate (dtor, NULL, key);
}
static inline int
__gthread_key_dtor (__gthread_key_t key, void *ptr)
{
/* Just reset the key value to zero. */
if (ptr)
return NXKeySetValue (key, NULL);
return 0;
}
static inline int
__gthread_key_delete (__gthread_key_t key)
{
return NXKeyDelete (key);
}
static inline void *
__gthread_getspecific (__gthread_key_t key)
{
void *value;
if (NXKeyGetValue(key, &value) == 0)
return value;
return NULL;
}
static inline int
__gthread_setspecific (__gthread_key_t key, const void *ptr)
{
return NXKeySetValue(key, (void *)ptr);
}
static inline void
__gthread_mutex_init_function (__gthread_mutex_t *mutex)
{
static const NX_LOCK_INFO_ALLOC(info, "GTHREADS", 0);
*mutex = NXMutexAlloc (NX_MUTEX_RECURSIVE/*???*/, 0, &info);
}
static inline int
__gthread_mutex_lock (__gthread_mutex_t *mutex)
{
return NXLock(*mutex);
}
static inline int
__gthread_mutex_trylock (__gthread_mutex_t *mutex)
{
if (NXTryLock(*mutex))
return 0;
return -1;
}
static inline int
__gthread_mutex_unlock (__gthread_mutex_t *mutex)
{
return NXUnlock(*mutex);
}
#endif /* _LIBOBJC */
#endif /* not __gthr_nks_h */

View File

@ -1,3 +1,27 @@
2004-09-03 Jan Beulich <jbeulich@novell.com>
* g++.dg/abi/bitfield5.C: Use -mno-ms-bitfields.
* g++.old-deja/g++.jason/thunk2.C: xfail for NetWare.
* g++.old-deja/g++.law/profile1.C: xfail for NetWare.
* g++.old-deja/g++.other/store-expr1.C: xfail for NetWare.
* gcc.c-torture/compile/20001109-1.c: xfail for NetWare.
* gcc.c-torture/compile/20001109-2.c: xfail for NetWare.
* gcc.c-torture/execute/multi-ix.c: Use __builtin_bzero rather than
the non-portable bzero.
* gcc.dg/20010912-1.c: xfail for NetWare.
* gcc.dg/20020426-2.c: xfail for NetWare.
* gcc.dg/20021014-1.c: xfail for NetWare.
* gcc.dg/20021018-1.c: xfail for NetWare.
* gcc.dg/20030213-1.c: xfail for NetWare.
* gcc.dg/20030225-1.c: xfail for NetWare.
* gcc.dg/20030708-1.c: xfail for NetWare.
* gcc.dg/builtins-config.h: Also exclude NetWare.
* gcc.dg/format/format.h: Define restrict only if not already defined.
* gcc.dg/nest.c: xfail for NetWare.
* gcc.dg/special/gcsec-1.c: Don't pass -static for NetWare.
* lib/target-supports.exp (check_visibility_available): Exclude
NetWare.
2004-09-03 Jan Beulich <jbeulich@novell.com>
* gcc.dg/pack-test-2.c: Adjust to permit and check #pragma pack(push).

View File

@ -1,5 +1,6 @@
// { dg-do compile }
// { dg-options "-Wabi -fabi-version=1" }
// { dg-options "-Wabi -fabi-version=1 -mno-ms-bitfields" { target i?86-*-* x86_64-*-* } }
struct A {
virtual void f();

View File

@ -1,5 +1,6 @@
// { dg-do run }
// { dg-options "-fPIC" }
// { dg-bogus "\[Uu\]nresolved symbol .(_GLOBAL_OFFSET_TABLE_|\[_.A-Za-z\]\[_.0-9A-Za-z\]*@(PLT|GOT|GOTOFF))" "PIC unsupported" { xfail *-*-netware* } 0 }
// Test that non-variadic function calls using thunks and PIC work right.
struct A {

View File

@ -2,6 +2,7 @@
// { dg-require-profiling "-pg" }
// { dg-options "-pg" }
// { dg-options "-pg -static" { target hppa*-*-hpux* } }
// { dg-bogus "\[Uu\]nresolved symbol ._mcount" "Profiling unsupported" { xfail *-*-netware* } 0 }
// GROUPS passed profiling
#include <stdio.h>
main()

View File

@ -1,5 +1,6 @@
// { dg-do run { target i?86-*-* } }
// { dg-options "-mtune=i686 -O2 -fpic" }
// { dg-bogus "\[Uu\]nresolved symbol .(_GLOBAL_OFFSET_TABLE_|\[_.A-Za-z\]\[_.0-9A-Za-z\]*@(PLT|GOT|GOTOFF))" "PIC unsupported" { xfail *-*-netware* } 0 }
class G {};
struct N {

View File

@ -1,3 +1,5 @@
/* This does not work on NetWare, which has a default of 1-byte alignment. */
/* { dg-xfail-if "" { "*-*-netware*" } { "*" } { "" } } */
typedef struct _foo foo;
extern foo bar;
struct _foo {

View File

@ -1,3 +1,5 @@
/* This does not work on NetWare, which has a default of 1-byte alignment. */
/* { dg-xfail-if "" { "*-*-netware*" } { "*" } { "" } } */
extern struct foo bar;
struct foo {
int a;

View File

@ -161,7 +161,7 @@ void z(int n, ...)
while (n--)
{
int *a = va_arg (list, int *);
bzero (a, sizeof (l));
__builtin_bzero (a, sizeof (l));
}
va_end (list);
}

View File

@ -1,6 +1,7 @@
/* { dg-do run } */
/* { dg-options "-O2 -fpic" } */
/* { dg-warning "not supported" "PIC unsupported" { target cris-*-elf* cris-*-aout* mmix-*-* } 0 } */
/* { dg-bogus "\[Uu\]nresolved symbol .(_GLOBAL_OFFSET_TABLE_|\[_.A-Za-z\]\[_.0-9A-Za-z\]*@(PLT|GOT|GOTOFF))" "PIC unsupported" { xfail *-*-netware* } 0 } */
extern void abort (void);
extern void exit (int);

View File

@ -3,6 +3,7 @@
/* { dg-do run } */
/* { dg-options "-O2" } */
/* { dg-options "-O2 -frename-registers -fomit-frame-pointer -fPIC -mtune=i686" { target i?86-*-* } } */
/* { dg-bogus "\[Uu\]nresolved symbol .(_GLOBAL_OFFSET_TABLE_|\[_.A-Za-z\]\[_.0-9A-Za-z\]*@(PLT|GOT|GOTOFF))" "PIC unsupported" { xfail *-*-netware* } 0 } */
extern void exit (int);

View File

@ -4,6 +4,7 @@
/* { dg-options "-O2 -p -static" { target hppa*-*-hpux* } } */
/* { dg-error "profiler" "No profiler support" { target xstormy16-*-* } 0 } */
/* { dg-error "" "consider using `-pg' instead of `-p' with gprof(1)" { target *-*-freebsd* } 0 } */
/* { dg-bogus "\[Uu\]nresolved symbol ._mcount" "Profiling unsupported" { xfail *-*-netware* } 0 } */
extern void abort (void);
extern void exit (int);

View File

@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -fpic" } */
/* { dg-bogus "\[Uu\]nresolved symbol .(_GLOBAL_OFFSET_TABLE_|\[_.A-Za-z\]\[_.0-9A-Za-z\]*@(PLT|GOT|GOTOFF))" "PIC unsupported" { xfail *-*-netware* } 0 } */
extern void abort (void);
extern void exit (int);

View File

@ -2,6 +2,7 @@
/* { dg-do link } */
/* { dg-options "-O -fpic" } */
/* { dg-warning "not supported" "PIC unsupported" { target cris-*-elf* cris-*-aout* mmix-*-* } 0 } */
/* { dg-bogus "\[Uu\]nresolved symbol .(_GLOBAL_OFFSET_TABLE_|\[_.A-Za-z\]\[_.0-9A-Za-z\]*@(PLT|GOT|GOTOFF))" "PIC unsupported" { xfail *-*-netware* } 0 } */
int *g;

View File

@ -6,7 +6,7 @@
/* { dg-do run } */
/* { dg-options "-O2 -fPIC" } */
/* { dg-warning "not supported" "PIC unsupported" { target cris-*-elf* mmix-*-* } 0 } */
/* { dg-bogus "\[Uu\]nresolved symbol .(_GLOBAL_OFFSET_TABLE_|\[_.A-Za-z\]\[_.0-9A-Za-z\]*@(PLT|GOT|GOTOFF))" "PIC unsupported" { xfail *-*-netware* } 0 } */
extern void exit (int);

View File

@ -1,6 +1,7 @@
/* PR c/11420 */
/* { dg-do link } */
/* { dg-options "-O2 -fpic" } */
/* { dg-bogus "\[Uu\]nresolved symbol .(_GLOBAL_OFFSET_TABLE_|\[_.A-Za-z\]\[_.0-9A-Za-z\]*@(PLT|GOT|GOTOFF))" "PIC unsupported" { xfail *-*-netware* } 0 } */
void (* volatile fn) (void);
static void foo (void)

View File

@ -17,6 +17,8 @@
/* Irix6 doesn't have the entire C99 runtime. */
#elif defined(__FreeBSD__) && (__FreeBSD__ < 5)
/* FreeBSD before version 5 doesn't have the entire C99 runtime. */
#elif defined(__netware__)
/* NetWare doesn't have the entire C99 runtime. */
#else
/* Newlib has the "f" variants of the math functions, but not the "l"
variants. TARGET_C99_FUNCTIONS is only defined if all C99

View File

@ -31,7 +31,7 @@ typedef ullong u_quad_t;
__extension__ typedef __INTMAX_TYPE__ intmax_t;
__extension__ typedef __UINTMAX_TYPE__ uintmax_t;
#if __STDC_VERSION__ < 199901L
#if __STDC_VERSION__ < 199901L && !defined(restrict)
#define restrict /* "restrict" not in old C standard. */
#endif

View File

@ -5,6 +5,7 @@
/* { dg-options "-O2 -pg -static" { target hppa*-*-hpux* } } */
/* { dg-error "profiler" "No profiler support" { target xstormy16-*-* } 0 } */
/* { dg-error "-pg not supported" "Profiler support missing" { target *-*-sco3.2v5* } 0 } */
/* { dg-bogus "\[Uu\]nresolved symbol ._mcount" "Profiling unsupported" { xfail *-*-netware* } 0 } */
extern void abort (void);

View File

@ -5,6 +5,7 @@
/* { dg-options "-ffunction-sections -fdata-sections -Wl,--gc-sections -static" } */
/* { dg-options "-ffunction-sections -fdata-sections -Wl,--gc-sections -static" { target native } } */
/* { dg-options "-ffunction-sections -fdata-sections -Wl,--gc-sections" { target *-*-netware* } } */
#include <stdlib.h>

View File

@ -73,6 +73,12 @@ proc check_visibility_available { } {
global target_triplet
global target_cpu
# On NetWare, support makes no sense.
if { [string match "*-*-netware*" $target_triplet] } {
return 0
}
# ELF supports it if the system has recent GNU ld and gas.
# As a start we return 1 for all ELF systems; we'll let people
# add exceptions as necessary.
@ -157,7 +163,9 @@ proc check_gc_sections_available { } {
if {![info exists gc_sections_available_saved]} {
# Check if the ld used by gcc supports --gc-sections.
set gcc_ld [lindex [${tool}_target_compile "-print-prog-name=ld" "" "none" ""] 0]
set gcc_spec [${tool}_target_compile "-dumpspecs" "" "none" ""]
regsub ".*\n\*linker:\[ \t\]*\n(\[^ \t\n\]*).*" "$gcc_spec" {\1} linker
set gcc_ld [lindex [${tool}_target_compile "-print-prog-name=$linker" "" "none" ""] 0]
set ld_output [remote_exec host "$gcc_ld" "--help"]
if { [ string first "--gc-sections" $ld_output ] >= 0 } {
set gc_sections_available_saved 1

View File

@ -1,3 +1,8 @@
2004-09-03 Jan Beulich <jbeulich@novell.com>
* crossconfig.m4: Add NetWare as a target.
* configure: Regenerate.
2004-09-02 Mark Mitchell <mark@codesourcery.com>
* libsupc++/typeinfo: Honor __GXX_MERGED_TYPEINFO_NAMES if already

2766
libstdc++-v3/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -264,6 +264,24 @@ case "${host}" in
AC_DEFINE(HAVE_ISNANL)
fi
;;
*-netware)
AC_CHECK_HEADERS([nan.h ieeefp.h sys/isa_defs.h sys/machine.h \
sys/types.h locale.h float.h inttypes.h])
SECTION_FLAGS='-ffunction-sections -fdata-sections'
AC_SUBST(SECTION_FLAGS)
GLIBCXX_CHECK_LINKER_FEATURES
GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
GLIBCXX_CHECK_WCHAR_T_SUPPORT
# For showmanyc_helper().
AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h)
GLIBCXX_CHECK_POLL
GLIBCXX_CHECK_S_ISREG_OR_S_IFREG
# For xsputn_2().
AC_CHECK_HEADERS(sys/uio.h)
GLIBCXX_CHECK_WRITEV
;;
*-qnx6.1* | *-qnx6.2*)
SECTION_FLAGS='-ffunction-sections -fdata-sections'
AC_SUBST(SECTION_FLAGS)