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

Blead broken on darwin #16148

Closed
p5pRT opened this issue Sep 14, 2017 · 20 comments
Closed

Blead broken on darwin #16148

p5pRT opened this issue Sep 14, 2017 · 20 comments

Comments

@p5pRT
Copy link

p5pRT commented Sep 14, 2017

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

Searchable as RT132087$

@p5pRT
Copy link
Author

p5pRT commented Sep 14, 2017

From @dur-randir

Created by @dur-randir

Commit 733612e broke blead
compilation on OS X 10.9​:

commit 733612e
Author​: Tony Cook <tony@​develop-help.com>
Date​: Tue Dec 13 09​:03​:08 2016 +1100

  (perl #127663) use *at() functions to handle perl code that chdirs

  Unfortunately this means systems that don't have the *at() functions
  aren't protected from code that chdir()s in the middle of in-place
  editing a file.

With the following output​:

./miniperl -Ilib make_ext.pl lib/auto/Cwd/Cwd.bundle
MAKE="/Applications/Xcode.app/Contents/Developer/usr/bin/make"
LIBPERL_A=libperl.a LINKTYPE=dynamic
/Users/dur-randir/Projects/perl-git/dist/PathTools/../../miniperl
"-I../../lib" -MExtUtils​::Command​::MM -e 'cp_nonempty' -- Cwd.bs
../../lib/auto/Cwd/Cwd.bs 644
./miniperl -Ilib make_ext.pl lib/auto/DB_File/DB_File.bundle
MAKE="/Applications/Xcode.app/Contents/Developer/usr/bin/make"
LIBPERL_A=libperl.a LINKTYPE=dynamic
Parsing config.in...
Looks Good.
dyld​: lazy symbol binding failed​: Symbol not found​: _linkat
  Referenced from​:
/Users/dur-randir/Projects/perl-git/cpan/DB_File/../../miniperl
  Expected in​: flat namespace

dyld​: Symbol not found​: _linkat
  Referenced from​:
/Users/dur-randir/Projects/perl-git/cpan/DB_File/../../miniperl
  Expected in​: flat namespace

Unsuccessful Makefile.PL(cpan/DB_File)​: code=5 at make_ext.pl line 518.
make​: *** [lib/auto/DB_File/DB_File.bundle] Error 2

Perl Info

Flags:
    category=core
    severity=high

Site configuration information for perl 5.22.1:

Configured by dur-randir at Mon Dec 14 02:53:24 MSK 2015.

Summary of my perl5 (revision 5 version 22 subversion 1) configuration:

  Platform:
    osname=darwin, osvers=13.4.0, archname=darwin-2level
    uname='darwin isengard.local 13.4.0 darwin kernel version 13.4.0:
wed mar 18 16:20:14 pdt 2015; root:xnu-2422.115.14~1release_x86_64
x86_64 '
    config_args='-de
-Dprefix=/Users/dur-randir/perlbrew/perls/perl-5.22.1
-Aeval:scriptdir=/Users/dur-randir/perlbrew/perls/perl-5.22.1/bin'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-fno-common -DPERL_DARWIN -fno-strict-aliasing
-pipe -fstack-protector -I/usr/local/include',
    optimize='-O3',
    cppflags='-fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe
-fstack-protector -I/usr/local/include'
    ccversion='', gccversion='4.2.1 Compatible Apple LLVM 6.0
(clang-600.0.56)', gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8,
byteorder=12345678, doublekind=3
    d_longlong=define, longlongsize=8, d_longdbl=define,
longdblsize=16, longdblkind=3
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags ='
-fstack-protector -L/usr/local/lib'
    libpth=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/lib
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/lib
/usr/local/lib /usr/lib
    libs=-lpthread -lgdbm -ldbm -ldl -lm -lutil -lc
    perllibs=-lpthread -ldl -lm -lutil -lc
    libc=, so=dylib, useshrplib=false, libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup
-L/usr/local/lib -fstack-protector'



@INC for perl 5.22.1:
    /Users/dur-randir/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/darwin-2level
    /Users/dur-randir/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1
    /Users/dur-randir/perlbrew/perls/perl-5.22.1/lib/5.22.1/darwin-2level
    /Users/dur-randir/perlbrew/perls/perl-5.22.1/lib/5.22.1
    .


Environment for perl 5.22.1:
    DYLD_LIBRARY_PATH (unset)
    HOME=/Users/dur-randir
    LANG=en_US.UTF-8
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/Users/dur-randir/perlbrew/bin:/Users/dur-randir/perlbrew/perls/perl-5.22.1/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/texbin
    PERLBREW_BASHRC_VERSION=0.78
    PERLBREW_HOME=/Users/dur-randir/.perlbrew
    PERLBREW_MANPATH=/Users/dur-randir/perlbrew/perls/perl-5.22.1/man
    PERLBREW_PATH=/Users/dur-randir/perlbrew/bin:/Users/dur-randir/perlbrew/perls/perl-5.22.1/bin
    PERLBREW_PERL=perl-5.22.1
    PERLBREW_ROOT=/Users/dur-randir/perlbrew
    PERLBREW_VERSION=0.78
    PERL_BADLANG (unset)
    SHELL=/usr/local/bin/zsh

@p5pRT
Copy link
Author

p5pRT commented Sep 14, 2017

From zefram@fysh.org

Sergey Aleynikov wrote​:

Commit 733612e broke blead
compilation on OS X 10.9​:
...
dyld​: lazy symbol binding failed​: Symbol not found​: _linkat

The commit adds code that uses linkat() without making that conditional
on HAS_LINKAT. The new code is conditional on the existence of most
of the *at() functions, for example on HAS_UNLINKAT. It needs to be
conditional on HAS_LINKAT in the same way.

-zefram

@p5pRT
Copy link
Author

p5pRT commented Sep 14, 2017

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

@p5pRT
Copy link
Author

p5pRT commented Sep 14, 2017

From @jkeenan

On Thu, 14 Sep 2017 12​:30​:17 GMT, randir wrote​:

This is a bug report for perl from sergey.aleynikov@​gmail.com,
generated with the help of perlbug 1.40 running under perl 5.22.1.

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

Commit 733612e broke blead
compilation on OS X 10.9​:

commit 733612e
Author​: Tony Cook <tony@​develop-help.com>
Date​: Tue Dec 13 09​:03​:08 2016 +1100

(perl #127663) use *at() functions to handle perl code that chdirs

Unfortunately this means systems that don't have the *at() functions
aren't protected from code that chdir()s in the middle of in-place
editing a file.

With the following output​:

./miniperl -Ilib make_ext.pl lib/auto/Cwd/Cwd.bundle
MAKE="/Applications/Xcode.app/Contents/Developer/usr/bin/make"
LIBPERL_A=libperl.a LINKTYPE=dynamic
/Users/dur-randir/Projects/perl-git/dist/PathTools/../../miniperl
"-I../../lib" -MExtUtils​::Command​::MM -e 'cp_nonempty' -- Cwd.bs
../../lib/auto/Cwd/Cwd.bs 644
./miniperl -Ilib make_ext.pl lib/auto/DB_File/DB_File.bundle
MAKE="/Applications/Xcode.app/Contents/Developer/usr/bin/make"
LIBPERL_A=libperl.a LINKTYPE=dynamic
Parsing config.in...
Looks Good.
dyld​: lazy symbol binding failed​: Symbol not found​: _linkat
Referenced from​:
/Users/dur-randir/Projects/perl-git/cpan/DB_File/../../miniperl
Expected in​: flat namespace

dyld​: Symbol not found​: _linkat
Referenced from​:
/Users/dur-randir/Projects/perl-git/cpan/DB_File/../../miniperl
Expected in​: flat namespace

Unsuccessful Makefile.PL(cpan/DB_File)​: code=5 at make_ext.pl line
518.
make​: *** [lib/auto/DB_File/DB_File.bundle] Error 2

The patch attached attempts to implement Zefram's suggestion and (at least) does no harm on Linux and FreeBSD-11. But I don't have a fairly recent Darwin available.

The patch is also available via the jkeenan/132087-has-linkat branch.

Can you try it out?

Thank you very much.

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Sep 14, 2017

From @jkeenan

0001-Make-use-of-at-functions-dependent-upon-HAS_LINKAT.patch
From accfcd59266fdfee371a4c3b0b8934d401c44ba2 Mon Sep 17 00:00:00 2001
From: James E Keenan <jkeenan@cpan.org>
Date: Thu, 14 Sep 2017 10:12:01 -0400
Subject: [PATCH] Make use of *at functions dependent upon HAS_LINKAT.

As suggested by Zefram.

For: RT #132087.
---
 doio.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/doio.c b/doio.c
index 8c08455..d990812 100644
--- a/doio.c
+++ b/doio.c
@@ -863,7 +863,8 @@ S_openindirtemp(pTHX_ GV *gv, SV *orig_name, SV *temp_out_name) {
 }
 
 #if defined(HAS_UNLINKAT) && defined(HAS_RENAMEAT) && defined(HAS_FCHMODAT) && \
-    (defined(HAS_DIRFD) || defined(HAS_DIR_DD_FD)) && !defined(NO_USE_ATFUNCTIONS)
+    (defined(HAS_DIRFD) || defined(HAS_DIR_DD_FD)) && !defined(NO_USE_ATFUNCTIONS) && \
+    defined(HAS_LINKAT)
 #  define ARGV_USE_ATFUNCTIONS
 #endif
 
-- 
2.7.4

@p5pRT
Copy link
Author

p5pRT commented Sep 14, 2017

From @dur-randir

On Thu, 14 Sep 2017 07​:55​:39 -0700, jkeenan wrote​:

The patch attached attempts to implement Zefram's suggestion and (at
least) does no harm on Linux and FreeBSD-11. But I don't have a
fairly recent Darwin available.

Can you try it out?

While I think this patch is worth including for the reasons mentioned, it doesn't fix the build for me. I've dug a bit deeper and found that the following symbols get defined in my config.h​:

/* HAS_OPENAT​:
* This symbol is defined if the openat() routine is available.
*/
#define HAS_OPENAT /**/

/* HAS_UNLINKAT​:
* This symbol is defined if the unlinkat() routine is available.
*/
#define HAS_UNLINKAT /**/

/* HAS_RENAMEAT​:
* This symbol is defined if the renameat() routine is available.
*/
#define HAS_RENAMEAT /**/

/* HAS_LINKAT​:
* This symbol is defined if the linkat() routine is available.
*/
#define HAS_LINKAT /**/

/* HAS_FCHMODAT​:
* This symbol is defined if the fchmodat() routine is available.
*/
#define HAS_FCHMODAT /**/

So, apparently, they're found by Configure, but something fails during link time. To check this, I've created the following C program​:

#include <errno.h>
#include <stdlib.h>
#include <unistd.h>

int main() {
  linkat(1, "/tmp/foo", 1, "/tmp/foo2", 0);
  exit(errno);
}

And compiled & run it with​:

% gcc -o test test.c
% ./test
dyld​: lazy symbol binding failed​: Symbol not found​: _linkat
  Referenced from​: /Users/dur-randir/Projects/perl-git/./test
  Expected in​: /usr/lib/libSystem.B.dylib

dyld​: Symbol not found​: _linkat
  Referenced from​: /Users/dur-randir/Projects/perl-git/./test
  Expected in​: /usr/lib/libSystem.B.dylib

zsh​: trace trap ./test

It seems that OS X (at least, older ones) lacks linkat() implementation despite advertised support (man 2 linkat specifies no special requirements for it).

@p5pRT
Copy link
Author

p5pRT commented Sep 14, 2017

From @jkeenan

On Thu, 14 Sep 2017 14​:55​:39 GMT, jkeenan wrote​:

On Thu, 14 Sep 2017 12​:30​:17 GMT, randir wrote​:

This is a bug report for perl from sergey.aleynikov@​gmail.com,
generated with the help of perlbug 1.40 running under perl 5.22.1.

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

Commit 733612e broke blead
compilation on OS X 10.9​:

commit 733612e
Author​: Tony Cook <tony@​develop-help.com>
Date​: Tue Dec 13 09​:03​:08 2016 +1100

(perl #127663) use *at() functions to handle perl code that chdirs

Unfortunately this means systems that don't have the *at() functions
aren't protected from code that chdir()s in the middle of in-place
editing a file.

With the following output​:

./miniperl -Ilib make_ext.pl lib/auto/Cwd/Cwd.bundle
MAKE="/Applications/Xcode.app/Contents/Developer/usr/bin/make"
LIBPERL_A=libperl.a LINKTYPE=dynamic
/Users/dur-randir/Projects/perl-git/dist/PathTools/../../miniperl
"-I../../lib" -MExtUtils​::Command​::MM -e 'cp_nonempty' -- Cwd.bs
../../lib/auto/Cwd/Cwd.bs 644
./miniperl -Ilib make_ext.pl lib/auto/DB_File/DB_File.bundle
MAKE="/Applications/Xcode.app/Contents/Developer/usr/bin/make"
LIBPERL_A=libperl.a LINKTYPE=dynamic
Parsing config.in...
Looks Good.
dyld​: lazy symbol binding failed​: Symbol not found​: _linkat
Referenced from​:
/Users/dur-randir/Projects/perl-git/cpan/DB_File/../../miniperl
Expected in​: flat namespace

dyld​: Symbol not found​: _linkat
Referenced from​:
/Users/dur-randir/Projects/perl-git/cpan/DB_File/../../miniperl
Expected in​: flat namespace

Unsuccessful Makefile.PL(cpan/DB_File)​: code=5 at make_ext.pl line
518.
make​: *** [lib/auto/DB_File/DB_File.bundle] Error 2

The patch attached attempts to implement Zefram's suggestion and (at
least) does no harm on Linux and FreeBSD-11. But I don't have a
fairly recent Darwin available.

The patch is also available via the jkeenan/132087-has-linkat branch.

Can you try it out?

Thank you very much.

On IRC TonyC indicated that some tests would have to be revised if my first patch were accepted. I'm attaching my best guess at those tests. Please review.

Thank you very much.
Jim Keenan

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Sep 14, 2017

From @jkeenan

0002-Revise-tests-to-account-for-d_linkat.patch
From bbbc45751b086c412522d0f6b17d293c5a76d0ee Mon Sep 17 00:00:00 2001
From: James E Keenan <jkeenan@cpan.org>
Date: Thu, 14 Sep 2017 12:38:13 -0400
Subject: [PATCH 2/2] Revise tests to account for d_linkat.

---
 t/run/switches.t | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/t/run/switches.t b/t/run/switches.t
index 6725f8f..8978b47 100644
--- a/t/run/switches.t
+++ b/t/run/switches.t
@@ -468,6 +468,7 @@ __EOF__
         skip "Not enough *at functions", 3
           unless $Config{d_unlinkat} && $Config{d_renameat} && $Config{d_fchmodat}
               && ($Config{d_dirfd} || $Config{d_dir_dd_fd})
+              && $Config{d_linkat}
               && $Config{ccflags} !~ /-DNO_USE_ATFUNCTIONS\b/;
         fresh_perl_is(<<'CODE', "ok\n", { },
 @ARGV = ("inplacetmp/foo");
@@ -594,6 +595,7 @@ CODE
         skip "Testing without *at functions", 1
           if $Config{d_unlinkat} && $Config{d_renameat} && $Config{d_fchmodat}
               && ($Config{d_dirfd} || $Config{d_dir_dd_fd})
+              && $Config{d_linkat}
               && $Config{ccflags} !~ /-DNO_USE_ATFUNCTIONS\b/;
         fresh_perl_like(<<'CODE', qr/^Cannot complete in-place edit of inplacetmp\/foo: .* - line 5, <> line \d+\./, { },
 @ARGV = ("inplacetmp/foo");
-- 
2.7.4

@p5pRT
Copy link
Author

p5pRT commented Sep 14, 2017

From @jkeenan

On Thu, 14 Sep 2017 15​:13​:05 GMT, randir wrote​:

On Thu, 14 Sep 2017 07​:55​:39 -0700, jkeenan wrote​:

The patch attached attempts to implement Zefram's suggestion and (at
least) does no harm on Linux and FreeBSD-11. But I don't have a
fairly recent Darwin available.

Can you try it out?

While I think this patch is worth including for the reasons mentioned,
it doesn't fix the build for me. I've dug a bit deeper and found that
the following symbols get defined in my config.h​:

/* HAS_OPENAT​:
* This symbol is defined if the openat() routine is available.
*/
#define HAS_OPENAT /**/

/* HAS_UNLINKAT​:
* This symbol is defined if the unlinkat() routine is available.
*/
#define HAS_UNLINKAT /**/

/* HAS_RENAMEAT​:
* This symbol is defined if the renameat() routine is available.
*/
#define HAS_RENAMEAT /**/

/* HAS_LINKAT​:
* This symbol is defined if the linkat() routine is available.
*/
#define HAS_LINKAT /**/

/* HAS_FCHMODAT​:
* This symbol is defined if the fchmodat() routine is available.
*/
#define HAS_FCHMODAT /**/

So, apparently, they're found by Configure, but something fails during
link time. To check this, I've created the following C program​:

#include <errno.h>
#include <stdlib.h>
#include <unistd.h>

int main() {
linkat(1, "/tmp/foo", 1, "/tmp/foo2", 0);
exit(errno);
}

And compiled & run it with​:

% gcc -o test test.c
% ./test
dyld​: lazy symbol binding failed​: Symbol not found​: _linkat
Referenced from​: /Users/dur-randir/Projects/perl-git/./test
Expected in​: /usr/lib/libSystem.B.dylib

dyld​: Symbol not found​: _linkat
Referenced from​: /Users/dur-randir/Projects/perl-git/./test
Expected in​: /usr/lib/libSystem.B.dylib

zsh​: trace trap ./test

It seems that OS X (at least, older ones) lacks linkat()
implementation despite advertised support (man 2 linkat specifies no
special requirements for it).

Well, even *older* OS X versions clearly lack *at functions altogether. By 'older' I mean my Mac OS X 10.4/Darwin 8.11.0, on which none of the following are defined in config.h​:

HAS_OPENAT
HAS_UNLINKAT
HAS_RENAMEAT
HAS_LINKAT
HAS_FCHMODAT
HAS_USTAT

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Sep 14, 2017

From @craigberry

On Thu, Sep 14, 2017 at 11​:52 AM, James E Keenan via RT
<perlbug-followup@​perl.org> wrote​:

On Thu, 14 Sep 2017 15​:13​:05 GMT, randir wrote​:

It seems that OS X (at least, older ones) lacks linkat()
implementation despite advertised support (man 2 linkat specifies no
special requirements for it).

Well, even *older* OS X versions clearly lack *at functions altogether. By 'older' I mean my Mac OS X 10.4/Darwin 8.11.0, on which none of the following are defined in config.h​:

HAS_OPENAT
HAS_UNLINKAT
HAS_RENAMEAT
HAS_LINKAT
HAS_FCHMODAT
HAS_USTAT

According to the gnulib folks​:

https://www.gnu.org/software/gnulib/manual/html_node/linkat.html

linkat became available on macOS with 10.10 (Yosemite, darwin kernel
14.0.0). But we don't really know what the OP is running where the
build failed (the -V output in the ticket looks like a 5.22.1 build,
not blead). Assuming the failed build got far enough along to build
miniperl, let's please see the output of​:

./miniperl -Ilib -V

There may be a scenario in which Configure could detect the presence
of linkat in libc but then if something adds
'MACOSX_DEPLOYMENT_TARGET=10.3' to the link flags as indicated in the
original post, then the link would fail because we're not allowing it
to pull in symbols not present on very old systems. That's why we
really need to see the -V output from the perl that's failing to
build.

@p5pRT
Copy link
Author

p5pRT commented Sep 14, 2017

From @dur-randir

On Thu, 14 Sep 2017 10​:42​:35 -0700, craig.a.berry@​gmail.com wrote​:

But we don't really know what the OP is running where the
build failed

As stated in the report, this is OS X 10.9.5.

the -V output in the ticket looks like a 5.22.1 build, not blead

They all are built on the same system.

Assuming the failed build got far enough along to build
miniperl, let's please see the output of​:
./miniperl -Ilib -V

Here it is​:

% ./miniperl -Ilib -V
Summary of my perl5 (revision 5 version 27 subversion 4) configuration​:
  Derived from​: accfcd5
  Platform​:
  osname=darwin
  osvers=13.4.0
  archname=darwin-2level
  uname='darwin isengard.local 13.4.0 darwin kernel version 13.4.0​: mon jan 11 18​:17​:34 pst 2016; root​:xnu-2422.115.15~1release_x86_64 x86_64 '
  config_args='-de -Dusedevel'
  hint=recommended
  useposix=true
  d_sigaction=define
  useithreads=undef
  usemultiplicity=undef
  use64bitint=define
  use64bitall=define
  uselongdouble=undef
  usemymalloc=n
  default_inc_excludes_dot=define
  bincompat5005=undef
  Compiler​:
  cc='cc'
  ccflags ='-fno-common -DPERL_DARWIN -mmacosx-version-min=10.9 -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -DPERL_USE_SAFE_PUTENV'
  optimize='-O3'
  cppflags='-fno-common -DPERL_DARWIN -mmacosx-version-min=10.9 -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
  ccversion=''
  gccversion='4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)'
  gccosandvers=''
  intsize=4
  longsize=8
  ptrsize=8
  doublesize=8
  byteorder=12345678
  doublekind=3
  d_longlong=define
  longlongsize=8
  d_longdbl=define
  longdblsize=16
  longdblkind=3
  ivtype='long'
  ivsize=8
  nvtype='double'
  nvsize=8
  Off_t='off_t'
  lseeksize=8
  alignbytes=8
  prototype=define
  Linker and Libraries​:
  ld='cc'
  ldflags =' -mmacosx-version-min=10.9 -fstack-protector -L/usr/local/lib'
  libpth=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/lib /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/lib /usr/local/lib /usr/lib
  libs=-lpthread -lgdbm -ldbm -ldl -lm -lutil -lc
  perllibs=-lpthread -ldl -lm -lutil -lc
  libc=
  so=dylib
  useshrplib=false
  libperl=libperl.a
  gnulibc_version=''
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs
  dlext=bundle
  d_dlsymun=undef
  ccdlflags=' '
  cccdlflags=' '
  lddlflags=' -mmacosx-version-min=10.9 -bundle -undefined dynamic_lookup -L/usr/local/lib -fstack-protector'

Characteristics of this binary (from libperl)​:
  Compile-time options​:
  HAS_TIMES
  PERLIO_LAYERS
  PERL_COPY_ON_WRITE
  PERL_DONT_CREATE_GVSV
  PERL_EXTERNAL_GLOB
  PERL_IS_MINIPERL
  PERL_MALLOC_WRAP
  PERL_OP_PARENT
  PERL_PRESERVE_IVUV
  PERL_USE_DEVEL
  PERL_USE_SAFE_PUTENV
  USE_64_BIT_ALL
  USE_64_BIT_INT
  USE_LARGE_FILES
  USE_LOCALE
  USE_LOCALE_COLLATE
  USE_LOCALE_CTYPE
  USE_LOCALE_NUMERIC
  USE_LOCALE_TIME
  USE_PERLIO
  USE_PERL_ATOF
  USE_SITECUSTOMIZE
  Built under darwin
  Compiled at Sep 14 2017 17​:50​:58
  %ENV​:
  PERLBREW_BASHRC_VERSION="0.78"
  PERLBREW_HOME="/Users/dur-randir/.perlbrew"
  PERLBREW_MANPATH="/Users/dur-randir/perlbrew/perls/perl-5.22.1/man"
  PERLBREW_PATH="/Users/dur-randir/perlbrew/bin​:/Users/dur-randir/perlbrew/perls/perl-5.22.1/bin"
  PERLBREW_PERL="perl-5.22.1"
  PERLBREW_ROOT="/Users/dur-randir/perlbrew"
  PERLBREW_VERSION="0.78"
  @​INC​:
  /Users/dur-randir/Projects/perl-git/cpan/AutoLoader/lib
  /Users/dur-randir/Projects/perl-git/dist/Carp/lib
  /Users/dur-randir/Projects/perl-git/dist/PathTools
  /Users/dur-randir/Projects/perl-git/dist/PathTools/lib
  /Users/dur-randir/Projects/perl-git/cpan/ExtUtils-Install/lib
  /Users/dur-randir/Projects/perl-git/cpan/ExtUtils-MakeMaker/lib
  /Users/dur-randir/Projects/perl-git/cpan/ExtUtils-Manifest/lib
  /Users/dur-randir/Projects/perl-git/cpan/File-Path/lib
  /Users/dur-randir/Projects/perl-git/ext/re
  /Users/dur-randir/Projects/perl-git/dist/Term-ReadLine/lib
  /Users/dur-randir/Projects/perl-git/dist/Exporter/lib
  /Users/dur-randir/Projects/perl-git/ext/File-Find/lib
  /Users/dur-randir/Projects/perl-git/cpan/Text-Tabs/lib
  /Users/dur-randir/Projects/perl-git/dist/constant/lib
  /Users/dur-randir/Projects/perl-git/cpan/version/lib
  /Users/dur-randir/Projects/perl-git/lib
  .

@p5pRT
Copy link
Author

p5pRT commented Sep 15, 2017

From @tonycoz

On Thu, 14 Sep 2017 08​:13​:05 -0700, randir wrote​:

It seems that OS X (at least, older ones) lacks linkat()
implementation despite advertised support (man 2 linkat specifies no
special requirements for it).

My 10.11 system has unlinkat().

It and the other *at() functions appear to have been introduced in 10.10*.

Please try the attached.

Thanks,
Tony

* golang/go#14458

@p5pRT
Copy link
Author

p5pRT commented Sep 15, 2017

From @tonycoz

0001-perl-132087-correct-at-function-detection-on-older-d.patch
From 01df386a21fe0006475c9f39875be7545c090281 Mon Sep 17 00:00:00 2001
From: Tony Cook <tony@develop-help.com>
Date: Fri, 15 Sep 2017 10:25:10 +1000
Subject: [PATCH] (perl #132087) correct *at() function detection on older
 darwin

---
 hints/darwin.sh | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/hints/darwin.sh b/hints/darwin.sh
index 690fe4e..1eab8ea 100644
--- a/hints/darwin.sh
+++ b/hints/darwin.sh
@@ -511,3 +511,16 @@ if test "$d_unsetenv" = "$define" -a \
         ccflags="$ccflags -DPERL_USE_SAFE_PUTENV"
 fi
 EOOVER
+
+# if you use a newer toolchain before OS X 10.9 these functions may be
+# incorrectly detected, so disable them
+# OS X 10.10.x corresponds to kernel 14.x
+case "$osvers" in
+    [1-9].*|1[0-3].*)
+	d_linkat=false
+	d_openat=false
+	d_renameat=false
+	d_unlinkat=false
+	d_fchmodat=false
+	;;
+esac
-- 
2.8.4 (Apple Git-73)

@p5pRT
Copy link
Author

p5pRT commented Sep 15, 2017

From @tonycoz

On Thu, 14 Sep 2017 17​:27​:39 -0700, tonyc wrote​:

On Thu, 14 Sep 2017 08​:13​:05 -0700, randir wrote​:

It seems that OS X (at least, older ones) lacks linkat()
implementation despite advertised support (man 2 linkat specifies no
special requirements for it).

My 10.11 system has unlinkat().

It and the other *at() functions appear to have been introduced in 10.10*.

Please try the attached.

Urr, please try this one instead.

Thanks,
Tony

@p5pRT
Copy link
Author

p5pRT commented Sep 15, 2017

From @tonycoz

0001-perl-132087-correct-at-function-detection-on-older-d.patch
From a76d0c2e0ab8cdd0a2a3862cbe526e01356f5f24 Mon Sep 17 00:00:00 2001
From: Tony Cook <tony@develop-help.com>
Date: Fri, 15 Sep 2017 10:25:10 +1000
Subject: (perl #132087) correct *at() function detection on older darwin

---
 hints/darwin.sh | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/hints/darwin.sh b/hints/darwin.sh
index 690fe4e..56e6478 100644
--- a/hints/darwin.sh
+++ b/hints/darwin.sh
@@ -511,3 +511,16 @@ if test "$d_unsetenv" = "$define" -a \
         ccflags="$ccflags -DPERL_USE_SAFE_PUTENV"
 fi
 EOOVER
+
+# if you use a newer toolchain before OS X 10.9 these functions may be
+# incorrectly detected, so disable them
+# OS X 10.10.x corresponds to kernel 14.x
+case "$osvers" in
+    [1-9].*|1[0-3].*)
+	d_linkat=undef
+	d_openat=undef
+	d_renameat=undef
+	d_unlinkat=undef
+	d_fchmodat=undef
+	;;
+esac
-- 
2.8.4 (Apple Git-73)

@p5pRT
Copy link
Author

p5pRT commented Sep 15, 2017

From @dur-randir

On Thu, 14 Sep 2017 17​:46​:22 -0700, tonyc wrote​:

Urr, please try this one instead.

This one works for me.

@p5pRT
Copy link
Author

p5pRT commented Sep 18, 2017

From @tonycoz

On Fri, 15 Sep 2017 02​:21​:55 -0700, randir wrote​:

On Thu, 14 Sep 2017 17​:46​:22 -0700, tonyc wrote​:

Urr, please try this one instead.

This one works for me.

Thanks for the confirmation.

Applied to blead as ac1ba09.

Tony

@p5pRT
Copy link
Author

p5pRT commented Sep 18, 2017

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

@p5pRT
Copy link
Author

p5pRT commented Jun 23, 2018

From @khwilliamson

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

With the release yesterday of Perl 5.28.0, this and 185 other issues have been
resolved.

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

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

@p5pRT p5pRT closed this as completed Jun 23, 2018
@p5pRT
Copy link
Author

p5pRT commented Jun 23, 2018

@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