diff options
author | Dave Korn <dave.korn.cygwin@gmail.com> | 2009-01-31 18:52:00 +0000 |
---|---|---|
committer | Dave Korn <davek@gcc.gnu.org> | 2009-01-31 18:52:00 +0000 |
commit | 3cbfaf984602e3b1eabba8ec279a1aceb0379224 (patch) | |
tree | 3b59fc8984e5b0cc68ebb79362688651ec1eeadc /gcc/config | |
parent | 8d0b6068b550226ed80e62af3bb5b3da171d7802 (diff) | |
download | gcc-3cbfaf984602e3b1eabba8ec279a1aceb0379224.zip gcc-3cbfaf984602e3b1eabba8ec279a1aceb0379224.tar.gz gcc-3cbfaf984602e3b1eabba8ec279a1aceb0379224.tar.bz2 |
re PR target/38904 (Shared libgcc DLL violates Cygwin platform conventions.)
PR target/38904
* mkmap-flat.awk (END): Use pe_dll command-line arg to pass
LIBRARY name in, instead of hard-coding it.
* config.gcc (i[34567]86-*-pe | i[34567]86-*-cygwin*): Add an
extra target make frag to tmake_files according to EH model.
(i[34567]86-*-mingw* | x86_64-*-mingw*): Likewise.
* config/i386/t-dw2-eh, config/i386/t-sjlj-eh: Add new target
frags that define makefile variable EH_MODEL appropriately.
* config/i386/cygming.h (DWARF2_UNWIND_INFO): Add comment.
* config/i386/cygwin.h (LIBGCC_EH_EXTN): Define to nothing or
to "-sjlj" according to type of EH configured.
(LIBGCC_SONAME): Concatenate it to shared library base name.
* config/i386/mingw32.h (LIBGCC_EH_EXTN): Define to "_dw2" or
to "_sjlj" according to type of EH configured.
(LIBGCC_SONAME): Concatenate it to shared library base name.
* config/i386/t-cygming (SHLIB_SONAME): Use EH_MODEL.
(SHLIB_LINK): Add missing semicolon to if-else construct.
(SHLIB_MKMAP_OPTS): Pass library name to mkmap-flat.awk as
string value of "pe_dll" command-line option.
* config/i386/t-cygwin (SHLIB_EH_EXTENSION): New helper.
(SHLIB_SONAME): Use it when overriding t-cygming default.
(SHLIB_IMPLIB): Override t-cygming default.
(SHLIB_MKMAP_OPTS): Pass library name to mkmap-flat.awk as
string value of "pe_dll" command-line option.
From-SVN: r143829
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/i386/cygming.h | 2 | ||||
-rw-r--r-- | gcc/config/i386/cygwin.h | 8 | ||||
-rw-r--r-- | gcc/config/i386/mingw32.h | 8 | ||||
-rw-r--r-- | gcc/config/i386/t-cygming | 12 | ||||
-rw-r--r-- | gcc/config/i386/t-cygwin | 12 | ||||
-rw-r--r-- | gcc/config/i386/t-dw2-eh | 3 | ||||
-rw-r--r-- | gcc/config/i386/t-sjlj-eh | 3 |
7 files changed, 42 insertions, 6 deletions
diff --git a/gcc/config/i386/cygming.h b/gcc/config/i386/cygming.h index 062b50a..e9250bb 100644 --- a/gcc/config/i386/cygming.h +++ b/gcc/config/i386/cygming.h @@ -283,6 +283,8 @@ do { \ /* If configured with --disable-sjlj-exceptions, use DWARF2, else default to SJLJ. */ #if (defined (CONFIG_SJLJ_EXCEPTIONS) && !CONFIG_SJLJ_EXCEPTIONS) +/* The logic of this #if must be kept synchronised with the logic + for selecting the tmake_eh_file fragment in config.gcc. */ #define DWARF2_UNWIND_INFO 1 #else #define DWARF2_UNWIND_INFO 0 diff --git a/gcc/config/i386/cygwin.h b/gcc/config/i386/cygwin.h index 9b2fd7f..0f73f00 100644 --- a/gcc/config/i386/cygwin.h +++ b/gcc/config/i386/cygwin.h @@ -259,3 +259,11 @@ while (0) and the -pthread flag is not recognized. */ #undef GOMP_SELF_SPECS #define GOMP_SELF_SPECS "" + +/* This matches SHLIB_SONAME and SHLIB_SOVERSION in t-cygwin. */ +#if DWARF2_UNWIND_INFO +#define LIBGCC_EH_EXTN "" +#else +#define LIBGCC_EH_EXTN "-sjlj" +#endif +#define LIBGCC_SONAME "cyggcc_s" LIBGCC_EH_EXTN "-1.dll" diff --git a/gcc/config/i386/mingw32.h b/gcc/config/i386/mingw32.h index 571277e..43f5a05 100644 --- a/gcc/config/i386/mingw32.h +++ b/gcc/config/i386/mingw32.h @@ -212,4 +212,10 @@ __enable_execute_stack (void *addr) \ #endif /* This matches SHLIB_SONAME and SHLIB_SOVERSION in t-cygming. */ -#define LIBGCC_SONAME "libgcc_s_1.dll" +/* This matches SHLIB_SONAME and SHLIB_SOVERSION in t-cygwin. */ +#if DWARF2_UNWIND_INFO +#define LIBGCC_EH_EXTN "_dw2" +#else +#define LIBGCC_EH_EXTN "_sjlj" +#endif +#define LIBGCC_SONAME "libgcc_s" LIBGCC_EH_EXTN "-1.dll" diff --git a/gcc/config/i386/t-cygming b/gcc/config/i386/t-cygming index 5efd82e..e26462f 100644 --- a/gcc/config/i386/t-cygming +++ b/gcc/config/i386/t-cygming @@ -43,13 +43,13 @@ STMP_FIXINC=stmp-fixinc # mkmap-flat.awk is used with the pe_dll option to produce a DEF instead # of an ELF map file. # -# Warning: If SHLIB_SOVERSION or SHLIB_SONAME is updated, LIBGCC_SONAME -# in mingw32.h must be updated also. +# Warning: If SHLIB_SOVERSION or SHLIB_SONAME are updated, LIBGCC_SONAME +# in mingw32.h and SHLIB_MKMAP_OPTS below must be updated also. SHLIB_EXT = .dll SHLIB_IMPLIB = @shlib_base_name@.a SHLIB_SOVERSION = 1 -SHLIB_SONAME = @shlib_base_name@_$(SHLIB_SOVERSION)$(SHLIB_EXT) +SHLIB_SONAME = @shlib_base_name@_$(EH_MODEL)-$(SHLIB_SOVERSION)$(SHLIB_EXT) SHLIB_MAP = @shlib_map_file@ SHLIB_OBJS = @shlib_objs@ SHLIB_DIR = @multilib_dir@/shlib @@ -57,7 +57,7 @@ SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@ SHLIB_LINK = $(LN_S) -f $(SHLIB_MAP) $(SHLIB_MAP).def && \ if [ ! -d $(SHLIB_DIR) ]; then \ - mkdir $(SHLIB_DIR) \ + mkdir $(SHLIB_DIR); \ else true; fi && \ $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \ $(SHLIB_MAP).def \ @@ -79,5 +79,7 @@ SHLIB_INSTALL = \ $(INSTALL_DATA) $(SHLIB_DIR)/$(SHLIB_IMPLIB) \ $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_IMPLIB) SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk -SHLIB_MKMAP_OPTS = -v pe_dll=1 +# We'd like to use SHLIB_SONAME here too, but shlib_base_name +# does not get substituted before mkmap-flat.awk is run. +SHLIB_MKMAP_OPTS = -v pe_dll=libgcc_s_$(EH_MODEL)-$(SHLIB_SOVERSION)$(SHLIB_EXT) SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver diff --git a/gcc/config/i386/t-cygwin b/gcc/config/i386/t-cygwin index 7433138..d58d84f 100644 --- a/gcc/config/i386/t-cygwin +++ b/gcc/config/i386/t-cygwin @@ -16,3 +16,15 @@ cygwin2.o: $(srcdir)/config/i386/cygwin2.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ # Cygwin-specific parts of LIB_SPEC SHLIB_LC = -lcygwin -luser32 -lkernel32 -ladvapi32 -lshell32 + +# We have already included one of the t-{dw2,sjlj}-eh fragments for EH_MODEL +SHLIB_EH_EXTENSION = $(subst -dw2,,-$(EH_MODEL)) + +# Cygwin uses different conventions than MinGW; override generic SHLIB_ def'ns here. +SHLIB_IMPLIB = @shlib_base_name@$(SHLIB_EXT).a +SHLIB_SONAME = cyggcc_s$(SHLIB_EH_EXTENSION)-$(SHLIB_SOVERSION)$(SHLIB_EXT) +# This must match the definitions of SHLIB_SONAME/SHLIB_SOVERSION and LIBGCC_SONAME. +# We'd like to use SHLIB_SONAME here too, and we can, since +# we don't rely on shlib_base_name substitution for it. +SHLIB_MKMAP_OPTS = -v pe_dll=$(SHLIB_SONAME) + diff --git a/gcc/config/i386/t-dw2-eh b/gcc/config/i386/t-dw2-eh new file mode 100644 index 0000000..ffcc39a --- /dev/null +++ b/gcc/config/i386/t-dw2-eh @@ -0,0 +1,3 @@ + +# We are using Dwarf-2 EH. +EH_MODEL = dw2 diff --git a/gcc/config/i386/t-sjlj-eh b/gcc/config/i386/t-sjlj-eh new file mode 100644 index 0000000..c9085f4 --- /dev/null +++ b/gcc/config/i386/t-sjlj-eh @@ -0,0 +1,3 @@ + +# We are using SjLj EH. +EH_MODEL = sjlj |