Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PATCH] remove all exported symbols from GCC win32 miniperl #16466

Closed
p5pRT opened this issue Mar 15, 2018 · 8 comments
Closed

[PATCH] remove all exported symbols from GCC win32 miniperl #16466

p5pRT opened this issue Mar 15, 2018 · 8 comments

Comments

@p5pRT
Copy link

@p5pRT p5pRT commented Mar 15, 2018

Migrated from rt.perl.org#132982 (status was 'resolved')

Searchable as RT132982$

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Mar 15, 2018

From @bulk88

Created by @bulk88

See attached patch. my attempts at speeding up the GCC build.

Perl Info

Flags:
           category=core
           severity=low

Site configuration information for perl 5.27.9:

Configured by Administrator at Tue Jan 30 20:34:30 2018.

Summary of my perl5 (revision 5 version 27 subversion 9) configuration:

         Platform:
           osname=MSWin32
           osvers=5.2.3790
           archname=MSWin32-x86-multi-thread
           uname=''
           config_args='undef'
           hint=recommended
           useposix=true
           d_sigaction=undef
           useithreads=define
           usemultiplicity=define
           use64bitint=undef
           use64bitall=undef
           uselongdouble=undef
           usemymalloc=n
           default_inc_excludes_dot=define
           bincompat5005=undef
         Compiler:
           cc='cl'
           ccflags ='-nologo -GF -W3 -O1 -MD -Zi -DNDEBUG -GL -DWIN32
-D_CONSOLE -DNO_STRICT -D_CRT_SECURE_NO_DEPRECATE
-D_CRT_NONSTDC_NO_DEPRECATE  -DPERL_TEXTMODE_SCRIPTS
-DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DWIN32_NO_REGISTRY'
           optimize='-O1 -MD -Zi -DNDEBUG -GL'
           cppflags='-DWIN32'
           ccversion='15.00.30729.01'
           gccversion=''
           gccosandvers=''
           intsize=4
           longsize=4
           ptrsize=4
           doublesize=8
           byteorder=1234
           doublekind=3
           d_longlong=undef
           longlongsize=8
           d_longdbl=define
           longdblsize=8
           longdblkind=0
           ivtype='long'
           ivsize=4
           nvtype='double'
           nvsize=8
           Off_t='__int64'
           lseeksize=8
           alignbytes=8
           prototype=define
         Linker and Libraries:
           ld='link'
           ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf -ltcg
-libpath:"c:\perl\lib\CORE"        -machine:x86'
           libpth="C:\Program Files (x86)\Microsoft Visual Studio 
9.0\VC\lib"
           libs=oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib
netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib
odbc32.lib odbccp32.lib comctl32.lib msvcrt.lib
           perllibs=oldnames.lib kernel32.lib user32.lib gdi32.lib
winspool.lib
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib
netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib
odbc32.lib odbccp32.lib comctl32.lib msvcrt.lib
           libc=msvcrt.lib
           so=dll
           useshrplib=true
           libperl=perl527.lib
           gnulibc_version=''
         Dynamic Linking:
           dlsrc=dl_win32.xs
           dlext=dll
           d_dlsymun=undef
           ccdlflags=' '
           cccdlflags=' '
           lddlflags='-dll -nologo -nodefaultlib -debug -opt:ref,icf -ltcg
           -libpath:"c:\perl\lib\CORE"        -machine:x86'



@INC for perl 5.27.9:
           lib
           C:/p527/srcnew/lib


Environment for perl 5.27.9:
           CYGWIN=tty
           HOME (unset)
           LANG (unset)
           LANGUAGE (unset)
           LD_LIBRARY_PATH=/usr/lib/x86:/usr/X11R6/lib
           LOGDIR (unset)
           PATH=C:\WINDOWS\system32;C:\Program Files (x86)\Microsoft Visual
Studio 9.0\VC\BIN;C:\Program Files\Microsoft
SDKs\Windows\v6.0A\bin;C:\Perl\bin;C:\WINDOWS;C:\Program Files
(x86)\Microsoft Visual Studio 9.0\Common7\IDE;C:\Program Files
(x86)\Git\bin;C:\sp3220\c\bin;
           PERL_BADLANG (unset)
           SHELL (unset)










@p5pRT
Copy link
Author

@p5pRT p5pRT commented Mar 15, 2018

From @bulk88

0001-remove-all-exported-symbols-from-GCC-win32-miniperl.patch
From 6cdb8b0a36c7afe87a4db5607d18fc2f526c5800 Mon Sep 17 00:00:00 2001
From: Daniel Dragan <bulk88@hotmail.com>
Date: Wed, 14 Mar 2018 20:11:51 -0400
Subject: [PATCH] remove all exported symbols from GCC win32 miniperl

Similar to commit a19baa613 and same reasoning. Makes binary smaller/more
chances for optimization but mingw linker is still much less smart than
the VC linker.

Remaining problems are that GCC miniperl.exe still links to WS2_32.dll
(winsock library) yet the win32_* socket functions have nothing calling
them.

GCC 4.9.2 i686-w64-mingw32

miniperl.exe 1660KB before this no exports commit
miniperl.exe 1584KB after this no exports commit
---
 EXTERN.h      |    2 +-
 INTERN.h      |    3 ++-
 win32/win32.h |    2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/EXTERN.h b/EXTERN.h
index b8c4512..558f762 100644
--- a/EXTERN.h
+++ b/EXTERN.h
@@ -21,7 +21,7 @@
 
 #  if (defined(WIN32) || defined(__SYMBIAN32__)) && !defined(PERL_STATIC_SYMS)
     /* miniperl should not export anything */
-#    if defined(PERL_IS_MINIPERL) && !defined(UNDER_CE) && defined(_MSC_VER)
+#    if defined(PERL_IS_MINIPERL) && !defined(UNDER_CE)
 #      define EXT extern
 #      define dEXT 
 #      define EXTCONST extern const
diff --git a/INTERN.h b/INTERN.h
index eaaf6b2..35bb4ee 100644
--- a/INTERN.h
+++ b/INTERN.h
@@ -19,7 +19,8 @@
 #undef EXTCONST
 #undef dEXTCONST
 
-#  if (defined(WIN32) && defined(__MINGW32__)) || defined(__SYMBIAN32__)
+#  if (defined(WIN32) && defined(__MINGW32__) && ! defined(PERL_IS_MINIPERL)) \
+     || defined(__SYMBIAN32__)
 #    ifdef __cplusplus
 #      define EXT	__declspec(dllexport)
 #      define dEXT
diff --git a/win32/win32.h b/win32/win32.h
index cdfadfe..be75665 100644
--- a/win32/win32.h
+++ b/win32/win32.h
@@ -85,7 +85,7 @@
 
 /* now even GCC supports __declspec() */
 /* miniperl has no reason to export anything */
-#if defined(PERL_IS_MINIPERL) && !defined(UNDER_CE) && defined(_MSC_VER)
+#if defined(PERL_IS_MINIPERL) && !defined(UNDER_CE)
 #  define DllExport
 #else
 #  if defined(PERLDLL)
-- 
1.7.9.msysgit.0

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Jul 20, 2018

From @bulk88

On Wed, 14 Mar 2018 19​:20​:54 -0700, bulk88 wrote​:

This is a bug report for perl from bulk88@​hotmail.com,
generated with the help of perlbug 1.41 running under perl 5.27.9.

-----------------------------------------------------------------
[Please describe your issue here]

See attached patch. my attempts at speeding up the GCC build.

Bump.

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Jul 24, 2018

From @steve-m-hay

Thanks for the patch. Now in blead - commit 1b80876.

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Jul 24, 2018

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Jul 24, 2018

@steve-m-hay - Status changed from 'open' to 'pending release'

@p5pRT
Copy link
Author

@p5pRT p5pRT commented May 22, 2019

From @khwilliamson

Thank you for filing this report. You have helped make Perl better.

With the release today of Perl 5.30.0, this and 160 other issues have been
resolved.

Perl 5.30.0 may be downloaded via​:
https://metacpan.org/release/XSAWYERX/perl-5.30.0

If you find that the problem persists, feel free to reopen this ticket.

@p5pRT
Copy link
Author

@p5pRT p5pRT commented May 22, 2019

@khwilliamson - Status changed from 'pending release' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant