29 lines
1.2 KiB
Diff
29 lines
1.2 KiB
Diff
--- Win32-API-0.84/Makefile.PL.orig 2021-07-23 20:34:20.860696500 -0700
|
|
+++ Win32-API-0.84/Makefile.PL 2021-07-23 20:35:16.879090500 -0700
|
|
@@ -14,6 +14,7 @@
|
|
|
|
my $is_64bit_build = ($Config{ptrsize} == 8);
|
|
my $is_msvc_compiler = ($Config{cc} =~ /cl/);
|
|
+my $is_gcc_clang = ($Config{ccname} eq "gcc" && join('', `$Config{cc} --version`)=~/clang version/);
|
|
|
|
#maybe this CC will banned in the future due to SEGV in DllMain
|
|
#die "Mingw 3.4.5 will generate unloadble DLLs, upgrade your GCC"
|
|
@@ -134,7 +135,7 @@
|
|
'.($is_64bit_build ? 'ml64' : 'ml').' $(ASFLAGS) $(PERL_DEFINES) -c $<
|
|
|
|
.s$(OBJ_EXT):
|
|
- $(AS) $(ASFLAGS) $(PERL_DEFINES) $< -o $*$(OBJ_EXT)
|
|
+ $(AS) $(ASFLAGS) $(PERL_DEFINES) '.($is_gcc_clang ? '-c ' : '').'$< -o $*$(OBJ_EXT)
|
|
|
|
#target unused
|
|
#make GCC issue "push" instructions rather than "mov" to esp+offset, this is the magic
|
|
@@ -200,7 +201,7 @@
|
|
return $dlib.'PERL_DEFINES = '.(@defs?'-D':'').join(' -D', @defs)."\n" if $is_msvc_compiler;
|
|
#convert -DFOO into GNU AS compatible defines for GNU AS macros
|
|
my $defs = '';
|
|
- $defs .= '-defsym '.$_.'=1 ' foreach @defs;
|
|
+ $defs .= ($is_gcc_clang?'-Wa,':'').'-defsym'.($is_gcc_clang?',':' ').$_.'=1 ' foreach @defs;
|
|
return $dlib.'PERL_DEFINES = '.$defs."\n";
|
|
}
|
|
|