aboutsummaryrefslogtreecommitdiff
path: root/libphobos
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2019-04-24 18:57:36 +0000
committerIain Buclaw <ibuclaw@gcc.gnu.org>2019-04-24 18:57:36 +0000
commit58990c4d3a94334bcf1cd4f8dd7c2ba2888263e1 (patch)
tree881f93120730a284d99101d8d87aa62f84d9c3be /libphobos
parent265e6a0ae0e9dc0c810edc6158299f0ed1aa05ab (diff)
libphobos: Fix FAIL phobos.exp/core.time on CentOS 5.11, Linux 2.6.18
Merges upstream druntime e03164b5. Reviewed-on: https://github.com/dlang/druntime/pull/2581 libphobos/ChangeLog: 2019-04-24 Iain Buclaw <ibuclaw@gdcproject.org> PR d/89432 * testsuite/lib/libphobos.exp (check_effective_target_linux_pre_2639): New proc. * testsuite/libphobos.druntime/druntime.exp: Add compiler flag -fversion=Linux_Pre_2639 if target is linux_pre_2639. * testsuite/libphobos.druntime_shared/druntime_shared.exp: Likewise. From-SVN: r270554
Diffstat (limited to 'libphobos')
-rw-r--r--libphobos/ChangeLog9
-rw-r--r--libphobos/libdruntime/MERGE2
-rw-r--r--libphobos/libdruntime/core/time.d7
-rw-r--r--libphobos/testsuite/lib/libphobos.exp17
-rw-r--r--libphobos/testsuite/libphobos.druntime/druntime.exp8
-rw-r--r--libphobos/testsuite/libphobos.druntime_shared/druntime_shared.exp8
6 files changed, 46 insertions, 5 deletions
diff --git a/libphobos/ChangeLog b/libphobos/ChangeLog
index ffe44fb37f2..2d036d6d297 100644
--- a/libphobos/ChangeLog
+++ b/libphobos/ChangeLog
@@ -1,5 +1,14 @@
2019-04-24 Iain Buclaw <ibuclaw@gdcproject.org>
+ PR d/89432
+ * testsuite/lib/libphobos.exp (check_effective_target_linux_pre_2639):
+ New proc.
+ * testsuite/libphobos.druntime/druntime.exp: Add compiler flag
+ -fversion=Linux_Pre_2639 if target is linux_pre_2639.
+ * testsuite/libphobos.druntime_shared/druntime_shared.exp: Likewise.
+
+2019-04-24 Iain Buclaw <ibuclaw@gdcproject.org>
+
PR d/88654
* testsuite/lib/libphobos.exp (libphobos-dg-test): Check
libphobos_skipped_test_p before running test.
diff --git a/libphobos/libdruntime/MERGE b/libphobos/libdruntime/MERGE
index 9fe51fd5ae9..d815647f969 100644
--- a/libphobos/libdruntime/MERGE
+++ b/libphobos/libdruntime/MERGE
@@ -1,4 +1,4 @@
-513652173d6f02206be3ddaa2b6ed0b191ea4e3d
+e03164b5259a9f116eb91dfa5a18c192fa72e575
The first line of this file holds the git revision number of the last
merge done from the dlang/druntime repository.
diff --git a/libphobos/libdruntime/core/time.d b/libphobos/libdruntime/core/time.d
index 1982122858e..a7640ec1912 100644
--- a/libphobos/libdruntime/core/time.d
+++ b/libphobos/libdruntime/core/time.d
@@ -2539,8 +2539,11 @@ unittest
static bool clockSupported(ClockType c)
{
- version (Linux_Pre_2639) // skip CLOCK_BOOTTIME on older linux kernels
- return c != ClockType.second && c != ClockType.bootTime;
+ // Skip unsupported clocks on older linux kernels, assume that only
+ // CLOCK_MONOTONIC and CLOCK_REALTIME exist, as that is the lowest
+ // common denominator supported by all versions of Linux pre-2.6.12.
+ version (Linux_Pre_2639)
+ return c == ClockType.normal || c == ClockType.precise;
else
return c != ClockType.second; // second doesn't work with MonoTimeImpl
diff --git a/libphobos/testsuite/lib/libphobos.exp b/libphobos/testsuite/lib/libphobos.exp
index d47da178b7e..d3fe75358c8 100644
--- a/libphobos/testsuite/lib/libphobos.exp
+++ b/libphobos/testsuite/lib/libphobos.exp
@@ -261,3 +261,20 @@ proc check_effective_target_libcurl_available { } {
int main (void) { return 0; }
} "-lcurl"]
}
+
+# Return true if the target is linux version < 2.6.39
+proc check_effective_target_linux_pre_2639 { } {
+ if { ![istarget *-*-linux*] } {
+ return 0
+ }
+
+ if { [check_no_compiler_messages linux_pre_2639 assembly {
+ #include <linux/version.h>
+ #if !defined LINUX_VERSION_CODE || LINUX_VERSION_CODE < KERNEL_VERSION(2.6.39)
+ #error Yes, it is.
+ #endif
+ }] } {
+ return 0
+ }
+ return 1
+}
diff --git a/libphobos/testsuite/libphobos.druntime/druntime.exp b/libphobos/testsuite/libphobos.druntime/druntime.exp
index f93562b476b..0f792356500 100644
--- a/libphobos/testsuite/libphobos.druntime/druntime.exp
+++ b/libphobos/testsuite/libphobos.druntime/druntime.exp
@@ -22,13 +22,19 @@ if { ![isnative] || ![is-effective-target static] } {
# Gather a list of all tests.
set tests [lsort [filter_libphobos_unittests [find $srcdir/../libdruntime "*.d"]]]
+set version_flags ""
+
+if { [is-effective-target linux_pre_2639] } {
+ lappend version_flags "-fversion=Linux_Pre_2639"
+}
+
# Initialize dg.
dg-init
# Main loop.
foreach test $tests {
set libphobos_test_name "$subdir/[dg-trim-dirname $srcdir/../libdruntime $test]"
- dg-runtest $test "" "-fmain -fbuilding-libphobos-tests"
+ dg-runtest $test "" "-fmain -fbuilding-libphobos-tests $version_flags"
set libphobos_test_name ""
}
diff --git a/libphobos/testsuite/libphobos.druntime_shared/druntime_shared.exp b/libphobos/testsuite/libphobos.druntime_shared/druntime_shared.exp
index 77b0402d029..1a067c3177c 100644
--- a/libphobos/testsuite/libphobos.druntime_shared/druntime_shared.exp
+++ b/libphobos/testsuite/libphobos.druntime_shared/druntime_shared.exp
@@ -22,6 +22,12 @@ if { ![isnative] || ![is-effective-target shared] } {
# Gather a list of all tests.
set tests [lsort [filter_libphobos_unittests [find $srcdir/../libdruntime "*.d"]]]
+set version_flags ""
+
+if { [is-effective-target linux_pre_2639] } {
+ lappend version_flags "-fversion=Linux_Pre_2639"
+}
+
# Initialize dg.
dg-init
@@ -29,7 +35,7 @@ dg-init
foreach test $tests {
set libphobos_test_name "$subdir/[dg-trim-dirname $srcdir/../libdruntime $test]"
dg-runtest $test "-fversion=Shared -shared-libphobos" \
- "-fmain -fbuilding-libphobos-tests -fno-moduleinfo"
+ "-fmain -fbuilding-libphobos-tests -fno-moduleinfo $version_flags"
set libphobos_test_name ""
}