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
Comments
From @dur-randirCreated by @dur-randirCommit 733612e broke blead commit 733612e (perl #127663) use *at() functions to handle perl code that chdirs Unfortunately this means systems that don't have the *at() functions With the following output: ./miniperl -Ilib make_ext.pl lib/auto/Cwd/Cwd.bundle dyld: Symbol not found: _linkat Unsuccessful Makefile.PL(cpan/DB_File): code=5 at make_ext.pl line 518. Perl Info
|
From zefram@fysh.orgSergey Aleynikov wrote:
The commit adds code that uses linkat() without making that conditional -zefram |
The RT System itself - Status changed from 'new' to 'open' |
From @jkeenanOn Thu, 14 Sep 2017 12:30:17 GMT, randir 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. The patch is also available via the jkeenan/132087-has-linkat branch. Can you try it out? Thank you very much. -- |
From @jkeenan0001-Make-use-of-at-functions-dependent-upon-HAS_LINKAT.patchFrom 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
|
From @dur-randirOn Thu, 14 Sep 2017 07:55:39 -0700, jkeenan wrote:
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: /* HAS_UNLINKAT: /* HAS_RENAMEAT: /* HAS_LINKAT: /* 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> int main() { And compiled & run it with: % gcc -o test test.c dyld: Symbol not found: _linkat 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). |
From @jkeenanOn Thu, 14 Sep 2017 14:55:39 GMT, jkeenan wrote:
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. -- |
From @jkeenan0002-Revise-tests-to-account-for-d_linkat.patchFrom 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
|
From @jkeenanOn Thu, 14 Sep 2017 15:13:05 GMT, randir wrote:
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 -- |
From @craigberryOn Thu, Sep 14, 2017 at 11:52 AM, James E Keenan via RT
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 ./miniperl -Ilib -V There may be a scenario in which Configure could detect the presence |
From @dur-randirOn Thu, 14 Sep 2017 10:42:35 -0700, craig.a.berry@gmail.com wrote:
As stated in the report, this is OS X 10.9.5.
They all are built on the same system.
Here it is: % ./miniperl -Ilib -V Characteristics of this binary (from libperl): |
From @tonycozOn Thu, 14 Sep 2017 08:13:05 -0700, randir wrote:
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, |
From @tonycoz0001-perl-132087-correct-at-function-detection-on-older-d.patchFrom 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)
|
From @tonycozOn Thu, 14 Sep 2017 17:27:39 -0700, tonyc wrote:
Urr, please try this one instead. Thanks, |
From @tonycoz0001-perl-132087-correct-at-function-detection-on-older-d.patchFrom 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)
|
From @dur-randirOn Thu, 14 Sep 2017 17:46:22 -0700, tonyc wrote:
This one works for me. |
@tonycoz - Status changed from 'open' to 'pending release' |
From @khwilliamsonThank 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 Perl 5.28.0 may be downloaded via: If you find that the problem persists, feel free to reopen this ticket. |
@khwilliamson - Status changed from 'pending release' to 'resolved' |
Migrated from rt.perl.org#132087 (status was 'resolved')
Searchable as RT132087$
The text was updated successfully, but these errors were encountered: