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

error building ODBM_File on Windows, perl 5.23.9 #15241

Closed
p5pRT opened this issue Mar 20, 2016 · 8 comments
Closed

error building ODBM_File on Windows, perl 5.23.9 #15241

p5pRT opened this issue Mar 20, 2016 · 8 comments

Comments

@p5pRT
Copy link

p5pRT commented Mar 20, 2016

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

Searchable as RT127751$

@p5pRT
Copy link
Author

p5pRT commented Mar 20, 2016

From @chorny

I'm trying to build Strawberry perl 5.23.9 64-bit int on Windows XP 32-bit Russian.

gcc -c -s -O2 -DWIN32 -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fwrapv -fno-strict-aliasing -mms-bitfields -s -O2 -DVERSION=\"1.13\" -DXS_VERSION=\"1.13\" "-I..\..\lib\CORE" ODBM_File.c
ODBM_File.xs​: In function 'XS_ODBM_File_TIEHASH'​:
ODBM_File.xs​:108​:49​: error​: macro "PerlLIO_open" passed 3 arguments, but takes just 2
  if ((fd = open(tmpbuf,oflags,mode)) < 0 && errno != EEXIST)
  ^
In file included from ODBM_File.xs​:5​:0​:
..\..\lib\CORE/XSUB.h​:618​:19​: error​: 'PerlLIO_open' undeclared (first use in this function)
# define open PerlLIO_open
  ^
ODBM_File.xs​:108​:26​: note​: in expansion of macro 'open'
  if ((fd = open(tmpbuf,oflags,mode)) < 0 && errno != EEXIST)
  ^
..\..\lib\CORE/XSUB.h​:618​:19​: note​: each undeclared identifier is reported only once for each function it appears in
# define open PerlLIO_open
  ^
ODBM_File.xs​:108​:26​: note​: in expansion of macro 'open'
  if ((fd = open(tmpbuf,oflags,mode)) < 0 && errno != EEXIST)
  ^
ODBM_File.xs​:113​:49​: error​: macro "PerlLIO_open" passed 3 arguments, but takes just 2
  if ((fd = open(tmpbuf,oflags,mode)) < 0 && errno != EEXIST)
  ^
ODBM_File.xs​:125​:51​: error​: macro "PerlLIO_open" passed 3 arguments, but takes just 2
  if ((fd = open(tmpbuf,O_RDONLY,mode)) < 0)
  ^

These lines where added in commit ed6087a by Jarkko Hietaniemi.

--
Alexandr Ciornii, http​://chorny.net

@p5pRT
Copy link
Author

p5pRT commented Mar 24, 2016

From @tonycoz

On Sun Mar 20 13​:08​:07 2016, chorny wrote​:

These lines where added in commit
ed6087a by Jarkko Hietaniemi.

This code isn't compiled in core Win32 perl builds.

If you want to supply a fix (probably using PerlLIO_open3()) please do, since I can't readily test it.

Tony

@p5pRT
Copy link
Author

p5pRT commented Mar 24, 2016

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

@p5pRT
Copy link
Author

p5pRT commented Mar 24, 2016

From @jhi

On Wed Mar 23 19​:41​:01 2016, tonyc wrote​:

On Sun Mar 20 13​:08​:07 2016, chorny wrote​:

These lines where added in commit
ed6087a by Jarkko Hietaniemi.

This code isn't compiled in core Win32 perl builds.

If you want to supply a fix (probably using PerlLIO_open3()) please
do, since I can't readily test it.

Tony

Alex, please try the attached patch.

@p5pRT
Copy link
Author

p5pRT commented Mar 24, 2016

From @jhi

0001-perl-127751-error-building-ODBM_File-on-Windows-perl.patch
From b7a1bd3f252191f4b9ebd7fa3301f77ded1f3d2a Mon Sep 17 00:00:00 2001
From: Jarkko Hietaniemi <jhi@iki.fi>
Date: Thu, 24 Mar 2016 07:12:51 -0400
Subject: [PATCH] [perl #127751] error building ODBM_File on Windows, perl
 5.23.9

No POSIX open in Win32, broken by ed6087adbd9c90b59cf3f08af7c23a947c00bf69

Use the PerlLIO_open3 as suggested by Tony Cook, use the same trick as POSIX.xs
---
 ext/ODBM_File/ODBM_File.xs | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/ext/ODBM_File/ODBM_File.xs b/ext/ODBM_File/ODBM_File.xs
index bf5def3..eaa1923 100644
--- a/ext/ODBM_File/ODBM_File.xs
+++ b/ext/ODBM_File/ODBM_File.xs
@@ -3,6 +3,10 @@
 #include "EXTERN.h"
 #include "perl.h"
 #include "XSUB.h"
+#if defined(PERL_IMPLICIT_SYS)
+#  undef open
+#  define open PerlLIO_open3
+#endif
 
 #ifdef I_DBM
 #  include <dbm.h>
-- 
2.7.4

@p5pRT
Copy link
Author

p5pRT commented Mar 26, 2016

From @chorny

Hi

2016-03-24 13​:18 GMT+02​:00 Jarkko Hietaniemi via RT <
perlbug-followup@​perl.org>​:

On Wed Mar 23 19​:41​:01 2016, tonyc wrote​:

On Sun Mar 20 13​:08​:07 2016, chorny wrote​:

These lines where added in commit
ed6087a by Jarkko Hietaniemi.

Alex, please try the attached patch.

Compiles without problems, tests pass.

--
Alexandr Ciornii, http​://chorny.net

@p5pRT
Copy link
Author

p5pRT commented Mar 27, 2016

From @jhi

On Sat Mar 26 14​:44​:17 2016, chorny wrote​:

Hi

2016-03-24 13​:18 GMT+02​:00 Jarkko Hietaniemi via RT <
perlbug-followup@​perl.org>​:

On Wed Mar 23 19​:41​:01 2016, tonyc wrote​:

On Sun Mar 20 13​:08​:07 2016, chorny wrote​:

These lines where added in commit
ed6087a by Jarkko Hietaniemi.

Alex, please try the attached patch.

Compiles without problems, tests pass.

In blead as of http​://perl5.git.perl.org/perl.git/commit/77bbf816cb5fd9cd539e3e70dd0a57384245e920 (and http​://perl5.git.perl.org/perl.git/commit/5942644739c2d477d25e89b4a40ced7cfb0ee4e9 for the .pm version bump). Marking as resolved.

@p5pRT p5pRT closed this as completed Mar 27, 2016
@p5pRT
Copy link
Author

p5pRT commented Mar 27, 2016

@jhi - Status changed from 'open' 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