From 1627c6bcd7dbacaa5e781a2042f8eade55bd6634 Mon Sep 17 00:00:00 2001 From: midipix Date: Sat, 23 Feb 2019 00:52:50 -0500 Subject: midipix targets: added -mstatic (assume static linking). --- gcc/config/i386/midipix.c | 9 ++++++--- gcc/config/i386/midipix.opt | 4 ++++ 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'gcc/config/i386') diff --git a/gcc/config/i386/midipix.c b/gcc/config/i386/midipix.c index b30448eb2..1dd2618e0 100644 --- a/gcc/config/i386/midipix.c +++ b/gcc/config/i386/midipix.c @@ -133,6 +133,9 @@ static void midipix_pe_create_got_entry(FILE * stream, const char * name, tree d { int visibility; + if (flag_assume_static_linking) + return; + const char * ptrsize = TARGET_64BIT ? winnt_ptrsize_quad : winnt_ptrsize_long; @@ -557,7 +560,7 @@ int midipix_symbol_ref_dllimport_p(rtx symbol) { tree decl = SYMBOL_REF_DECL(symbol); - if (!decl || !decl->base.public_flag) + if (!decl || !decl->base.public_flag || flag_assume_static_linking) return 0; return (decl->decl_with_vis.visibility == VISIBILITY_DEFAULT) @@ -578,7 +581,7 @@ bool midipix_asm_assemble_integer(rtx x, unsigned int size, int aligned_p) extern int flag_constructor_decl; /* filter out c++ constructors */ - if (flag_constructor_decl) + if (flag_constructor_decl || flag_assume_static_linking) return default_assemble_integer(x,size,aligned_p); /* xref, xoff */ @@ -601,7 +604,7 @@ bool midipix_asm_assemble_integer(rtx x, unsigned int size, int aligned_p) /* visibility */ visibility = falt && decl ? (decl->decl_with_vis.visibility == VISIBILITY_DEFAULT) - : VISIBILITY_DEFAULT); + : VISIBILITY_DEFAULT; /* defer? */ if (!falt || (visibility != VISIBILITY_DEFAULT)) diff --git a/gcc/config/i386/midipix.opt b/gcc/config/i386/midipix.opt index 3b6d4c235..9d171b0c5 100644 --- a/gcc/config/i386/midipix.opt +++ b/gcc/config/i386/midipix.opt @@ -27,6 +27,10 @@ mposix Target always join or create a posix session +mstatic +Target Report Var(flag_assume_static_linking) +assume static linking, set the default visibility of all declarations to internal + mout-dsolib Target upon linking the dynamic library foo.so, generate an accompanying custom (.dsometa) import library foo.lib.a -- cgit v1.2.3