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

[MS Win] 5.23.8 sets $Config{archname} incorrectly #15192

Closed
p5pRT opened this issue Feb 21, 2016 · 13 comments
Closed

[MS Win] 5.23.8 sets $Config{archname} incorrectly #15192

p5pRT opened this issue Feb 21, 2016 · 13 comments

Comments

@p5pRT
Copy link

p5pRT commented Feb 21, 2016

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

Searchable as RT127584$

@p5pRT
Copy link
Author

p5pRT commented Feb 21, 2016

From @sisyphus

Hi,

C​:\>perl -V​:archname
archname='MSWin32-x86-multi-thread-ld';

But it should be 'MSWin32-x64-multi-thread-ld'.
It was built using this version of gcc :

gcc version 4.9.2 (x86_64-posix-sjlj, built by strawberryperl.com project)

Here's the full perl -V output​:

##########################################
Summary of my perl5 (revision 5 version 23 subversion 8) configuration​:

  Platform​:
  osname=MSWin32, osvers=6.1, archname=MSWin32-x86-multi-thread-ld
  uname=''
  config_args='undef'
  hint=recommended, useposix=true, d_sigaction=undef
  useithreads=define, usemultiplicity=define
  use64bitint=define, use64bitall=undef, uselongdouble=define
  usemymalloc=n, bincompat5005=undef
  Compiler​:
  cc='gcc', ccflags
' -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT
-DPERL_IMPLICIT_SYS -DUSE_PERLIO -D__USE_MINGW_ANSI_STDIO -fwrapv -fno-strict-aliasing
-mms-bitfields',
  optimize='-s -O2',
  cppflags='-DWIN32'
  ccversion='', gccversion='4.9.2', gccosandvers=''
  intsize=4, longsize=4, ptrsize=8, doublesize=8, byteorder=12345678,
doublekind=3
  d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16,
longdblkind=3
  ivtype='long long', ivsize=8, nvtype='long double', nvsize=16,
Off_t='long long', lseeksize=8
  alignbytes=8, prototype=define
  Linker and Libraries​:
  ld='g++', ldflags
='-s -L"c​:\_64\blead5.23.8_64int_ld\lib\CORE" -L"C​:\_64\gcc-straw-492\lib"'
  libpth=C​:\_64\gcc-straw-492\lib C​:\_64\gcc-straw-492\lib
C​:\_64\gcc-straw-492\x86_64-w64-mingw32\lib C​:\_64\msys_492\1.0\local\lib
C​:\_64\gcc-straw-492\lib\gcc\x86_64-w64-mingw32\4.9.2
  libs= -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32
-lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion
-lodbc32 -lodbccp32 -lcomctl32
  perllibs= -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32
-lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion
-lodbc32 -lodbccp32 -lcomctl32
  libc=, so=dll, useshrplib=true, libperl=libperl523.a
  gnulibc_version=''
  Dynamic Linking​:
  dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
  cccdlflags=' ',
lddlflags='-mdll -s -L"c​:\_64\blead5.23.8_64int_ld\lib\CORE" -L"C​:\_64\gcc-straw-492\lib"'

Characteristics of this binary (from libperl)​:
  Compile-time options​: HAS_TIMES HAVE_INTERP_INTERN MULTIPLICITY
  PERLIO_LAYERS PERL_COPY_ON_WRITE
  PERL_DONT_CREATE_GVSV
  PERL_HASH_FUNC_ONE_AT_A_TIME_HARD
  PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS
  PERL_MALLOC_WRAP PERL_PRESERVE_IVUV USE_64_BIT_INT
  USE_ITHREADS USE_LARGE_FILES USE_LOCALE
  USE_LOCALE_COLLATE USE_LOCALE_CTYPE
  USE_LOCALE_NUMERIC USE_LOCALE_TIME USE_LONG_DOUBLE
  USE_PERLIO USE_PERL_ATOF
  Built under MSWin32
  Compiled at Feb 21 2016 17​:26​:33
  @​INC​:
  C​:/_64/blead5.23.8_64int_ld/site/lib
  C​:/_64/blead5.23.8_64int_ld/lib
  .
##########################################

Cheers,
Rob

@p5pRT
Copy link
Author

p5pRT commented Feb 21, 2016

From @bulk88

On Sat Feb 20 23​:02​:31 2016, sisyphus wrote​:

Hi,

C​:\>perl -V​:archname
archname='MSWin32-x86-multi-thread-ld';

But it should be 'MSWin32-x64-multi-thread-ld'.
It was built using this version of gcc :

gcc version 4.9.2 (x86_64-posix-sjlj, built by strawberryperl.com
project)

What does "gcc -dumpmachine" say? Are you using "gcc" or some cross compiling GCC with alot of postfixes/prefixes on its binary name? Ive seen these things like this happen when there are 32 bit tools building a 64 bit perl before (32 bit make building 64 bit perl and the same 32 bit make tool launches 32 bit cmd.exe's).

GNUMakefile has this autodetection code, it might be faulty


ifeq ($(CCTYPE),GCC)
ifeq ($(GCCTARGET),x86_64-w64-mingw32)
WIN64 := define
ARCHITECTURE := x64
endif
ifeq ($(GCCTARGET),i686-w64-mingw32)
WIN64 := undef
ARCHITECTURE := x86
endif
endif


--
bulk88 ~ bulk88 at hotmail.com

@p5pRT
Copy link
Author

p5pRT commented Feb 21, 2016

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

@p5pRT
Copy link
Author

p5pRT commented Feb 21, 2016

From @sisyphus

-----Original Message-----
From​: bulk88 via RT
Sent​: Sunday, February 21, 2016 7​:20 PM
To​: OtherRecipients of perl Ticket #127584​:
Cc​: perl5-porters@​perl.org
Subject​: [perl #127584] [MS Win] 5.23.8 sets $Config{archname} incorrectly

On Sat Feb 20 23​:02​:31 2016, sisyphus wrote​:

Hi,

C​:\>perl -V​:archname
archname='MSWin32-x86-multi-thread-ld';

But it should be 'MSWin32-x64-multi-thread-ld'.
It was built using this version of gcc :

gcc version 4.9.2 (x86_64-posix-sjlj, built by strawberryperl.com
project)

What does "gcc -dumpmachine" say?

x86_64-w64-mingw32

Are you using "gcc" or some cross compiling GCC with alot of
postfixes/prefixes on its binary name?

Plain "gcc.exe" - not one of the cross-compilers

Ive seen these things like this happen when there are 32 bit tools
building a 64 bit perl before (32 bit make building 64 bit perl and the
same 32 bit make tool launches 32 bit cmd.exe's).

Aah ... switching to a 64-bit make utility fixes the problem. (I don't think
it mattered with dmake ... or, maybe it did and I just never noticed.)

I don't really see why the bit-ed-ness of the make utility should be having
such an affect, but I'll accept that as the solution and be sure to use the
"right" make in future.

Thanks Daniel.

Unless I've overlooked something important then this bug report should be
closed.

Cheers,
Rob

@p5pRT
Copy link
Author

p5pRT commented Feb 21, 2016

From @bulk88

On Sun Feb 21 00​:59​:33 2016, sisyphus wrote​:

-----Original Message-----
From​: bulk88 via RT
Sent​: Sunday, February 21, 2016 7​:20 PM
To​: OtherRecipients of perl Ticket #127584​:
Cc​: perl5-porters@​perl.org
Subject​: [perl #127584] [MS Win] 5.23.8 sets $Config{archname}
incorrectly

On Sat Feb 20 23​:02​:31 2016, sisyphus wrote​:

Hi,

C​:\>perl -V​:archname
archname='MSWin32-x86-multi-thread-ld';

But it should be 'MSWin32-x64-multi-thread-ld'.
It was built using this version of gcc :

gcc version 4.9.2 (x86_64-posix-sjlj, built by strawberryperl.com
project)

What does "gcc -dumpmachine" say?

x86_64-w64-mingw32

Are you using "gcc" or some cross compiling GCC with alot of
postfixes/prefixes on its binary name?

Plain "gcc.exe" - not one of the cross-compilers

Ive seen these things like this happen when there are 32 bit tools
building a 64 bit perl before (32 bit make building 64 bit perl and
the
same 32 bit make tool launches 32 bit cmd.exe's).

Aah ... switching to a 64-bit make utility fixes the problem. (I don't
think
it mattered with dmake ... or, maybe it did and I just never noticed.)

I don't really see why the bit-ed-ness of the make utility should be
having
such an affect, but I'll accept that as the solution and be sure to
use the
"right" make in future.

Thanks Daniel.

Unless I've overlooked something important then this bug report should
be
closed.

There is a bug here. Bitness of make tool shouldnt affect anything.

--
bulk88 ~ bulk88 at hotmail.com

@p5pRT
Copy link
Author

p5pRT commented Feb 22, 2016

From @sisyphus

-----Original Message-----
From​: bulk88 via RT
Sent​: Monday, February 22, 2016 3​:38 AM
To​: OtherRecipients of perl Ticket #127584​:
Cc​: perl5-porters@​perl.org
Subject​: [perl #127584] [MS Win] 5.23.8 sets $Config{archname} incorrectly

There is a bug here. Bitness of make tool shouldnt affect anything.

Ok - looking a bit further, this is something that did not happen with
5.23.7.
I used the 32-bit GNU make to build 5.23.7, and its archname was set
correctly.

Something else that was a bit strange​:
With my 32-bit build of 5.23.8 I failed to uncomment the line "#WIN64
:= undef", but that did not matter and re-building with that line
uncommented made no difference .
I now see that line was not present (as an option) in the 5.23.7 (and
earlier) GNUmakefile. Instead it was previously being handled automatically
based on $GCCTARGET.
Maybe that's nothing ... it might merely demonstrate that it's no longer
necessary to undef WIN64, though I know it used to be needed with dmake.
Or perhaps WIN64 is being undeffed somewhere else when needed.

Cheers,
Rob

@p5pRT
Copy link
Author

p5pRT commented Feb 22, 2016

From @bulk88

On Sun Feb 21 16​:06​:42 2016, sisyphus wrote​:

-----Original Message-----
From​: bulk88 via RT
Sent​: Monday, February 22, 2016 3​:38 AM
To​: OtherRecipients of perl Ticket #127584​:
Cc​: perl5-porters@​perl.org
Subject​: [perl #127584] [MS Win] 5.23.8 sets $Config{archname} incorrectly

There is a bug here. Bitness of make tool shouldnt affect anything.

Ok - looking a bit further, this is something that did not happen with
5.23.7.
I used the 32-bit GNU make to build 5.23.7, and its archname was set
correctly.

Something else that was a bit strange​:
With my 32-bit build of 5.23.8 I failed to uncomment the line "#WIN64
:= undef", but that did not matter and re-building with that line
uncommented made no difference .
I now see that line was not present (as an option) in the 5.23.7 (and
earlier) GNUmakefile. Instead it was previously being handled automatically
based on $GCCTARGET.
Maybe that's nothing ... it might merely demonstrate that it's no longer
necessary to undef WIN64, though I know it used to be needed with dmake.
Or perhaps WIN64 is being undeffed somewhere else when needed.

Cheers,
Rob

Reproduced by replacing the 64b gmake included with a 64b strawberry with a 32b gmake. I've attached a fix.

--
bulk88 ~ bulk88 at hotmail.com

@p5pRT
Copy link
Author

p5pRT commented Feb 22, 2016

From @bulk88

0001-perl-127584-using-Win32-32b-gmake-with-64b-gcc-cause.patch
From 2b9c90dc141c28920c3618654396f6a756d7be58 Mon Sep 17 00:00:00 2001
From: Daniel Dragan <bulk88@hotmail.com>
Date: Sun, 21 Feb 2016 19:43:44 -0500
Subject: [PATCH] [perl #127584] using Win32 32b gmake with 64b gcc caused
 wrong archname

Using a 32 bit Win32 gmake, with a GCC that produces 64 bit binaries, made
a perl with PTRSIZE 64 bits, and 64 bit machine code, but archname IDed
that build as "x86" not "x64", which is very wrong. Perl's
win32/GNUMakefile autodetects the bitness of the GCC and sets things up
accordingly. Fixes [perl #127584]. This bug might be a regression
introduced in commit 745dedb9b5 or the GNUMakefile parallel build branch.
---
 win32/GNUmakefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/win32/GNUmakefile b/win32/GNUmakefile
index 9511325..51f9584 100644
--- a/win32/GNUmakefile
+++ b/win32/GNUmakefile
@@ -357,11 +357,11 @@ endif
 ifeq ($(CCTYPE),GCC)
 ifeq ($(GCCTARGET),x86_64-w64-mingw32)
 WIN64 := define
-ARCHITECTURE := x64
+PROCESSOR_ARCHITECTURE := x64
 endif
 ifeq ($(GCCTARGET),i686-w64-mingw32)
 WIN64 := undef
-ARCHITECTURE := x86
+PROCESSOR_ARCHITECTURE := x86
 endif
 endif
 
-- 
1.8.0.msysgit.0

@p5pRT
Copy link
Author

p5pRT commented Feb 22, 2016

From @sisyphus

-----Original Message-----
From​: bulk88 via RT
Sent​: Monday, February 22, 2016 11​:46 AM
To​: sisyphus1@​optusnet.com.au
Subject​: [perl #127584] [MS Win] 5.23.8 sets $Config{archname} incorrectly

Reproduced by replacing the 64b gmake included with a 64b strawberry with
a 32b gmake. I've attached a fix.

Yes, that fix works for me, too.

Cheers,
Rob

@p5pRT
Copy link
Author

p5pRT commented Feb 28, 2016

From @tonycoz

On Sun Feb 21 16​:46​:25 2016, bulk88 wrote​:

Reproduced by replacing the 64b gmake included with a 64b strawberry
with a 32b gmake. I've attached a fix.

Thanks, applied as ae146f5.

Tony

@p5pRT
Copy link
Author

p5pRT commented Feb 28, 2016

@tonycoz - Status changed from 'open' to 'pending release'

@p5pRT
Copy link
Author

p5pRT commented May 13, 2016

From @khwilliamson

Thank you for submitting this report. You have helped make Perl better.
 
With the release of Perl 5.24.0 on May 9, 2016, this and 149 other issues have been resolved.

Perl 5.24.0 may be downloaded via https://metacpan.org/release/RJBS/perl-5.24.0

@p5pRT
Copy link
Author

p5pRT commented May 13, 2016

@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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant